Bug 927349 part 17 - Don't count native reflows in test_popupreflows.xul; r=markh

test_popupreflows.xul currently expects to get 1 reflow when a popup is opened.
This is triggered by JS code. An incremental layout may be triggered by native
code but the test ignores that for unclear reasons ("Because we've simply
cargo-culted this test from browser_tabopen_reflows.js!").

In part 16 on this patch series, we force interruptible reflows to become
full reflows when we have pending animations which can cause this test to
fail since it will see 2 reflows.

The above quoted browser_tabopen_reflows.js specifically ignores reflows
triggered by native code so we adjust this test to do likewise.
This commit is contained in:
Brian Birtles 2014-12-22 09:35:41 +09:00
parent 79e39d6e6a
commit 7bd49bca6c

View File

@ -26,6 +26,13 @@ let panel, anchor, arrow;
let observer = {
reflows: [],
reflow: function (start, end) {
// Ignore reflows triggered by native code
// (Reflows from native code only have an empty stack after the first frame)
var path = (new Error().stack).split("\n").slice(1).join("");
if (path === "") {
return;
}
this.reflows.push(new Error().stack);
},