Bug 706280 - Intermittent failure in browser/components/places/tests/chrome/test_bug549192.xul | Exited with code 1 during test run.

r=felipe a=tests-only
This commit is contained in:
Marco Bonardo 2011-12-13 17:27:09 +01:00
parent 83ff99096f
commit 632b40fdbb
2 changed files with 14 additions and 5 deletions

View File

@ -144,11 +144,7 @@ function endTest() {
.getMostRecentWindow("Download:Manager") .getMostRecentWindow("Download:Manager")
.close(); .close();
Cc["@mozilla.org/browser/nav-history-service;1"] waitForClearHistory(SimpleTest.finish);
.getService(Ci.nsINavHistoryService)
.removeAllPages();
SimpleTest.finish();
} }
]]> ]]>

View File

@ -168,3 +168,16 @@ function setCleanState()
let win = getDMWindow(); let win = getDMWindow();
if (win) win.close(); if (win) win.close();
} }
/**
* Clears history invoking callback when done.
*/
function waitForClearHistory(aCallback) {
Components.utils.import("resource://gre/modules/PlacesUtils.jsm");
Components.utils.import("resource://gre/modules/Services.jsm");
Services.obs.addObserver(function observeClearHistory(aSubject, aTopic) {
Services.obs.removeObserver(observeClearHistory, aTopic);
aCallback();
}, PlacesUtils.TOPIC_EXPIRATION_FINISHED, false);
PlacesUtils.bhistory.removeAllPages();
}