Bug 1440537 - Fix docshell swap test to not rely on cross-docgroup flushing. r=bzbarsky
authorEmilio Cobos Álvarez <emilio@crisal.io>
Sat, 20 Apr 2019 19:42:30 +0200
changeset 530463 a07956b430eb080767e43e1ecea50821be0de1a2
parent 530462 40ccb621b5d137feb6d7f82eb2b7facd8d8f837f
child 530464 5b63c5b38dcc382a4fa0afdbbf67b147057c4fac
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)
reviewersbzbarsky
bugs1440537
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 1440537 - Fix docshell swap test to not rely on cross-docgroup flushing. r=bzbarsky This flush used to happen from snapshotWindow's innerWidth / innerHeight / scroll* getters. Differential Revision: https://phabricator.services.mozilla.com/D28303
docshell/test/chrome/bug113934_window.xul
--- a/docshell/test/chrome/bug113934_window.xul
+++ b/docshell/test/chrome/bug113934_window.xul
@@ -112,16 +112,19 @@
             $("f1").swapDocShells($("f3"));
             // now we have DOMs 2, 1, 2* in the frames
 
             l1.detach();
             l2.detach();
             l3.detach();
             l4.detach();
 
+            // swapDocShells reflows asynchronously, ensure layout is
+            // clean so that the viewport of f1 is the right size.
+            $("f1").getBoundingClientRect();
             var s1_new = snapshotWindow($("f1").contentWindow);
             var [same, first, second] = compareSnapshots(s1_new, s2, true);
             ok(same, "Should reflow on swap. Expected " + second + " but got " + first);
 
             is(strs["f1"], "f1.pagehide f1.pageshow");
             is(strs["f3"], "f3.pagehide f3.pageshow");
             this._afterFirst = true;
             return;