Bug 620040 - Random failure into browser_forms.js [r=mfinkle]

This commit is contained in:
Vivien Nicolas 2010-12-21 19:14:12 +01:00
Родитель 2343454f9d
Коммит a5006c93ba
1 изменённых файлов: 9 добавлений и 7 удалений

Просмотреть файл

@ -2,23 +2,25 @@ let testURL = chromeRoot + "browser_forms.html";
messageManager.loadFrameScript(chromeRoot + "remote_forms.js", true);
let newTab = null;
let isLoading = function() {
return !newTab.isLoading() && newTab.browser.currentURI.spec != "about:blank";
};
function test() {
// This test is async
waitForExplicitFinish();
// Need to wait until the page is loaded
messageManager.addMessageListener("pageshow", function(aMessage) {
if (newTab.browser.currentURI.spec != "about:blank") {
messageManager.removeMessageListener(aMessage.name, arguments.callee);
setTimeout(onTabLoaded, 0);
}
});
// Add new tab to hold the <FormAssistant> page
newTab = Browser.addTab(testURL, true);
BrowserUI.closeAutoComplete(true);
// Wait for the tab to load, then do the test
waitFor(onTabLoaded, isLoading);
}
function onTabLoaded() {
BrowserUI.closeAutoComplete(true);
testMouseEvents();
}