Add window resize benchmark
authormorrita@google.com <morrita@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Jul 2012 02:29:12 +0000 (02:29 +0000)
committermorrita@google.com <morrita@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Jul 2012 02:29:12 +0000 (02:29 +0000)
https://bugs.webkit.org/show_bug.cgi?id=91070

Reviewed by Ryosuke Niwa.

PerformanceTests:

Added window-resize.html which exercise html5.html. This test
resizes the window and forces re-layout repeatedly.

* Interactive/resources/window-resize.js: Added.
* Interactive/window-resize.html: Added.
* Parser/resources/html5.html: Modified to inject driver scripts.

Tools:

Added some more output filters to take care of html5.html output.

* Scripts/webkitpy/performance_tests/perftest.py:
(PerfTest):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123063 268f45cc-cd09-0410-ab3c-d52691b4dbfc

PerformanceTests/ChangeLog
PerformanceTests/Interactive/resources/window-resize.js [new file with mode: 0644]
PerformanceTests/Interactive/window-resize.html [new file with mode: 0644]
PerformanceTests/Parser/resources/html5.html
Tools/ChangeLog
Tools/Scripts/webkitpy/performance_tests/perftest.py

index 391a82c..9bd8c66 100644 (file)
@@ -1,3 +1,17 @@
+2012-07-18  MORITA Hajime  <morrita@google.com>
+
+        Add window resize benchmark
+        https://bugs.webkit.org/show_bug.cgi?id=91070
+
+        Reviewed by Ryosuke Niwa.
+
+        Added window-resize.html which exercise html5.html. This test
+        resizes the window and forces re-layout repeatedly.
+
+        * Interactive/resources/window-resize.js: Added.
+        * Interactive/window-resize.html: Added.
+        * Parser/resources/html5.html: Modified to inject driver scripts.
+
 2012-07-11  Philip Rogers  <pdr@google.com>
 
         Add a performance test for hit testing in SVG
 2012-07-11  Philip Rogers  <pdr@google.com>
 
         Add a performance test for hit testing in SVG
diff --git a/PerformanceTests/Interactive/resources/window-resize.js b/PerformanceTests/Interactive/resources/window-resize.js
new file mode 100644 (file)
index 0000000..99fdc1e
--- /dev/null
@@ -0,0 +1,31 @@
+if (window.testRunner)
+    testRunner.dumpAsText();
+
+(function() {
+    var portrait = { width: window.innerWidth, height: window.innerHeight };
+    var landscape = { width: window.innerHeight, height: window.innerWidth };
+
+    var run = function() {
+        window.resizeTo(portrait.width, portrait.height);
+        document.body.offsetTop;
+        window.resizeTo(landscape.width, landscape.height);
+        document.body.offsetTop;
+    };
+
+    function onTestDone() {
+        var logNode = document.getElementById("log");
+        logNode.parentNode.removeChild(logNode);
+        document.body.innerHTML = "";
+        document.body.appendChild(logNode);
+    };
+
+    function startTest() {
+        PerfTestRunner.runPerSecond({
+            description: "Exercising window resize and following relayout",
+            run: run,
+            done: onTestDone
+        });
+    }
+
+    document.addEventListener("DOMContentLoaded", startTest);
+})();
diff --git a/PerformanceTests/Interactive/window-resize.html b/PerformanceTests/Interactive/window-resize.html
new file mode 100644 (file)
index 0000000..d080baa
--- /dev/null
@@ -0,0 +1,5 @@
+<script>
+if (window.testRunner)
+    testRunner.waitUntilDone();
+window.location = "../Parser/resources/html5.html?test=../../Interactive/resources/window-resize.js";
+</script>
index 337238b..dd97b5c 100644 (file)
        if (!startedInit)
          showAlert("Too slow? Try reading the multipage copy of the spec instead:", "http://whatwg.org/html");
      }, 6000);
        if (!startedInit)
          showAlert("Too slow? Try reading the multipage copy of the spec instead:", "http://whatwg.org/html");
      }, 6000);
-  </script><body onload=init()>
+  </script>
+  <!-- BEGIN WEBKIT EDITS -->
+  <script><!--
+  if (0 <= window.location.search.indexOf("test")) {
+      var query = window.location.search;
+      var key = "test=";
+      var path = query.substring(query.indexOf(key) + key.length);
+      document.write("<script src='../../resources/runner.js'></script>");
+      document.write("<script src='" + path + "'></script>");
+  }
+  --></script>
+  <!-- END WEBKIT EDITS -->
+<body onload=init()>
 
   <header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
    <hgroup><h1 class=allcaps>HTML</h1>
 
   <header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
    <hgroup><h1 class=allcaps>HTML</h1>
index 3bad2cd..05c3bfd 100644 (file)
@@ -1,3 +1,15 @@
+2012-07-18  MORITA Hajime  <morrita@google.com>
+
+        Add window resize benchmark
+        https://bugs.webkit.org/show_bug.cgi?id=91070
+
+        Reviewed by Ryosuke Niwa.
+
+        Added some more output filters to take care of html5.html output.
+
+        * Scripts/webkitpy/performance_tests/perftest.py:
+        (PerfTest):
+
 2012-07-18  Dirk Pranke  <dpranke@chromium.org>
 
         nrwt: merge WebKitDriver into Driver
 2012-07-18  Dirk Pranke  <dpranke@chromium.org>
 
         nrwt: merge WebKitDriver into Driver
index de63f3e..8623c0a 100644 (file)
@@ -99,7 +99,9 @@ class PerfTest(object):
         # Following are for handle existing test like Dromaeo
         re.compile(re.escape("""main frame - has 1 onunload handler(s)""")),
         re.compile(re.escape("""frame "<!--framePath //<!--frame0-->-->" - has 1 onunload handler(s)""")),
         # Following are for handle existing test like Dromaeo
         re.compile(re.escape("""main frame - has 1 onunload handler(s)""")),
         re.compile(re.escape("""frame "<!--framePath //<!--frame0-->-->" - has 1 onunload handler(s)""")),
-        re.compile(re.escape("""frame "<!--framePath //<!--frame0-->/<!--frame0-->-->" - has 1 onunload handler(s)"""))]
+        re.compile(re.escape("""frame "<!--framePath //<!--frame0-->/<!--frame0-->-->" - has 1 onunload handler(s)""")),
+        # Following is for html5.html
+        re.compile(re.escape("""Blocked access to external URL http://www.whatwg.org/specs/web-apps/current-work/"""))]
 
     _statistics_keys = ['avg', 'median', 'stdev', 'min', 'max']
 
 
     _statistics_keys = ['avg', 'median', 'stdev', 'min', 'max']