michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: const TEST_BASE_HTTP = "http://example.com/browser/browser/devtools/commandline/test/"; michael@0: const TEST_BASE_HTTPS = "https://example.com/browser/browser/devtools/commandline/test/"; michael@0: michael@0: // Import the GCLI test helper michael@0: let testDir = gTestPath.substr(0, gTestPath.lastIndexOf("/")); michael@0: Services.scriptloader.loadSubScript(testDir + "/helpers.js", this); michael@0: Services.scriptloader.loadSubScript(testDir + "/mockCommands.js", this); michael@0: michael@0: gDevTools.testing = true; michael@0: SimpleTest.registerCleanupFunction(() => { michael@0: gDevTools.testing = false; michael@0: }); michael@0: michael@0: function whenDelayedStartupFinished(aWindow, aCallback) { michael@0: Services.obs.addObserver(function observer(aSubject, aTopic) { michael@0: if (aWindow == aSubject) { michael@0: Services.obs.removeObserver(observer, aTopic); michael@0: executeSoon(aCallback); michael@0: } michael@0: }, "browser-delayed-startup-finished", false); michael@0: } michael@0: michael@0: /** michael@0: * Force GC on shutdown, because it seems that GCLI can outrun the garbage michael@0: * collector in some situations, which causes test failures in later tests michael@0: * Bug 774619 is an example. michael@0: */ michael@0: registerCleanupFunction(function tearDown() { michael@0: window.QueryInterface(Ci.nsIInterfaceRequestor) michael@0: .getInterface(Ci.nsIDOMWindowUtils) michael@0: .garbageCollect(); michael@0: });