Bug 1359653: Part 8 - Ignore script cache when loading scripts in gcd script breakpoint tests. r?jimb draft
authorKris Maglione <maglione.k@gmail.com>
Tue, 02 May 2017 17:31:05 -0700
changeset 572143 b8ad8d8a1930363146f30f1b3d7133f232af1aa4
parent 572142 75ed7960fab0b95588501a44f6e167dcffec3a9c
child 572144 ec39b8d6def61516738bd874b96ca6370bb290d3
push id57000
push usermaglione.k@gmail.com
push dateWed, 03 May 2017 19:40:22 +0000
reviewersjimb
bugs1359653
milestone55.0a1
Bug 1359653: Part 8 - Ignore script cache when loading scripts in gcd script breakpoint tests. r?jimb MozReview-Commit-ID: DGPBK9GAqQT
devtools/server/tests/unit/head_dbg.js
devtools/server/tests/unit/test_setBreakpoint-on-column-in-gcd-script.js
devtools/server/tests/unit/test_setBreakpoint-on-line-in-gcd-script.js
devtools/server/tests/unit/test_setBreakpoint-on-line-with-no-offsets-in-gcd-script.js
--- 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;