Bug 1359653: Part 8 - Ignore script cache when loading scripts in gcd script breakpoint tests. r?jimb
MozReview-Commit-ID: DGPBK9GAqQT
--- a/devtools/server/tests/unit/head_dbg.js
+++ b/devtools/server/tests/unit/head_dbg.js
@@ -42,18 +42,19 @@ const { DebuggerServer: WorkerDebuggerSe
const { DebuggerClient, ObjectClient } = require("devtools/shared/client/main");
const { MemoryFront } = require("devtools/shared/fronts/memory");
const { addDebuggerToGlobal } = Cu.import("resource://gre/modules/jsdebugger.jsm", {});
const systemPrincipal = Cc["@mozilla.org/systemprincipal;1"]
.createInstance(Ci.nsIPrincipal);
-var { loadSubScript } = Cc["@mozilla.org/moz/jssubscript-loader;1"]
- .getService(Ci.mozIJSSubScriptLoader);
+var { loadSubScript, loadSubScriptWithOptions } =
+ Cc["@mozilla.org/moz/jssubscript-loader;1"]
+ .getService(Ci.mozIJSSubScriptLoader);
/**
* Initializes any test that needs to work with add-ons.
*/
function startupAddonsManager() {
// Create a directory for extensions.
const profileDir = do_get_profile().clone();
profileDir.append("extensions");
--- a/devtools/server/tests/unit/test_setBreakpoint-on-column-in-gcd-script.js
+++ b/devtools/server/tests/unit/test_setBreakpoint-on-column-in-gcd-script.js
@@ -2,17 +2,17 @@
var SOURCE_URL = getFileUrl("setBreakpoint-on-column-in-gcd-script.js");
function run_test() {
return Task.spawn(function* () {
do_test_pending();
let global = testGlobal("test");
- loadSubScript(SOURCE_URL, global);
+ loadSubScriptWithOptions(SOURCE_URL, {target: global, ignoreCache: true});
Cu.forceGC(); Cu.forceGC(); Cu.forceGC();
DebuggerServer.registerModule("xpcshell-test/testactors");
DebuggerServer.init(() => true);
DebuggerServer.addTestGlobal(global);
let client = new DebuggerClient(DebuggerServer.connectPipe());
yield connect(client);
@@ -28,17 +28,17 @@ function run_test() {
let location = { line: 6, column: 17 };
let [packet, breakpointClient] = yield setBreakpoint(sourceClient, location);
do_check_true(packet.isPending);
do_check_false("actualLocation" in packet);
packet = yield executeOnNextTickAndWaitForPause(function () {
reload(tabClient).then(function () {
- loadSubScript(SOURCE_URL, global);
+ loadSubScriptWithOptions(SOURCE_URL, {target: global, ignoreCache: true});
});
}, client);
do_check_eq(packet.type, "paused");
let why = packet.why;
do_check_eq(why.type, "breakpoint");
do_check_eq(why.actors.length, 1);
do_check_eq(why.actors[0], breakpointClient.actor);
let frame = packet.frame;
--- a/devtools/server/tests/unit/test_setBreakpoint-on-line-in-gcd-script.js
+++ b/devtools/server/tests/unit/test_setBreakpoint-on-line-in-gcd-script.js
@@ -2,17 +2,17 @@
var SOURCE_URL = getFileUrl("setBreakpoint-on-line-in-gcd-script.js");
function run_test() {
return Task.spawn(function* () {
do_test_pending();
let global = createTestGlobal("test");
- loadSubScript(SOURCE_URL, global);
+ loadSubScriptWithOptions(SOURCE_URL, {target: global, ignoreCache: true});
Cu.forceGC(); Cu.forceGC(); Cu.forceGC();
DebuggerServer.registerModule("xpcshell-test/testactors");
DebuggerServer.init(() => true);
DebuggerServer.addTestGlobal(global);
let client = new DebuggerClient(DebuggerServer.connectPipe());
yield connect(client);
@@ -28,17 +28,17 @@ function run_test() {
let location = { line: 7 };
let [packet, breakpointClient] = yield setBreakpoint(sourceClient, location);
do_check_true(packet.isPending);
do_check_false("actualLocation" in packet);
packet = yield executeOnNextTickAndWaitForPause(function () {
reload(tabClient).then(function () {
- loadSubScript(SOURCE_URL, global);
+ loadSubScriptWithOptions(SOURCE_URL, {target: global, ignoreCache: true});
});
}, client);
do_check_eq(packet.type, "paused");
let why = packet.why;
do_check_eq(why.type, "breakpoint");
do_check_eq(why.actors.length, 1);
do_check_eq(why.actors[0], breakpointClient.actor);
let frame = packet.frame;
--- a/devtools/server/tests/unit/test_setBreakpoint-on-line-with-no-offsets-in-gcd-script.js
+++ b/devtools/server/tests/unit/test_setBreakpoint-on-line-with-no-offsets-in-gcd-script.js
@@ -2,17 +2,17 @@
var SOURCE_URL = getFileUrl("setBreakpoint-on-line-with-no-offsets-in-gcd-script.js");
function run_test() {
return Task.spawn(function* () {
do_test_pending();
let global = createTestGlobal("test");
- loadSubScript(SOURCE_URL, global);
+ loadSubScriptWithOptions(SOURCE_URL, {target: global, ignoreCache: true});
Cu.forceGC(); Cu.forceGC(); Cu.forceGC();
DebuggerServer.registerModule("xpcshell-test/testactors");
DebuggerServer.init(() => true);
DebuggerServer.addTestGlobal(global);
let client = new DebuggerClient(DebuggerServer.connectPipe());
yield connect(client);
@@ -29,17 +29,17 @@ function run_test() {
let location = { line: 7 };
let [packet, breakpointClient] = yield setBreakpoint(sourceClient, location);
do_check_true(packet.isPending);
do_check_false("actualLocation" in packet);
packet = yield executeOnNextTickAndWaitForPause(function () {
reload(tabClient).then(function () {
- loadSubScript(SOURCE_URL, global);
+ loadSubScriptWithOptions(SOURCE_URL, {target: global, ignoreCache: true});
});
}, client);
do_check_eq(packet.type, "paused");
let why = packet.why;
do_check_eq(why.type, "breakpoint");
do_check_eq(why.actors.length, 1);
do_check_eq(why.actors[0], breakpointClient.actor);
let frame = packet.frame;