Bug 1532672 [wpt PR 15633] - [visual viewport] Wait for all tests to be defined, a=testonly
authorMike Pennisi <mike@mikepennisi.com>
Thu, 18 Apr 2019 11:58:26 +0000
changeset 529966 57f37b8779ac4e2e400da6a942c797a73552aa74
parent 529965 7a8e50be32d05b97040f7e2e00bba490f788fadc
child 529967 0ff807f08f6dad30413584a27b4235a716d7867e
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1532672, 15633
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1532672 [wpt PR 15633] - [visual viewport] Wait for all tests to be defined, a=testonly Automatic update from web-platform-tests [visual viewport] Wait for all tests to be defined Configure the test harness to delay completion until all asynchronously-defined tests are available. -- wpt-commits: c6b4c117ceb0f89201188d017d6ba4b1e6cf1262 wpt-pr: 15633
testing/web-platform/tests/visual-viewport/viewport-scrollbars-cause-resize.html
--- a/testing/web-platform/tests/visual-viewport/viewport-scrollbars-cause-resize.html
+++ b/testing/web-platform/tests/visual-viewport/viewport-scrollbars-cause-resize.html
@@ -10,16 +10,18 @@
     </head>
     <body>
     <h1>Viewport: Scrollbars Cause Resize</h1>
     <h4>
         Test Description: This test checks that the appearance of classic
         scrollbars will cause a resize event to be fired at window.visualViewport.
     </h4>
     <script>
+      setup({ explicit_done: true });
+
       function runTest() {
         var scrollbarThickness = calculateScrollbarThickness();
 
         document.documentElement.style.overflow = "hidden";
         var initialWidth = visualViewport.width;
         var initialHeight = visualViewport.height;
 
         test(function() {
@@ -54,13 +56,19 @@
 
 
         document.body.style.width = "";
         document.body.style.height = "";
       }
 
       // Run the test after load to make sure any resize from a previous test
       // doesn't interfere.
-      window.onload = runTest;
+      window.onload = function() {
+        try {
+          runTest();
+        } finally {
+          done();
+        }
+      };
     </script>
     <div id="log"></div>
     </body>
 </html>