mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-01 13:57:32 +00:00
Bug 1052009 - Enable CloudSync in Nightly (mochitest fix). r=gps
This commit is contained in:
parent
f528007ab0
commit
a316f27bea
@ -23,9 +23,12 @@ function test() {
|
||||
];
|
||||
|
||||
let nevents = 0;
|
||||
let nflushed = 0;
|
||||
function handleTabChangeEvent () {
|
||||
cloudSync.tabs.removeEventListener("change", handleTabChangeEvent);
|
||||
++ nevents;
|
||||
info("tab change event " + nevents);
|
||||
next();
|
||||
}
|
||||
|
||||
function getLocalTabs() {
|
||||
@ -50,18 +53,16 @@ function test() {
|
||||
|
||||
cloudSync.tabs.addEventListener("change", handleTabChangeEvent);
|
||||
|
||||
let nflushed = 0;
|
||||
expected.forEach(function(url) {
|
||||
let tab = gBrowser.addTab(url);
|
||||
|
||||
function flush() {
|
||||
tab.linkedBrowser.removeEventListener("load", flush);
|
||||
tab.linkedBrowser.removeEventListener("load", flush, true);
|
||||
local.TabState.flush(tab.linkedBrowser);
|
||||
++ nflushed;
|
||||
info("flushed " + nflushed);
|
||||
|
||||
if (nflushed == expected.length) {
|
||||
getLocalTabs();
|
||||
}
|
||||
next();
|
||||
}
|
||||
|
||||
tab.linkedBrowser.addEventListener("load", flush, true);
|
||||
@ -69,4 +70,10 @@ function test() {
|
||||
opentabs.push(tab);
|
||||
});
|
||||
|
||||
}
|
||||
function next() {
|
||||
if (nevents == 1 && nflushed == expected.length) {
|
||||
getLocalTabs();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user