<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[189420] trunk/Source/WebInspectorUI</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/189420">189420</a></dd>
<dt>Author</dt> <dd>bburg@apple.com</dd>
<dt>Date</dt> <dd>2015-09-04 22:29:36 -0700 (Fri, 04 Sep 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: combine Test.html resources to make tests run faster
https://bugs.webkit.org/show_bug.cgi?id=148726

Reviewed by Timothy Hatcher.

In an attempt to make inspector tests run faster, always combine resources
on the Test.html page. This cuts down from 110+ resource loads to 5 loads.

To avoid name clashes, add the 'Combined' suffix to files that would clash
with uncombined Test resources, and add the 'Test' prefix when combining
or minifying files that would clash with production minification. So, it
would be possible for Main.html and Test.html to have different minified
versions of CodeMirror or other external libraries if they use different
subsets.

Combining is unlikely to make debugging tests more difficult, since almost
all test code is marshalled and eval'd into existence anyway.

* Configurations/WebInspectorUIFramework.xcconfig:
* Scripts/combine-resources.pl: Drive-by spelling.
(concatenateFiles):
(concatinateFiles): Deleted.
* Scripts/copy-user-interface-resources-dryrun.rb:
* Scripts/copy-user-interface-resources.pl:

    Drive-by spelling. Add a new code path for combining Test resources, which
    doesn't require minification or handling CSS, images, or most externals.

* WebInspectorUI.vcxproj/build-webinspectorui.pl:

    Always combine Test.html, but also ditto everything into place for
    engineering builds.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIConfigurationsWebInspectorUIFrameworkxcconfig">trunk/Source/WebInspectorUI/Configurations/WebInspectorUIFramework.xcconfig</a></li>
<li><a href="#trunkSourceWebInspectorUIScriptscombineresourcespl">trunk/Source/WebInspectorUI/Scripts/combine-resources.pl</a></li>
<li><a href="#trunkSourceWebInspectorUIScriptscopyuserinterfaceresourcesdryrunrb">trunk/Source/WebInspectorUI/Scripts/copy-user-interface-resources-dryrun.rb</a></li>
<li><a href="#trunkSourceWebInspectorUIScriptscopyuserinterfaceresourcespl">trunk/Source/WebInspectorUI/Scripts/copy-user-interface-resources.pl</a></li>
<li><a href="#trunkSourceWebInspectorUIWebInspectorUIvcxprojbuildwebinspectoruipl">trunk/Source/WebInspectorUI/WebInspectorUI.vcxproj/build-webinspectorui.pl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (189419 => 189420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2015-09-05 05:29:24 UTC (rev 189419)
+++ trunk/Source/WebInspectorUI/ChangeLog        2015-09-05 05:29:36 UTC (rev 189420)
</span><span class="lines">@@ -1,3 +1,38 @@
</span><ins>+2015-09-04  Brian Burg  &lt;bburg@apple.com&gt;
+
+        Web Inspector: combine Test.html resources to make tests run faster
+        https://bugs.webkit.org/show_bug.cgi?id=148726
+
+        Reviewed by Timothy Hatcher.
+
+        In an attempt to make inspector tests run faster, always combine resources
+        on the Test.html page. This cuts down from 110+ resource loads to 5 loads.
+
+        To avoid name clashes, add the 'Combined' suffix to files that would clash
+        with uncombined Test resources, and add the 'Test' prefix when combining
+        or minifying files that would clash with production minification. So, it
+        would be possible for Main.html and Test.html to have different minified
+        versions of CodeMirror or other external libraries if they use different
+        subsets.
+
+        Combining is unlikely to make debugging tests more difficult, since almost
+        all test code is marshalled and eval'd into existence anyway.
+
+        * Configurations/WebInspectorUIFramework.xcconfig:
+        * Scripts/combine-resources.pl: Drive-by spelling.
+        (concatenateFiles):
+        (concatinateFiles): Deleted.
+        * Scripts/copy-user-interface-resources-dryrun.rb:
+        * Scripts/copy-user-interface-resources.pl:
+
+            Drive-by spelling. Add a new code path for combining Test resources, which
+            doesn't require minification or handling CSS, images, or most externals.
+
+        * WebInspectorUI.vcxproj/build-webinspectorui.pl:
+
+            Always combine Test.html, but also ditto everything into place for
+            engineering builds.
+
</ins><span class="cx"> 2015-09-04  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: Test Runtime.saveResult and $n values
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIConfigurationsWebInspectorUIFrameworkxcconfig"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/Configurations/WebInspectorUIFramework.xcconfig (189419 => 189420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/Configurations/WebInspectorUIFramework.xcconfig        2015-09-05 05:29:24 UTC (rev 189419)
+++ trunk/Source/WebInspectorUI/Configurations/WebInspectorUIFramework.xcconfig        2015-09-05 05:29:36 UTC (rev 189420)
</span><span class="lines">@@ -36,3 +36,8 @@
</span><span class="cx"> COMBINE_INSPECTOR_RESOURCES_Debug = NO;
</span><span class="cx"> COMBINE_INSPECTOR_RESOURCES_Release = NO;
</span><span class="cx"> COMBINE_INSPECTOR_RESOURCES_Production = YES;
</span><ins>+
+COMBINE_TEST_RESOURCES = $(COMBINE_TEST_RESOURCES_$(CONFIGURATION));
+COMBINE_TEST_RESOURCES_Debug = YES;
+COMBINE_TEST_RESOURCES_Release = YES;
+COMBINE_TEST_RESOURCES_Production = YES;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIScriptscombineresourcespl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/Scripts/combine-resources.pl (189419 => 189420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/Scripts/combine-resources.pl        2015-09-05 05:29:24 UTC (rev 189419)
+++ trunk/Source/WebInspectorUI/Scripts/combine-resources.pl        2015-09-05 05:29:36 UTC (rev 189420)
</span><span class="lines">@@ -1,5 +1,28 @@
</span><span class="cx"> #!/usr/bin/perl -w
</span><span class="cx"> 
</span><ins>+# Copyright (C) 2015 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGE.
+
</ins><span class="cx"> use strict;
</span><span class="cx"> use Getopt::Long;
</span><span class="cx"> use File::Basename;
</span><span class="lines">@@ -42,11 +65,11 @@
</span><span class="cx"> 
</span><span class="cx"> mkpath $outputDirectory;
</span><span class="cx"> 
</span><del>-sub concatinateFiles($$$)
</del><ins>+sub concatenateFiles($$$)
</ins><span class="cx"> {
</span><span class="cx">     my $filename = shift;
</span><span class="cx">     my $tagExpression = shift;
</span><del>-    my $concatinatedTag = shift;
</del><ins>+    my $concatenatedTag = shift;
</ins><span class="cx">     my $fileCount = 0;
</span><span class="cx"> 
</span><span class="cx">     open OUT, &quot;&gt;&quot;, &quot;$outputDirectory/$filename&quot; or die &quot;Can't open $outputDirectory/$filename: $!&quot;;
</span><span class="lines">@@ -65,19 +88,19 @@
</span><span class="cx">     # Don't use \s so we can control the newlines we consume.
</span><span class="cx">     my $replacementExpression = &quot;([\t ]*)&quot; . $tagExpression . &quot;[\t ]*\n+&quot;;
</span><span class="cx"> 
</span><del>-    # Replace the first occurance with a token so we can inject the concatinated tag in the same place
</del><ins>+    # Replace the first occurance with a token so we can inject the concatenated tag in the same place
</ins><span class="cx">     # as the first file that got consolidated. This makes sure we preserve some order if there are other
</span><span class="cx">     # items in the head that we didn't consolidate.
</span><del>-    $headContents =~ s/$replacementExpression/$1%CONCATINATED%\n/i;
</del><ins>+    $headContents =~ s/$replacementExpression/$1%CONCATENATED%\n/i;
</ins><span class="cx">     $headContents =~ s/$replacementExpression//gi;
</span><del>-    $headContents =~ s/%CONCATINATED%/$concatinatedTag/;
</del><ins>+    $headContents =~ s/%CONCATENATED%/$concatenatedTag/;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> my $inputDirectoryPattern = &quot;(?!External\/)[^\&quot;]*&quot;;
</span><span class="cx"> $inputDirectoryPattern = $inputDirectory . &quot;\/[^\&quot;]*&quot; if $inputDirectory;
</span><span class="cx"> 
</span><del>-concatinateFiles($outputStylesheetName, &quot;&lt;link rel=\&quot;stylesheet\&quot; href=\&quot;($inputDirectoryPattern)\&quot;&gt;&quot;, &quot;&lt;link rel=\&quot;stylesheet\&quot; href=\&quot;$outputStylesheetName\&quot;&gt;&quot;) if defined $outputStylesheetName;
-concatinateFiles($outputScriptName, &quot;&lt;script src=\&quot;($inputDirectoryPattern)\&quot;&gt;&lt;\/script&gt;&quot;, &quot;&lt;script src=\&quot;$outputScriptName\&quot;&gt;&lt;/script&gt;&quot;) if defined $outputScriptName;
</del><ins>+concatenateFiles($outputStylesheetName, &quot;&lt;link rel=\&quot;stylesheet\&quot; href=\&quot;($inputDirectoryPattern)\&quot;&gt;&quot;, &quot;&lt;link rel=\&quot;stylesheet\&quot; href=\&quot;$outputStylesheetName\&quot;&gt;&quot;) if defined $outputStylesheetName;
+concatenateFiles($outputScriptName, &quot;&lt;script src=\&quot;($inputDirectoryPattern)\&quot;&gt;&lt;\/script&gt;&quot;, &quot;&lt;script src=\&quot;$outputScriptName\&quot;&gt;&lt;/script&gt;&quot;) if defined $outputScriptName;
</ins><span class="cx"> 
</span><span class="cx"> $htmlContents =~ s/&lt;head&gt;.*&lt;\/head&gt;/&lt;head&gt;$headContents&lt;\/head&gt;/si;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIScriptscopyuserinterfaceresourcesdryrunrb"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/Scripts/copy-user-interface-resources-dryrun.rb (189419 => 189420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/Scripts/copy-user-interface-resources-dryrun.rb        2015-09-05 05:29:24 UTC (rev 189419)
+++ trunk/Source/WebInspectorUI/Scripts/copy-user-interface-resources-dryrun.rb        2015-09-05 05:29:36 UTC (rev 189420)
</span><span class="lines">@@ -1,5 +1,28 @@
</span><span class="cx"> #!/usr/bin/ruby
</span><span class="cx"> 
</span><ins>+# Copyright (C) 2015 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGE.
+
</ins><span class="cx"> require 'fileutils'
</span><span class="cx"> require 'tmpdir'
</span><span class="cx"> 
</span><span class="lines">@@ -28,6 +51,7 @@
</span><span class="cx">   ENV[&quot;TARGET_BUILD_DIR&quot;] = $output_directory
</span><span class="cx">   ENV[&quot;UNLOCALIZED_RESOURCES_FOLDER_PATH&quot;] = &quot;&quot;
</span><span class="cx">   ENV[&quot;COMBINE_INSPECTOR_RESOURCES&quot;] = &quot;YES&quot;
</span><ins>+  ENV[&quot;COMBINE_TEST_RESOURCES&quot;] = &quot;YES&quot;
</ins><span class="cx">   exec COPY_USER_INTERFACE_RESOURCES_PATH
</span><span class="cx"> 
</span><span class="cx"> end
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIScriptscopyuserinterfaceresourcespl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/Scripts/copy-user-interface-resources.pl (189419 => 189420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/Scripts/copy-user-interface-resources.pl        2015-09-05 05:29:24 UTC (rev 189419)
+++ trunk/Source/WebInspectorUI/Scripts/copy-user-interface-resources.pl        2015-09-05 05:29:36 UTC (rev 189420)
</span><span class="lines">@@ -1,5 +1,28 @@
</span><span class="cx"> #!/usr/bin/perl -w
</span><span class="cx"> 
</span><ins>+# Copyright (C) 2015 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGE.
+
</ins><span class="cx"> use English;
</span><span class="cx"> use File::Copy qw(copy);
</span><span class="cx"> use File::Path qw(make_path remove_tree);
</span><span class="lines">@@ -108,7 +131,6 @@
</span><span class="cx"> my $codeMirrorLicense = readLicenseFile(File::Spec-&gt;catfile($codeMirrorPath, 'LICENSE'));
</span><span class="cx"> my $esprimaLicense = readLicenseFile(File::Spec-&gt;catfile($esprimaPath, 'LICENSE'));
</span><span class="cx"> my $eslintLicense = readLicenseFile(File::Spec-&gt;catfile($eslintPath, 'LICENSE'));
</span><del>-
</del><span class="cx"> make_path($protocolDir, $targetResourcePath);
</span><span class="cx"> 
</span><span class="cx"> # Copy over dynamically loaded files from other frameworks, even if we aren't combining resources.
</span><span class="lines">@@ -121,9 +143,11 @@
</span><span class="cx">     ditto($uiRoot, $targetResourcePath);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-if (defined $ENV{'COMBINE_INSPECTOR_RESOURCES'} &amp;&amp; ($ENV{'COMBINE_INSPECTOR_RESOURCES'} eq 'YES')) {
-    my $combineResourcesCmd = File::Spec-&gt;catfile($scriptsRoot, 'combine-resources.pl');
</del><ins>+my $shouldCombineMain = defined $ENV{'COMBINE_INSPECTOR_RESOURCES'} &amp;&amp; ($ENV{'COMBINE_INSPECTOR_RESOURCES'} eq 'YES');
+my $shouldCombineTest = defined $ENV{'COMBINE_TEST_RESOURCES'} &amp;&amp; ($ENV{'COMBINE_TEST_RESOURCES'} eq 'YES');
+my $combineResourcesCmd = File::Spec-&gt;catfile($scriptsRoot, 'combine-resources.pl');
</ins><span class="cx"> 
</span><ins>+if ($shouldCombineMain) {
</ins><span class="cx">     # Combine the JavaScript and CSS files in Production builds into single files (Main.js and Main.css).
</span><span class="cx">     system($combineResourcesCmd, '--input-html', File::Spec-&gt;catfile($uiRoot, 'Main.html'), '--derived-sources-dir', $derivedSourcesDir, '--output-dir', $derivedSourcesDir, '--output-script-name', 'Main.js', '--output-style-name', 'Main.css');
</span><span class="cx"> 
</span><span class="lines">@@ -182,18 +206,18 @@
</span><span class="cx">     system(qq(&quot;$python&quot; &quot;$cssMinScript&quot; &lt; &quot;$derivedSourcesMainCSS&quot; &gt;&gt; &quot;$targetMainCSS&quot;)) and die &quot;Failed to minify $derivedSourcesMainCSS: $!&quot;;
</span><span class="cx"> 
</span><span class="cx">     # Minify the CodeMirror.js and CodeMirror.css files, appending to the license that was exported above.
</span><del>-    my $derivedSouressCodeMirrorJS = File::Spec-&gt;catfile($derivedSourcesDir, 'CodeMirror.js');
</del><ins>+    my $derivedSourcesCodeMirrorJS = File::Spec-&gt;catfile($derivedSourcesDir, 'CodeMirror.js');
</ins><span class="cx">     my $derivedSourcesCodeMirrorCSS = File::Spec-&gt;catfile($derivedSourcesDir, 'CodeMirror.css');
</span><del>-    system(qq(&quot;$python&quot; &quot;$jsMinScript&quot; &lt; &quot;$derivedSouressCodeMirrorJS&quot; &gt;&gt; &quot;$targetCodeMirrorJS&quot;)) and die &quot;Failed to minify $derivedSouressCodeMirrorJS: $!&quot;;
</del><ins>+    system(qq(&quot;$python&quot; &quot;$jsMinScript&quot; &lt; &quot;$derivedSourcesCodeMirrorJS&quot; &gt;&gt; &quot;$targetCodeMirrorJS&quot;)) and die &quot;Failed to minify $derivedSourcesCodeMirrorJS: $!&quot;;
</ins><span class="cx">     system(qq(&quot;$python&quot; &quot;$cssMinScript&quot; &lt; &quot;$derivedSourcesCodeMirrorCSS&quot; &gt;&gt; &quot;$targetCodeMirrorCSS&quot;)) and die &quot;Failed to minify $derivedSourcesCodeMirrorCSS: $!&quot;;
</span><span class="cx"> 
</span><span class="cx">     # Minify the Esprima.js file, appending to the license that was exported above.
</span><del>-    my $derivedSouressEsprimaJS = File::Spec-&gt;catfile($derivedSourcesDir, 'Esprima.js');
-    system(qq(&quot;$python&quot; &quot;$jsMinScript&quot; &lt; &quot;$derivedSouressEsprimaJS&quot; &gt;&gt; &quot;$targetEsprimaJS&quot;)) and die &quot;Failed to minify $derivedSouressEsprimaJS: $!&quot;;
</del><ins>+    my $derivedSourcesEsprimaJS = File::Spec-&gt;catfile($derivedSourcesDir, 'Esprima.js');
+    system(qq(&quot;$python&quot; &quot;$jsMinScript&quot; &lt; &quot;$derivedSourcesEsprimaJS&quot; &gt;&gt; &quot;$targetEsprimaJS&quot;)) and die &quot;Failed to minify $derivedSourcesEsprimaJS: $!&quot;;
</ins><span class="cx"> 
</span><span class="cx">     # Minify the ESLint.js file, appending to the license that was exported above.
</span><del>-    my $derivedSouressESLintJS = File::Spec-&gt;catfile($derivedSourcesDir, 'ESLint.js');
-    system(qq(&quot;$python&quot; &quot;$jsMinScript&quot; &lt; &quot;$derivedSouressESLintJS&quot; &gt;&gt; &quot;$targetESLintJS&quot;)) and die &quot;Failed to minify $derivedSouressESLintJS: $!&quot;;
</del><ins>+    my $derivedSourcesESLintJS = File::Spec-&gt;catfile($derivedSourcesDir, 'ESLint.js');
+    system(qq(&quot;$python&quot; &quot;$jsMinScript&quot; &lt; &quot;$derivedSourcesESLintJS&quot; &gt;&gt; &quot;$targetESLintJS&quot;)) and die &quot;Failed to minify $derivedSourcesESLintJS: $!&quot;;
</ins><span class="cx"> 
</span><span class="cx">     # Copy over Main.html and the Images directory.
</span><span class="cx">     copy($derivedSourcesMainHTML, File::Spec-&gt;catfile($targetResourcePath, 'Main.html'));
</span><span class="lines">@@ -212,3 +236,34 @@
</span><span class="cx">     # Keep the files separate for engineering builds.
</span><span class="cx">     ditto($uiRoot, $targetResourcePath);
</span><span class="cx"> }
</span><ins>+
+if ($shouldCombineTest) {
+    # Combine the JavaScript files for testing into a single file (TestCombined.js ).
+    system($combineResourcesCmd, '--input-html', File::Spec-&gt;catfile($uiRoot, 'Test.html'), '--derived-sources-dir', $derivedSourcesDir, '--output-dir', $derivedSourcesDir, '--output-script-name', 'TestCombined.js', '--output-style-name', 'TestCombined.css');
+
+    my $derivedSourcesTestHTML = File::Spec-&gt;catfile($derivedSourcesDir, 'Test.html');
+    my $derivedSourcesTestJS = File::Spec-&gt;catfile($derivedSourcesDir, 'TestCombined.js');
+    # Combine the Esprima JavaScript files for testing into a single file (Esprima.js).
+    system($combineResourcesCmd, '--input-dir', 'External/Esprima', '--input-html', $derivedSourcesTestHTML, '--input-html-dir', $uiRoot, '--derived-sources-dir', $derivedSourcesDir, '--output-dir', $derivedSourcesDir, '--output-script-name', 'TestEsprima.js');
+
+    # Export the license into TestCombined.js.
+    my $targetTestJS = File::Spec-&gt;catfile($targetResourcePath, 'TestCombined.js');
+    seedFile($targetTestJS, $inspectorLicense);
+
+    # Export the license into Esprima.js.
+    my $targetEsprimaJS = File::Spec-&gt;catfile($targetResourcePath, 'TestEsprima.js');
+    seedFile($targetEsprimaJS, $esprimaLicense);
+
+    # Append TestCombined.js to the license that was exported above.
+    system(qq(cat &quot;$derivedSourcesTestJS&quot; &gt;&gt; &quot;$targetTestJS&quot;)) and die &quot;Failed to append $derivedSourcesTestJS: $!&quot;;
+
+    # Append Esprima.js to the license that was exported above.
+    my $derivedSourcesEsprimaJS = File::Spec-&gt;catfile($derivedSourcesDir, 'TestEsprima.js');
+    system(qq(cat &quot;$derivedSourcesEsprimaJS&quot; &gt;&gt; &quot;$targetEsprimaJS&quot;)) and die &quot;Failed to append $derivedSourcesEsprimaJS: $!&quot;;
+
+    # Copy over Test.html.
+    copy($derivedSourcesTestHTML, File::Spec-&gt;catfile($targetResourcePath, 'Test.html'));
+
+    # Copy the Legacy directory.
+    ditto(File::Spec-&gt;catfile($uiRoot, 'Protocol', 'Legacy'), File::Spec-&gt;catfile($protocolDir, 'Legacy'));
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIWebInspectorUIvcxprojbuildwebinspectoruipl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/WebInspectorUI.vcxproj/build-webinspectorui.pl (189419 => 189420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/WebInspectorUI.vcxproj/build-webinspectorui.pl        2015-09-05 05:29:24 UTC (rev 189419)
+++ trunk/Source/WebInspectorUI/WebInspectorUI.vcxproj/build-webinspectorui.pl        2015-09-05 05:29:36 UTC (rev 189420)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> #!/usr/bin/perl -w
</span><span class="cx"> 
</span><del>-# Copyright (C) 2014 Apple Inc.  All rights reserved.
</del><ins>+# Copyright (C) 2014, 2015 Apple Inc.  All rights reserved.
</ins><span class="cx"> #
</span><span class="cx"> # Redistribution and use in source and binary forms, with or without
</span><span class="cx"> # modification, are permitted provided that the following conditions
</span><span class="lines">@@ -62,6 +62,7 @@
</span><span class="cx"> 
</span><span class="cx"> $ENV{'UNLOCALIZED_RESOURCES_FOLDER_PATH'} = 'WebInspectorUI';
</span><span class="cx"> 
</span><ins>+$ENV{'COMBINE_TEST_RESOURCES'} = 'YES';
</ins><span class="cx"> if (($TARGET_BUILD_DIR =~ /Release/) || ($TARGET_BUILD_DIR =~ /Production/)) {
</span><span class="cx">     $ENV{'COMBINE_INSPECTOR_RESOURCES'} = 'YES';
</span><span class="cx"> } 
</span></span></pre>
</div>
</div>

</body>
</html>