2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2017-03-15 20:33:52 +03:00
|
|
|
/* eslint no-unused-vars: [2, {"vars": "local", "args": "none"}] */
|
|
|
|
/* import-globals-from helpers.js */
|
|
|
|
/* import-globals-from mockCommands.js */
|
|
|
|
|
|
|
|
"use strict";
|
2012-05-17 22:04:33 +04:00
|
|
|
|
2015-09-21 20:07:31 +03:00
|
|
|
const TEST_BASE_HTTP = "http://example.com/browser/devtools/client/commandline/test/";
|
|
|
|
const TEST_BASE_HTTPS = "https://example.com/browser/devtools/client/commandline/test/";
|
2012-06-01 11:24:19 +04:00
|
|
|
|
2015-10-14 02:18:43 +03:00
|
|
|
var { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
2015-10-15 13:45:22 +03:00
|
|
|
var { console } = require("resource://gre/modules/Console.jsm");
|
2016-08-06 00:41:01 +03:00
|
|
|
var flags = require("devtools/shared/flags");
|
2014-05-22 14:04:47 +04:00
|
|
|
|
2012-08-14 18:51:48 +04:00
|
|
|
// Import the GCLI test helper
|
2015-09-15 21:19:45 +03:00
|
|
|
var testDir = gTestPath.substr(0, gTestPath.lastIndexOf("/"));
|
2012-08-24 19:04:45 +04:00
|
|
|
Services.scriptloader.loadSubScript(testDir + "/helpers.js", this);
|
2012-09-19 22:22:32 +04:00
|
|
|
Services.scriptloader.loadSubScript(testDir + "/mockCommands.js", this);
|
2012-08-14 18:51:48 +04:00
|
|
|
|
2016-08-06 00:41:01 +03:00
|
|
|
flags.testing = true;
|
2014-03-14 01:27:10 +04:00
|
|
|
SimpleTest.registerCleanupFunction(() => {
|
2016-08-06 00:41:01 +03:00
|
|
|
flags.testing = false;
|
2014-03-14 01:27:10 +04:00
|
|
|
});
|
|
|
|
|
2013-12-12 00:36:24 +04:00
|
|
|
function whenDelayedStartupFinished(aWindow, aCallback) {
|
|
|
|
Services.obs.addObserver(function observer(aSubject, aTopic) {
|
|
|
|
if (aWindow == aSubject) {
|
|
|
|
Services.obs.removeObserver(observer, aTopic);
|
|
|
|
executeSoon(aCallback);
|
|
|
|
}
|
2017-04-14 22:51:38 +03:00
|
|
|
}, "browser-delayed-startup-finished");
|
2013-12-12 00:36:24 +04:00
|
|
|
}
|
|
|
|
|
2012-05-17 22:04:33 +04:00
|
|
|
/**
|
2013-03-13 08:51:30 +04:00
|
|
|
* Force GC on shutdown, because it seems that GCLI can outrun the garbage
|
|
|
|
* collector in some situations, which causes test failures in later tests
|
|
|
|
* Bug 774619 is an example.
|
2012-05-17 22:04:33 +04:00
|
|
|
*/
|
|
|
|
registerCleanupFunction(function tearDown() {
|
2013-01-15 23:38:52 +04:00
|
|
|
window.QueryInterface(Ci.nsIInterfaceRequestor)
|
|
|
|
.getInterface(Ci.nsIDOMWindowUtils)
|
|
|
|
.garbageCollect();
|
2012-05-17 22:04:33 +04:00
|
|
|
});
|