зеркало из https://github.com/mozilla/gecko-dev.git
Bug 615923 - mochitests-2: intermittent "test_fallback.html | Exited with code 1 during test run" (ASSERTION: XPConnect is being called on a scope without a 'Components' property!); (Bv1) offlineTests.js: Fully fix finish(), 1 s/dump(/ok(false,/, Fix some nits.
r=honzab a=(test only).
This commit is contained in:
Родитель
d6c06c1acf
Коммит
f08ce70c39
|
@ -80,8 +80,13 @@ setupChild: function()
|
|||
return true;
|
||||
},
|
||||
|
||||
// Setup the tests. This will reload the current page in a new window
|
||||
// if necessary.
|
||||
/**
|
||||
* Setup the tests. This will reload the current page in a new window
|
||||
* if necessary.
|
||||
*
|
||||
* @return boolean Whether this window is the slave window
|
||||
* to actually run the test in.
|
||||
*/
|
||||
setup: function()
|
||||
{
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
|
@ -100,7 +105,7 @@ setup: function()
|
|||
.getService(Ci.nsIIOService)
|
||||
.newURI(window.location.href, null, null);
|
||||
if (pm.testPermission(uri, "offline-app") != 0) {
|
||||
dump("Previous test failed to clear offline-app permission! Expect failures.\n");
|
||||
ok(false, "Previous test failed to clear offline-app permission! Expect failures.");
|
||||
}
|
||||
pm.add(uri, "offline-app", Ci.nsIPermissionManager.ALLOW_ACTION);
|
||||
|
||||
|
@ -143,7 +148,7 @@ finish: function()
|
|||
{
|
||||
if (this._masterWindow) {
|
||||
// Slave window: pass control back to master window, close itself.
|
||||
SimpleTest.executeSoon(this._masterWindow.OfflineTest.finish);
|
||||
this._masterWindow.SimpleTest.executeSoon(this._masterWindow.OfflineTest.finish);
|
||||
window.close();
|
||||
} else {
|
||||
// Master window: finish test.
|
||||
|
@ -197,7 +202,7 @@ waitForAdd: function(url, onFinished) {
|
|||
var cacheSession = OfflineTest.getActiveSession();
|
||||
var entry;
|
||||
try {
|
||||
var entry = cacheSession.openCacheEntry(url, Ci.nsICache.ACCESS_READ, false);
|
||||
entry = cacheSession.openCacheEntry(url, Ci.nsICache.ACCESS_READ, false);
|
||||
} catch (e) {
|
||||
}
|
||||
|
||||
|
@ -235,7 +240,8 @@ getActiveCache: function()
|
|||
getActiveSession: function()
|
||||
{
|
||||
var cache = this.getActiveCache();
|
||||
if (!cache) return null;
|
||||
if (!cache)
|
||||
return null;
|
||||
|
||||
var cacheService = Cc["@mozilla.org/network/cache-service;1"]
|
||||
.getService(Ci.nsICacheService);
|
||||
|
|
Загрузка…
Ссылка в новой задаче