Bug 1276073 - Ensure source is loaded and selected before running debugger tests. r=jlongster
authorAlexandre Poirot <poirot.alex@gmail.com>
Thu, 02 Jun 2016 01:44:05 -0700
changeset 339063 034b45ace455de8b62f389fc0b940583d9c62ea6
parent 338909 7c0dce574b3f2d5e8f6e4e60caab5532f8e13fd6
child 339064 c37ebb6f4e2ee6e38d3a5d33dbd7aece0ed3465e
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlongster
bugs1276073
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1276073 - Ensure source is loaded and selected before running debugger tests. r=jlongster
devtools/client/debugger/test/mochitest/browser_dbg_aaa_run_first_leaktest.js
devtools/client/debugger/test/mochitest/browser_dbg_auto-pretty-print-01.js
devtools/client/debugger/test/mochitest/browser_dbg_auto-pretty-print-02.js
devtools/client/debugger/test/mochitest/browser_dbg_auto-pretty-print-03.js
devtools/client/debugger/test/mochitest/browser_dbg_bfcache.js
devtools/client/debugger/test/mochitest/browser_dbg_blackboxing-01.js
devtools/client/debugger/test/mochitest/browser_dbg_blackboxing-05.js
devtools/client/debugger/test/mochitest/browser_dbg_blackboxing-06.js
devtools/client/debugger/test/mochitest/browser_dbg_blackboxing-07.js
devtools/client/debugger/test/mochitest/browser_dbg_breadcrumbs-access.js
devtools/client/debugger/test/mochitest/browser_dbg_break-in-anon.js
devtools/client/debugger/test/mochitest/browser_dbg_break-on-next-console.js
devtools/client/debugger/test/mochitest/browser_dbg_break-on-next.js
devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-actual-location.js
devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-button-01.js
devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-button-02.js
devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-contextmenu-add.js
devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-contextmenu.js
devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-disabled-reload.js
devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-editor.js
devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-eval.js
devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-highlight.js
devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-other-tabs.js
devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-pane.js
devtools/client/debugger/test/mochitest/browser_dbg_bug-896139.js
devtools/client/debugger/test/mochitest/browser_dbg_controller-evaluate-01.js
devtools/client/debugger/test/mochitest/browser_dbg_controller-evaluate-02.js
devtools/client/debugger/test/mochitest/browser_dbg_editor-contextmenu.js
devtools/client/debugger/test/mochitest/browser_dbg_editor-mode.js
devtools/client/debugger/test/mochitest/browser_dbg_hide-toolbar-buttons.js
devtools/client/debugger/test/mochitest/browser_dbg_iframes.js
devtools/client/debugger/test/mochitest/browser_dbg_interrupts.js
devtools/client/debugger/test/mochitest/browser_dbg_jump-to-function-definition.js
devtools/client/debugger/test/mochitest/browser_dbg_pretty-print-01.js
devtools/client/debugger/test/mochitest/browser_dbg_pretty-print-02.js
devtools/client/debugger/test/mochitest/browser_dbg_pretty-print-03.js
devtools/client/debugger/test/mochitest/browser_dbg_pretty-print-04.js
devtools/client/debugger/test/mochitest/browser_dbg_pretty-print-07.js
devtools/client/debugger/test/mochitest/browser_dbg_pretty-print-08.js
devtools/client/debugger/test/mochitest/browser_dbg_pretty-print-09.js
devtools/client/debugger/test/mochitest/browser_dbg_pretty-print-10.js
devtools/client/debugger/test/mochitest/browser_dbg_pretty-print-11.js
devtools/client/debugger/test/mochitest/browser_dbg_pretty-print-13.js
devtools/client/debugger/test/mochitest/browser_dbg_pretty-print-on-paused.js
devtools/client/debugger/test/mochitest/browser_dbg_reload-preferred-script-02.js
devtools/client/debugger/test/mochitest/browser_dbg_scripts-switching-01.js
devtools/client/debugger/test/mochitest/browser_dbg_scripts-switching-02.js
devtools/client/debugger/test/mochitest/browser_dbg_scripts-switching-03.js
devtools/client/debugger/test/mochitest/browser_dbg_search-autofill-identifier.js
devtools/client/debugger/test/mochitest/browser_dbg_search-basic-02.js
devtools/client/debugger/test/mochitest/browser_dbg_search-basic-03.js
devtools/client/debugger/test/mochitest/browser_dbg_search-basic-04.js
devtools/client/debugger/test/mochitest/browser_dbg_search-global-01.js
devtools/client/debugger/test/mochitest/browser_dbg_search-global-02.js
devtools/client/debugger/test/mochitest/browser_dbg_search-global-03.js
devtools/client/debugger/test/mochitest/browser_dbg_search-global-04.js
devtools/client/debugger/test/mochitest/browser_dbg_search-global-05.js
devtools/client/debugger/test/mochitest/browser_dbg_search-global-06.js
devtools/client/debugger/test/mochitest/browser_dbg_search-popup-jank.js
devtools/client/debugger/test/mochitest/browser_dbg_search-sources-01.js
devtools/client/debugger/test/mochitest/browser_dbg_search-sources-02.js
devtools/client/debugger/test/mochitest/browser_dbg_search-sources-03.js
devtools/client/debugger/test/mochitest/browser_dbg_search-symbols.js
devtools/client/debugger/test/mochitest/browser_dbg_searchbox-help-popup-01.js
devtools/client/debugger/test/mochitest/browser_dbg_searchbox-help-popup-02.js
devtools/client/debugger/test/mochitest/browser_dbg_source-maps-02.js
devtools/client/debugger/test/mochitest/browser_dbg_sources-cache.js
devtools/client/debugger/test/mochitest/browser_dbg_sources-eval-01.js
devtools/client/debugger/test/mochitest/browser_dbg_sources-eval-02.js
devtools/client/debugger/test/mochitest/browser_dbg_sources-large.js
devtools/client/debugger/test/mochitest/browser_dbg_sources-webext-contentscript.js
devtools/client/debugger/test/mochitest/browser_dbg_stack-05.js
devtools/client/debugger/test/mochitest/browser_dbg_stack-06.js
devtools/client/debugger/test/mochitest/browser_dbg_stack-07.js
devtools/client/debugger/test/mochitest/head.js
--- a/devtools/client/debugger/test/mochitest/browser_dbg_aaa_run_first_leaktest.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_aaa_run_first_leaktest.js
@@ -12,17 +12,17 @@
 const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
 
 function test() {
   // Wait longer for this very simple test that comes first, to make sure that
   // GC from previous tests does not interfere with the debugger suite.
   requestLongerTimeout(2);
 
   let options = {
-    source: "-01.js",
+    source: EXAMPLE_URL + "code_script-switching-01.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     ok(aTab, "Should have a tab available.");
     ok(aPanel, "Should have a debugger pane available.");
 
     waitForSourceAndCaretAndScopes(aPanel, "-02.js", 1).then(() => {
       resumeDebuggerThenCloseAndFinish(aPanel);
--- a/devtools/client/debugger/test/mochitest/browser_dbg_auto-pretty-print-01.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_auto-pretty-print-01.js
@@ -5,24 +5,24 @@
 
 // Test auto pretty printing.
 
 const TAB_URL = EXAMPLE_URL + "doc_auto-pretty-print-01.html";
 
 var gTab, gPanel, gDebugger;
 var gEditor, gSources, gPrefs, gOptions, gView;
 
-var gFirstSourceLabel = "code_ugly-5.js";
-var gSecondSourceLabel = "code_ugly-6.js";
+var gFirstSource = EXAMPLE_URL + "code_ugly-5.js";
+var gSecondSource = EXAMPLE_URL + "code_ugly-6.js";
 
 var gOriginalPref = Services.prefs.getBoolPref("devtools.debugger.auto-pretty-print");
 
 function test() {
   let options = {
-    source: gFirstSourceLabel,
+    source: gFirstSource,
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     gTab = aTab;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gEditor = gDebugger.DebuggerView.editor;
     gSources = gDebugger.DebuggerView.Sources;
@@ -32,19 +32,19 @@ function test() {
 
     Task.spawn(function* () {
       testSourceIsUgly();
 
       enableAutoPrettyPrint();
       testAutoPrettyPrintOn();
 
       reload(gPanel);
-      yield waitForSourceShown(gPanel, gFirstSourceLabel);
+      yield waitForSourceShown(gPanel, gFirstSource);
       testSourceIsUgly();
-      yield waitForSourceShown(gPanel, gFirstSourceLabel);
+      yield waitForSourceShown(gPanel, gFirstSource);
       testSourceIsPretty();
       disableAutoPrettyPrint();
       testAutoPrettyPrintOff();
 
       let finished = waitForDebuggerEvents(gPanel, gDebugger.EVENTS.SOURCE_SHOWN);
       gSources.selectedIndex = 1;
       yield finished;
 
@@ -59,17 +59,17 @@ function test() {
 
 function testSourceIsUgly() {
   ok(!gEditor.getText().includes("\n  "),
     "The source shouldn't be pretty printed yet.");
 }
 
 function testSecondSourceLabel() {
   let source = gSources.selectedItem.attachment.source;
-  ok(source.url === EXAMPLE_URL + gSecondSourceLabel,
+  ok(source.url === gSecondSource,
     "Second source url is correct.");
 }
 
 function testProgressBarShown() {
   const deck = gDebugger.document.getElementById("editor-deck");
   is(deck.selectedIndex, 2, "The progress bar should be shown");
 }
 
--- a/devtools/client/debugger/test/mochitest/browser_dbg_auto-pretty-print-02.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_auto-pretty-print-02.js
@@ -9,25 +9,25 @@
  * that is already pretty printed.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_auto-pretty-print-02.html";
 
 var gTab, gDebuggee, gPanel, gDebugger;
 var gEditor, gSources, gPrefs, gOptions, gView;
 
-var gFirstSourceLabel = "code_ugly-6.js";
-var gSecondSourceLabel = "code_ugly-7.js";
+var gFirstSource = EXAMPLE_URL + "code_ugly-6.js";
+var gSecondSource = EXAMPLE_URL + "code_ugly-7.js";
 
 var gOriginalPref = Services.prefs.getBoolPref("devtools.debugger.auto-pretty-print");
 Services.prefs.setBoolPref("devtools.debugger.auto-pretty-print", true);
 
 function test() {
   let options = {
-    source: gFirstSourceLabel,
+    source: gFirstSource,
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab, aDebuggee, aPanel]) => {
     const gTab = aTab;
     const gDebuggee = aDebuggee;
     const gPanel = aPanel;
     const gDebugger = gPanel.panelWin;
     const gEditor = gDebugger.DebuggerView.editor;
@@ -38,17 +38,17 @@ function test() {
 
     // Should be on by default.
     testAutoPrettyPrintOn();
 
     Task.spawn(function* () {
 
       testSourceIsUgly();
 
-      yield waitForSourceShown(gPanel, gFirstSourceLabel);
+      yield waitForSourceShown(gPanel, gFirstSource);
       testSourceIsPretty();
       testPrettyPrintButtonOn();
 
       // select second source
       yield selectSecondSource();
       testSecondSourceLabel();
 
       // select first source
@@ -79,23 +79,23 @@ function test() {
 
     function testSourceIsUgly() {
       ok(!gEditor.getText().includes("\n  "),
         "The source shouldn't be pretty printed yet.");
     }
 
     function testFirstSourceLabel() {
       let source = gSources.selectedItem.attachment.source;
-      ok(source.url === EXAMPLE_URL + gFirstSourceLabel,
+      ok(source.url === gFirstSource,
         "First source url is correct.");
     }
 
     function testSecondSourceLabel() {
       let source = gSources.selectedItem.attachment.source;
-      ok(source.url === EXAMPLE_URL + gSecondSourceLabel,
+      ok(source.url === gSecondSource,
         "Second source url is correct.");
     }
 
     function testAutoPrettyPrintOn() {
       is(gPrefs.autoPrettyPrint, true,
         "The auto-pretty-print pref should be on.");
       is(gOptions._autoPrettyPrint.getAttribute("checked"), "true",
         "The Auto pretty print menu item should be checked.");
--- a/devtools/client/debugger/test/mochitest/browser_dbg_auto-pretty-print-03.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_auto-pretty-print-03.js
@@ -6,18 +6,18 @@
 /**
  * If auto pretty-printing it enabled, make sure that if
  * pretty-printing fails that it still properly shows the original
  * source.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_auto-pretty-print-02.html";
 
-var FIRST_SOURCE = "code_ugly-6.js";
-var SECOND_SOURCE = "code_ugly-7.js";
+var FIRST_SOURCE = EXAMPLE_URL + "code_ugly-6.js";
+var SECOND_SOURCE = EXAMPLE_URL + "code_ugly-7.js";
 
 function test() {
   let options = {
     source: FIRST_SOURCE,
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab, aDebuggee, aPanel]) => {
     const gTab = aTab;
@@ -26,17 +26,17 @@ function test() {
 
     const gController = gDebugger.DebuggerController;
     const gEditor = gDebugger.DebuggerView.editor;
     const constants = gDebugger.require("./content/constants");
     const queries = gDebugger.require("./content/queries");
     const actions = bindActionCreators(gPanel);
 
     Task.spawn(function* () {
-      const secondSource = queries.getSourceByURL(gController.getState(), EXAMPLE_URL + SECOND_SOURCE);
+      const secondSource = queries.getSourceByURL(gController.getState(), SECOND_SOURCE);
       actions.selectSource(secondSource);
 
       // It should be showing the loading text
       is(gEditor.getText(), gDebugger.DebuggerView._loadingText,
         "The editor loading text is shown");
 
       gController.dispatch({
         type: constants.TOGGLE_PRETTY_PRINT,
--- a/devtools/client/debugger/test/mochitest/browser_dbg_bfcache.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_bfcache.js
@@ -13,17 +13,17 @@ const TAB_URL_2 = EXAMPLE_URL + "doc_rec
 
 var gTab, gDebuggee, gPanel, gDebugger;
 var gSources;
 
 const test = Task.async(function* () {
   info("Starting browser_dbg_bfcache.js's `test`.");
 
   let options = {
-    source: "-01.js",
+    source: EXAMPLE_URL + "code_script-switching-01.js",
     line: 1
   };
   ([gTab, gDebuggee, gPanel]) = yield initDebugger(TAB_URL_1, options);
   gDebugger = gPanel.panelWin;
   gSources = gDebugger.DebuggerView.Sources;
 
   yield testFirstPage();
   yield testLocationChange();
--- a/devtools/client/debugger/test/mochitest/browser_dbg_blackboxing-01.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_blackboxing-01.js
@@ -8,17 +8,17 @@
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_binary_search.html";
 
 var gTab, gPanel, gDebugger;
 
 function test() {
   let options = {
-    source: ".coffee",
+    source: EXAMPLE_URL + "code_binary_search.coffee",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     gTab = aTab;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
 
     testBlackBoxSource()
--- a/devtools/client/debugger/test/mochitest/browser_dbg_blackboxing-05.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_blackboxing-05.js
@@ -10,17 +10,17 @@
 
 const TAB_URL = EXAMPLE_URL + "doc_binary_search.html";
 
 var gTab, gPanel, gDebugger;
 var gDeck;
 
 function test() {
   let options = {
-    source: ".coffee",
+    source: EXAMPLE_URL + "code_binary_search.coffee",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     gTab = aTab;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gDeck = gDebugger.document.getElementById("editor-deck");
 
--- a/devtools/client/debugger/test/mochitest/browser_dbg_blackboxing-06.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_blackboxing-06.js
@@ -10,17 +10,17 @@
 
 const TAB_URL = EXAMPLE_URL + "doc_blackboxing.html";
 
 var gTab, gPanel, gDebugger;
 var gSources;
 
 function test() {
   let options = {
-    source: "code_blackboxing_blackboxme.js",
+    source: EXAMPLE_URL + "code_blackboxing_blackboxme.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     gTab = aTab;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gSources = gDebugger.DebuggerView.Sources;
 
--- a/devtools/client/debugger/test/mochitest/browser_dbg_blackboxing-07.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_blackboxing-07.js
@@ -9,17 +9,17 @@
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_blackboxing_unblackbox.html";
 
 var gTab, gPanel, gDebugger;
 
 function test() {
   let options = {
-    source: ".min.js"
+    source: EXAMPLE_URL + "code_blackboxing_unblackbox.min.js",
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     gTab = aTab;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
 
     testBlackBoxSource()
       .then(testBlackBoxReload)
--- a/devtools/client/debugger/test/mochitest/browser_dbg_breadcrumbs-access.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_breadcrumbs-access.js
@@ -9,17 +9,17 @@
 
 const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
 
 function test() {
   let gTab, gPanel, gDebugger;
   let gSources, gFrames;
 
   let options = {
-    source: "-01.js",
+    source: EXAMPLE_URL + "code_script-switching-01.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     gTab = aTab;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gSources = gDebugger.DebuggerView.Sources;
     gFrames = gDebugger.DebuggerView.StackFrames;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_break-in-anon.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_break-in-anon.js
@@ -7,17 +7,17 @@
  * Make sure anonymous eval scripts can still break with a `debugger`
  * statement
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_script-eval.html";
 
 function test() {
   const options = {
-    source: "-eval.js",
+    source: EXAMPLE_URL + "code_script-eval.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     const gTab = aTab;
     const gPanel = aPanel;
     const gDebugger = gPanel.panelWin;
     const gSources = gDebugger.DebuggerView.Sources;
 
--- a/devtools/client/debugger/test/mochitest/browser_dbg_break-on-next-console.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_break-on-next-console.js
@@ -10,17 +10,17 @@
 
 const TAB_URL = EXAMPLE_URL + "doc_script-eval.html";
 
 function test() {
   let gTab, gPanel, gDebugger;
   let gSources, gBreakpoints, gTarget, gResumeButton, gResumeKey, gThreadClient;
 
   let options = {
-    source: "-eval.js",
+    source: EXAMPLE_URL + "code_script-eval.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     gTab = aTab;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gSources = gDebugger.DebuggerView.Sources;
     gTarget = gDebugger.gTarget;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_break-on-next.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_break-on-next.js
@@ -10,17 +10,17 @@
 
 const TAB_URL = EXAMPLE_URL + "doc_script-eval.html";
 
 function test() {
   let gTab, gPanel, gDebugger;
   let gSources, gBreakpoints, gTarget, gResumeButton, gResumeKey, gThreadClient;
 
   const options = {
-    source: "-eval.js",
+    source: EXAMPLE_URL + "code_script-eval.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     gTab = aTab;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gSources = gDebugger.DebuggerView.Sources;
     gTarget = gDebugger.gTarget;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-actual-location.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-actual-location.js
@@ -7,17 +7,17 @@
  * Bug 737803: Setting a breakpoint in a line without code should move
  * the icon to the actual location.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
 
 function test() {
   let options = {
-    source: "-01.js",
+    source: EXAMPLE_URL + "code_script-switching-01.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     const gTab = aTab;
     const gPanel = aPanel;
     const gDebugger = gPanel.panelWin;
     const gEditor = gDebugger.DebuggerView.editor;
     const gSources = gDebugger.DebuggerView.Sources;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-button-01.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-button-01.js
@@ -6,17 +6,17 @@
 /**
  * Test if the breakpoints toggle button works as advertised.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
 
 function test() {
   let options = {
-    source: "-01.js",
+    source: EXAMPLE_URL + "code_script-switching-01.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     const gTab = aTab;
     const gPanel = aPanel;
     const gDebugger = gPanel.panelWin;
     const gSources = gDebugger.DebuggerView.Sources;
     const actions = bindActionCreators(gPanel);
--- a/devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-button-02.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-button-02.js
@@ -7,17 +7,17 @@
  * Test if the breakpoints toggle button works as advertised when there are
  * some breakpoints already disabled.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
 
 function test() {
   let options = {
-    source: "-01.js",
+    source: EXAMPLE_URL + "code_script-switching-01.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     const gTab = aTab;
     const gPanel = aPanel;
     const gDebugger = gPanel.panelWin;
     const gSources = gDebugger.DebuggerView.Sources;
     const actions = bindActionCreators(gPanel);
--- a/devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-contextmenu-add.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-contextmenu-add.js
@@ -6,17 +6,17 @@
 /**
  * Test adding breakpoints from the source editor context menu
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
 
 function test() {
   let options = {
-    source: "-01.js",
+    source: EXAMPLE_URL + "code_script-switching-01.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     const gTab = aTab;
     const gPanel = aPanel;
     const gDebugger = gPanel.panelWin;
     const gEditor = gDebugger.DebuggerView.editor;
     const gSources = gDebugger.DebuggerView.Sources;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-contextmenu.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-contextmenu.js
@@ -10,17 +10,17 @@
 const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
 
 function test() {
   // Debug test slaves are a bit slow at this test.
   requestLongerTimeout(2);
 
   Task.spawn(function* () {
     const options = {
-      source: "-01.js",
+      source: EXAMPLE_URL + "code_script-switching-01.js",
       line: 1
     };
     const [gTab,, gPanel ] = yield initDebugger(TAB_URL, options);
     const gDebugger = gPanel.panelWin;
     const gSources = gDebugger.DebuggerView.Sources;
     const queries = gDebugger.require("./content/queries");
     const actions = bindActionCreators(gPanel);
     const getState = gDebugger.DebuggerController.getState;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-disabled-reload.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-disabled-reload.js
@@ -6,17 +6,17 @@
 /**
  * Test that disabled breakpoints survive target navigation.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
 
 function test() {
   let options = {
-    source: "-01.js",
+    source: EXAMPLE_URL + "code_script-switching-01.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     const gPanel = aPanel;
     const gTab = aTab;
     const gDebugger = gPanel.panelWin;
     const gEvents = gDebugger.EVENTS;
     const gEditor = gDebugger.DebuggerView.editor;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-editor.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-editor.js
@@ -7,17 +7,17 @@
  * Bug 723069: Test the debugger breakpoint API and connection to the
  * source editor.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
 
 function test() {
   let options = {
-    source: "-01.js",
+    source: EXAMPLE_URL + "code_script-switching-01.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     const gTab = aTab;
     const gPanel = aPanel;
     const gDebugger = gPanel.panelWin;
     const gEditor = gDebugger.DebuggerView.editor;
     const gSources = gDebugger.DebuggerView.Sources;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-eval.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-eval.js
@@ -6,17 +6,17 @@
 /**
  * Test setting breakpoints on an eval script
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_script-eval.html";
 
 function test() {
   let options = {
-    source: "-eval.js",
+    source: EXAMPLE_URL + "code_script-eval.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     const gTab = aTab;
     const gPanel = aPanel;
     const gDebugger = gPanel.panelWin;
     const gSources = gDebugger.DebuggerView.Sources;
     const actions = bindActionCreators(gPanel);
--- a/devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-highlight.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-highlight.js
@@ -6,17 +6,17 @@
 /**
  * Test if breakpoints are highlighted when they should.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
 
 function test() {
   let options = {
-    source: "-01.js",
+    source: EXAMPLE_URL + "code_script-switching-01.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     const gTab = aTab;
     const gPanel = aPanel;
     const gDebugger = gPanel.panelWin;
     const gEditor = gDebugger.DebuggerView.editor;
     const gSources = gDebugger.DebuggerView.Sources;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-other-tabs.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-other-tabs.js
@@ -7,17 +7,17 @@
  * Make sure that setting a breakpoint in one tab, doesn't cause another tab at
  * the same source to pause at that location.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_breakpoints-other-tabs.html";
 
 var test = Task.async(function* () {
   const options = {
-    source: "code_breakpoints-other-tabs.js",
+    source: EXAMPLE_URL + "code_breakpoints-other-tabs.js",
     line: 1
   };
   const [tab1,, panel1] = yield initDebugger(TAB_URL, options);
   const [tab2,, panel2] = yield initDebugger(TAB_URL, options);
   const queries = panel1.panelWin.require("./content/queries");
   const actions = bindActionCreators(panel1);
   const getState = panel1.panelWin.DebuggerController.getState;
 
--- a/devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-pane.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-pane.js
@@ -7,17 +7,17 @@
  * Bug 723071: Test adding a pane to display the list of breakpoints across
  * all sources in the debuggee.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
 
 function test() {
   let options = {
-    source: "-01.js",
+    source: EXAMPLE_URL + "code_script-switching-01.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     const gTab = aTab;
     const gPanel = aPanel;
     const gDebugger = gPanel.panelWin;
     const gEditor = gDebugger.DebuggerView.editor;
     const gSources = gDebugger.DebuggerView.Sources;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_bug-896139.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_bug-896139.js
@@ -3,56 +3,37 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Bug 896139 - Breakpoints not triggering when reloading script.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_bug-896139.html";
-const SCRIPT_URL = "code_bug-896139.js";
+const SCRIPT_URL = EXAMPLE_URL + "code_bug-896139.js";
 
 function test() {
   Task.spawn(function* () {
     function testBreakpoint() {
       let promise = waitForDebuggerEvents(panel, win.EVENTS.FETCHED_SCOPES);
       callInTab(tab, "f");
       return promise.then(() => doResume(panel));
     }
 
-    let [tab,, panel] = yield initDebugger();
+    let options = {
+      source: SCRIPT_URL,
+      line: 1
+    };
+    let [tab,, panel] = yield initDebugger(TAB_URL, options);
     let win = panel.panelWin;
 
     let Sources = win.DebuggerView.Sources;
 
-    // Load the debugger against a blank document and load the test url only
-    // here and not via initDebugger. That, because this test load SCRIPT_URL
-    // dynamically, on load, and the debugger may be on TAB_URL or SCRIPT_URL
-    // depending on cpu speed. initDebugger expect to assert one precise
-    // source.
-    yield navigateActiveTabTo(panel,
-                              TAB_URL,
-                              win.EVENTS.SOURCE_SHOWN);
-
-    if (Sources.selectedItem.attachment.source.url.indexOf(SCRIPT_URL) === -1) {
-      // If there is only the html file, wait for the js file to be listed.
-      if (Sources.itemCount == 1) {
-        yield waitForDebuggerEvents(panel, win.EVENTS.NEW_SOURCE);
-        // Wait for it to be added to the UI
-        yield waitForTick();
-      }
-      // Select the js file.
-      let onSource = waitForSourceAndCaret(panel, SCRIPT_URL, 1);
-      Sources.selectedValue = getSourceActor(win.DebuggerView.Sources,
-                                             EXAMPLE_URL + SCRIPT_URL);
-      yield onSource;
-    }
-
     yield panel.addBreakpoint({
-      actor: getSourceActor(win.DebuggerView.Sources, EXAMPLE_URL + SCRIPT_URL),
+      actor: getSourceActor(win.DebuggerView.Sources, SCRIPT_URL),
       line: 6
     });
 
     // Race condition: the setBreakpoint request sometimes leaves the
     // debugger in paused state for a bit because we are called before
     // that request finishes (see bug 1156531 for plans to fix)
     if (panel.panelWin.gThreadClient.state !== "attached") {
       yield waitForThreadEvents(panel, "resumed");
--- a/devtools/client/debugger/test/mochitest/browser_dbg_controller-evaluate-01.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_controller-evaluate-01.js
@@ -7,17 +7,17 @@
  * Tests the public evaluation API from the debugger controller.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
 
 function test() {
   Task.spawn(function* () {
     const options = {
-      source: "-01.js",
+      source: EXAMPLE_URL + "code_script-switching-01.js",
       line: 1
     };
     const [tab,, panel] = yield initDebugger(TAB_URL, options);
     const win = panel.panelWin;
     const frames = win.DebuggerController.StackFrames;
     const framesView = win.DebuggerView.StackFrames;
     const sourcesView = win.DebuggerView.Sources;
     const editorView = win.DebuggerView.editor;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_controller-evaluate-02.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_controller-evaluate-02.js
@@ -7,17 +7,17 @@
  * Tests the public evaluation API from the debugger controller.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
 
 function test() {
   Task.spawn(function* () {
     const options = {
-      source: "-01.js",
+      source: EXAMPLE_URL + "code_script-switching-01.js",
       line: 1
     };
     const [tab,, panel] = yield initDebugger(TAB_URL, options);
     const win = panel.panelWin;
     const frames = win.DebuggerController.StackFrames;
     const framesView = win.DebuggerView.StackFrames;
     const sourcesView = win.DebuggerView.Sources;
     const editorView = win.DebuggerView.editor;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_editor-contextmenu.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_editor-contextmenu.js
@@ -9,17 +9,17 @@
 
 const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
 
 function test() {
   let gTab, gPanel, gDebugger;
   let gEditor, gSources, gContextMenu;
 
   let options = {
-    source: "-01.js",
+    source: EXAMPLE_URL + "code_script-switching-01.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     gTab = aTab;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gEditor = gDebugger.DebuggerView.editor;
     gSources = gDebugger.DebuggerView.Sources;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_editor-mode.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_editor-mode.js
@@ -10,17 +10,17 @@
 
 const TAB_URL = EXAMPLE_URL + "doc_editor-mode.html";
 
 var gTab, gPanel, gDebugger;
 var gEditor, gSources;
 
 function test() {
   let options = {
-    source: "code_script-switching-01.js?a=b",
+    source: EXAMPLE_URL + "code_script-switching-01.js?a=b",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     gTab = aTab;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gEditor = gDebugger.DebuggerView.editor;
     gSources = gDebugger.DebuggerView.Sources;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_hide-toolbar-buttons.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_hide-toolbar-buttons.js
@@ -12,17 +12,17 @@ const TAB_URL = EXAMPLE_URL + "doc_auto-
 
 var { RootActor } = require("devtools/server/actors/root");
 
 function test() {
   RootActor.prototype.traits.noBlackBoxing = true;
   RootActor.prototype.traits.noPrettyPrinting = true;
 
   let options = {
-    source: "code_ugly-5.js",
+    source: EXAMPLE_URL + "code_ugly-5.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab, aDebuggee, aPanel]) => {
     let document = aPanel.panelWin.document;
     let ppButton = document.querySelector("#pretty-print");
     let bbButton = document.querySelector("#black-box");
     let sep = document.querySelector("#sources-toolbar .devtools-separator");
 
--- a/devtools/client/debugger/test/mochitest/browser_dbg_iframes.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_iframes.js
@@ -9,17 +9,17 @@
 
 const TAB_URL = EXAMPLE_URL + "doc_iframes.html";
 
 function test() {
   let gTab, gDebuggee, gPanel, gDebugger;
   let gIframe, gEditor, gSources, gFrames;
 
   let options = {
-    source: "inline-debugger-statement.html",
+    source: EXAMPLE_URL + "doc_inline-debugger-statement.html",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab, aDebuggee, aPanel]) => {
     gTab = aTab;
     gDebuggee = aDebuggee;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gIframe = gDebuggee.frames[0];
--- a/devtools/client/debugger/test/mochitest/browser_dbg_interrupts.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_interrupts.js
@@ -9,17 +9,17 @@
 
 const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
 
 function test() {
   let gTab, gPanel, gDebugger;
   let gSources, gBreakpoints, gTarget, gResumeButton, gResumeKey, gThreadClient;
 
   let options = {
-    source: "-01.js",
+    source: EXAMPLE_URL + "code_script-switching-01.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     gTab = aTab;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gSources = gDebugger.DebuggerView.Sources;
     gBreakpoints = gDebugger.DebuggerController.Breakpoints;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_jump-to-function-definition.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_jump-to-function-definition.js
@@ -10,17 +10,17 @@
 const TAB_URL = EXAMPLE_URL + "doc_function-jump.html";
 const SCRIPT_URI = EXAMPLE_URL + "code_function-jump-01.js";
 
 
 function test() {
   let gTab, gPanel, gDebugger, gSources;
 
   let options = {
-    source: "-01.js",
+    source: EXAMPLE_URL + "code_function-jump-01.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     gTab = aTab;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gSources = gDebugger.DebuggerView.Sources;
 
--- a/devtools/client/debugger/test/mochitest/browser_dbg_pretty-print-01.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_pretty-print-01.js
@@ -7,17 +7,17 @@
  * Make sure that clicking the pretty print button prettifies the source.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_pretty-print.html";
 
 function test() {
   // Wait for debugger panel to be fully set and break on debugger statement
   let options = {
-    source: "code_ugly.js",
+    source: EXAMPLE_URL + "code_ugly.js",
     line: 2
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     const gTab = aTab;
     const gPanel = aPanel;
     const gDebugger = gPanel.panelWin;
     const gEditor = gDebugger.DebuggerView.editor;
     const gSources = gDebugger.DebuggerView.Sources;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_pretty-print-02.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_pretty-print-02.js
@@ -8,17 +8,17 @@
  * item prettifies the source.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_pretty-print.html";
 
 function test() {
   // Wait for debugger panel to be fully set and break on debugger statement
   let options = {
-    source: "code_ugly.js",
+    source: EXAMPLE_URL + "code_ugly.js",
     line: 2
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     const gTab = aTab;
     const gPanel = aPanel;
     const gDebugger = gPanel.panelWin;
     const gEditor = gDebugger.DebuggerView.editor;
     const gContextMenu = gDebugger.document.getElementById("sourceEditorContextMenu");
--- a/devtools/client/debugger/test/mochitest/browser_dbg_pretty-print-03.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_pretty-print-03.js
@@ -7,17 +7,17 @@
  * Make sure that we have the correct line selected after pretty printing.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_pretty-print.html";
 
 function test() {
   // Wait for debugger panel to be fully set and break on debugger statement
   let options = {
-    source: "code_ugly.js",
+    source: EXAMPLE_URL + "code_ugly.js",
     line: 2
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     const gTab = aTab;
     const gPanel = aPanel;
     const gDebugger = gPanel.panelWin;
 
     Task.spawn(function* () {
--- a/devtools/client/debugger/test/mochitest/browser_dbg_pretty-print-04.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_pretty-print-04.js
@@ -7,17 +7,17 @@
  * Tests that the function searching works with pretty printed sources.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_pretty-print.html";
 
 function test() {
   // Wait for debugger panel to be fully set and break on debugger statement
   let options = {
-    source: "code_ugly.js",
+    source: EXAMPLE_URL + "code_ugly.js",
     line: 2
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     const gTab = aTab;
     const gPanel = aPanel;
     const gDebugger = gPanel.panelWin;
     const gSearchBox = gDebugger.DebuggerView.Filtering._searchbox;
 
--- a/devtools/client/debugger/test/mochitest/browser_dbg_pretty-print-07.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_pretty-print-07.js
@@ -7,17 +7,17 @@
 // for bug 921252.
 
 var gTab, gPanel, gClient, gThreadClient, gSource;
 
 const TAB_URL = EXAMPLE_URL + "doc_pretty-print-2.html";
 
 function test() {
   let options = {
-    source: "code_ugly-2.js",
+    source: EXAMPLE_URL + "code_ugly-2.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     gTab = aTab;
     gPanel = aPanel;
     gClient = gPanel.panelWin.gClient;
     gThreadClient = gPanel.panelWin.DebuggerController.activeThread;
 
--- a/devtools/client/debugger/test/mochitest/browser_dbg_pretty-print-08.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_pretty-print-08.js
@@ -6,17 +6,17 @@
 // Test stepping through pretty printed sources.
 
 var gTab, gPanel, gClient, gThreadClient, gSource;
 
 const TAB_URL = EXAMPLE_URL + "doc_pretty-print-2.html";
 
 function test() {
   let options = {
-    source: "code_ugly-2.js",
+    source: EXAMPLE_URL + "code_ugly-2.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     gTab = aTab;
     gPanel = aPanel;
     gClient = gPanel.panelWin.gClient;
     gThreadClient = gPanel.panelWin.DebuggerController.activeThread;
 
--- a/devtools/client/debugger/test/mochitest/browser_dbg_pretty-print-09.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_pretty-print-09.js
@@ -10,17 +10,17 @@ var gThreadClient;
 var gSource;
 
 var gTab, gPanel, gClient, gThreadClient, gSource;
 
 const TAB_URL = EXAMPLE_URL + "doc_pretty-print-2.html";
 
 function test() {
   let options = {
-    source: "code_ugly-2.js",
+    source: EXAMPLE_URL + "code_ugly-2.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     gTab = aTab;
     gPanel = aPanel;
     gClient = gPanel.panelWin.gClient;
     gThreadClient = gPanel.panelWin.DebuggerController.activeThread;
 
--- a/devtools/client/debugger/test/mochitest/browser_dbg_pretty-print-10.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_pretty-print-10.js
@@ -8,17 +8,17 @@
  * and that clicking it doesn't do anything.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_pretty-print.html";
 
 function test() {
   // Wait for debugger panel to be fully set and break on debugger statement
   let options = {
-    source: "code_ugly.js",
+    source: EXAMPLE_URL + "code_ugly.js",
     line: 2
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     const gTab = aTab;
     const gPanel = aPanel;
     const gDebugger = gPanel.panelWin;
     const gEditor = gDebugger.DebuggerView.editor;
     const gSources = gDebugger.DebuggerView.Sources;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_pretty-print-11.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_pretty-print-11.js
@@ -10,17 +10,17 @@
 const TAB_URL = EXAMPLE_URL + "doc_pretty-print.html";
 
 var gTab, gPanel, gDebugger;
 var gEditor, gSources;
 
 function test() {
   // Wait for debugger panel to be fully set and break on debugger statement
   let options = {
-    source: "code_ugly.js",
+    source: EXAMPLE_URL + "code_ugly.js",
     line: 2
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     gTab = aTab;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gEditor = gDebugger.DebuggerView.editor;
     gSources = gDebugger.DebuggerView.Sources;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_pretty-print-13.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_pretty-print-13.js
@@ -9,17 +9,17 @@
  * JavaScript.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_pretty-print-3.html";
 
 function test() {
   // Wait for debugger panel to be fully set and break on debugger statement
   let options = {
-    source: "code_ugly-8",
+    source: EXAMPLE_URL + "code_ugly-8",
     line: 2
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     const gTab = aTab;
     const gPanel = aPanel;
     const gDebugger = gPanel.panelWin;
     const gEditor = gDebugger.DebuggerView.editor;
     const gSources = gDebugger.DebuggerView.Sources;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_pretty-print-on-paused.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_pretty-print-on-paused.js
@@ -12,17 +12,17 @@ const TAB_URL = EXAMPLE_URL + "doc_prett
 
 var gTab, gPanel, gDebugger, gThreadClient, gSources;
 
 const SECOND_SOURCE_VALUE = EXAMPLE_URL + "code_ugly-2.js";
 
 function test() {
   // Wait for debugger panel to be fully set and break on debugger statement
   let options = {
-    source: "code_script-switching-02.js",
+    source: EXAMPLE_URL + "code_script-switching-02.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     gTab = aTab;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gThreadClient = gDebugger.gThreadClient;
     gSources = gDebugger.DebuggerView.Sources;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_reload-preferred-script-02.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_reload-preferred-script-02.js
@@ -11,17 +11,17 @@
 const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
 const PREFERRED_URL = EXAMPLE_URL + "code_script-switching-02.js";
 
 var gTab, gPanel, gDebugger;
 var gSources;
 
 function test() {
   let options = {
-    source: "-01.js",
+    source: EXAMPLE_URL + "code_script-switching-01.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     gTab = aTab;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gSources = gDebugger.DebuggerView.Sources;
 
--- a/devtools/client/debugger/test/mochitest/browser_dbg_scripts-switching-01.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_scripts-switching-01.js
@@ -6,17 +6,17 @@
 /**
  * Make sure that switching the displayed source in the UI works as advertised.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
 
 function test() {
   let options = {
-    source: "-01.js",
+    source: EXAMPLE_URL + "code_script-switching-01.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     const gTab = aTab;
     const gPanel = aPanel;
     const gDebugger = gPanel.panelWin;
     const gEditor = gDebugger.DebuggerView.editor;
     const gSources = gDebugger.DebuggerView.Sources;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_scripts-switching-02.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_scripts-switching-02.js
@@ -10,17 +10,17 @@
 const TAB_URL = EXAMPLE_URL + "doc_script-switching-02.html";
 
 var gLabel1 = "code_script-switching-01.js";
 var gLabel2 = "code_script-switching-02.js";
 var gParams = "?foo=bar,baz|lol";
 
 function test() {
   let options = {
-    source: "-01.js",
+    source: EXAMPLE_URL + "code_script-switching-01.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     const gTab = aTab;
     const gPanel = aPanel;
     const gDebugger = gPanel.panelWin;
     const gEditor = gDebugger.DebuggerView.editor;
     const gSources = gDebugger.DebuggerView.Sources;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_scripts-switching-03.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_scripts-switching-03.js
@@ -6,17 +6,17 @@
 /**
  * Make sure that the DebuggerView error loading source text is correct.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
 
 function test() {
   let options = {
-    source: "-01.js",
+    source: EXAMPLE_URL + "code_script-switching-01.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     const gTab = aTab;
     const gPanel = aPanel;
     const gDebugger = gPanel.panelWin;
     const gView = gDebugger.DebuggerView;
     const gEditor = gDebugger.DebuggerView.editor;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_search-autofill-identifier.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_search-autofill-identifier.js
@@ -8,17 +8,17 @@
  * selected or manually passed and searching using certain operators.
  */
 "use strict";
 
 function test() {
   const TAB_URL = EXAMPLE_URL + "doc_function-search.html";
 
   let options = {
-    source: "code_function-search-01.js",
+    source: EXAMPLE_URL + "code_function-search-01.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     let Debugger = aPanel.panelWin;
     let Editor = Debugger.DebuggerView.editor;
     let Filtering = Debugger.DebuggerView.Filtering;
 
     function doSearch(aOperator) {
--- a/devtools/client/debugger/test/mochitest/browser_dbg_search-basic-02.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_search-basic-02.js
@@ -9,17 +9,17 @@
 
 const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
 
 var gTab, gPanel, gDebugger;
 var gSources, gSearchBox;
 
 function test() {
   let options = {
-    source: "-01.js",
+    source: EXAMPLE_URL + "code_script-switching-01.js",
     line: 1,
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     gTab = aTab;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gSources = gDebugger.DebuggerView.Sources;
     gSearchBox = gDebugger.DebuggerView.Filtering._searchbox;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_search-basic-03.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_search-basic-03.js
@@ -8,17 +8,17 @@
 
 const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
 
 var gTab, gPanel, gDebugger;
 var gSources, gSearchBox;
 
 function test() {
   let options = {
-    source: "-01.js",
+    source: EXAMPLE_URL + "code_script-switching-01.js",
     line: 1,
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     gTab = aTab;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gSources = gDebugger.DebuggerView.Sources;
     gSearchBox = gDebugger.DebuggerView.Filtering._searchbox;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_search-basic-04.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_search-basic-04.js
@@ -10,17 +10,17 @@
 
 const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
 
 var gTab, gPanel, gDebugger;
 var gEditor, gSources, gSearchBox;
 
 function test() {
   let options = {
-    source: "-01.js",
+    source: EXAMPLE_URL + "code_script-switching-01.js",
     line: 1,
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     gTab = aTab;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gEditor = gDebugger.DebuggerView.editor;
     gSources = gDebugger.DebuggerView.Sources;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_search-global-01.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_search-global-01.js
@@ -10,17 +10,17 @@
 
 const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
 
 var gTab, gPanel, gDebugger;
 var gEditor, gSources, gSearchView, gSearchBox;
 
 function test() {
   let options = {
-    source: "-01.js",
+    source: EXAMPLE_URL + "code_script-switching-01.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     gTab = aTab;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gEditor = gDebugger.DebuggerView.editor;
     gSources = gDebugger.DebuggerView.Sources;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_search-global-02.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_search-global-02.js
@@ -10,17 +10,17 @@
 
 const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
 
 var gTab, gPanel, gDebugger;
 var gEditor, gSources, gSearchView, gSearchBox;
 
 function test() {
   let options = {
-    source: "-01.js",
+    source: EXAMPLE_URL + "code_script-switching-01.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     gTab = aTab;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gEditor = gDebugger.DebuggerView.editor;
     gSources = gDebugger.DebuggerView.Sources;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_search-global-03.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_search-global-03.js
@@ -10,17 +10,17 @@
 
 const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
 
 var gTab, gPanel, gDebugger;
 var gEditor, gSources, gSearchView, gSearchBox;
 
 function test() {
   let options = {
-    source: "-01.js",
+    source: EXAMPLE_URL + "code_script-switching-01.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     gTab = aTab;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gEditor = gDebugger.DebuggerView.editor;
     gSources = gDebugger.DebuggerView.Sources;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_search-global-04.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_search-global-04.js
@@ -10,17 +10,17 @@
 
 const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
 
 var gTab, gPanel, gDebugger;
 var gEditor, gSources, gSearchView, gSearchBox;
 
 function test() {
   let options = {
-    source: "-01.js",
+    source: EXAMPLE_URL + "code_script-switching-01.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     gTab = aTab;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gEditor = gDebugger.DebuggerView.editor;
     gSources = gDebugger.DebuggerView.Sources;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_search-global-05.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_search-global-05.js
@@ -11,17 +11,17 @@
 
 const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
 
 var gTab, gPanel, gDebugger;
 var gEditor, gSources, gSearchView, gSearchBox;
 
 function test() {
   let options = {
-    source: "-01.js",
+    source: EXAMPLE_URL + "code_script-switching-01.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     gTab = aTab;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gEditor = gDebugger.DebuggerView.editor;
     gSources = gDebugger.DebuggerView.Sources;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_search-global-06.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_search-global-06.js
@@ -10,17 +10,17 @@
 
 const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
 
 var gTab, gPanel, gDebugger;
 var gEditor, gSources, gSearchView, gSearchBox;
 
 function test() {
   let options = {
-    source: "-01.js",
+    source: EXAMPLE_URL + "code_script-switching-01.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     gTab = aTab;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gEditor = gDebugger.DebuggerView.editor;
     gSources = gDebugger.DebuggerView.Sources;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_search-popup-jank.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_search-popup-jank.js
@@ -9,17 +9,17 @@
 
 const TAB_URL = EXAMPLE_URL + "doc_editor-mode.html";
 
 var gTab, gPanel, gDebugger;
 var gSearchBox;
 
 function test() {
   let options = {
-    source: "-01.js",
+    source: EXAMPLE_URL + "code_script-switching-01.js?a=b",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     gTab = aTab;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gSearchBox = gDebugger.DebuggerView.Filtering._searchbox;
 
--- a/devtools/client/debugger/test/mochitest/browser_dbg_search-sources-01.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_search-sources-01.js
@@ -9,17 +9,17 @@
 
 const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
 
 function test() {
   // Debug test slaves are a bit slow at this test.
   requestLongerTimeout(3);
 
   let options = {
-    source: "-01.js",
+    source: EXAMPLE_URL + "code_script-switching-01.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     const gTab = aTab;
     const gPanel = aPanel;
     const gDebugger = gPanel.panelWin;
     const gSources = gDebugger.DebuggerView.Sources;
     const gSearchView = gDebugger.DebuggerView.Filtering.FilteredSources;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_search-sources-02.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_search-sources-02.js
@@ -12,17 +12,17 @@ const TAB_URL = EXAMPLE_URL + "doc_edito
 var gTab, gPanel, gDebugger;
 var gSources, gSourceUtils, gSearchView, gSearchBox;
 
 function test() {
   // Debug test slaves are a bit slow at this test.
   requestLongerTimeout(3);
 
   let options = {
-    source: "-01.js",
+    source: EXAMPLE_URL + "code_script-switching-01.js?a=b",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     gTab = aTab;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gSources = gDebugger.DebuggerView.Sources;
     gSourceUtils = gDebugger.SourceUtils;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_search-sources-03.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_search-sources-03.js
@@ -9,17 +9,17 @@
 
 const TAB_URL = EXAMPLE_URL + "doc_editor-mode.html";
 
 var gTab, gPanel, gDebugger;
 var gSources, gSearchBox;
 
 function test() {
   let options = {
-    source: "-01.js",
+    source: EXAMPLE_URL + "code_script-switching-01.js?a=b",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     gTab = aTab;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gSources = gDebugger.DebuggerView.Sources;
     gSearchBox = gDebugger.DebuggerView.Filtering._searchbox;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_search-symbols.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_search-symbols.js
@@ -9,17 +9,17 @@
 
 const TAB_URL = EXAMPLE_URL + "doc_function-search.html";
 
 var gTab, gPanel, gDebugger;
 var gEditor, gSources, gSearchBox, gFilteredFunctions;
 
 function test() {
   let options = {
-    source: "-01.js",
+    source: EXAMPLE_URL + "code_function-search-01.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     gTab = aTab;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gEditor = gDebugger.DebuggerView.editor;
     gSources = gDebugger.DebuggerView.Sources;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_searchbox-help-popup-01.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_searchbox-help-popup-01.js
@@ -10,17 +10,17 @@
 
 const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
 
 var gTab, gPanel, gDebugger;
 var gSearchBox, gSearchBoxPanel;
 
 function test() {
   let options = {
-    source: "-01.js",
+    source: EXAMPLE_URL + "code_script-switching-01.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     gTab = aTab;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gSearchBox = gDebugger.DebuggerView.Filtering._searchbox;
     gSearchBoxPanel = gDebugger.DebuggerView.Filtering._searchboxHelpPanel;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_searchbox-help-popup-02.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_searchbox-help-popup-02.js
@@ -10,17 +10,17 @@
 
 const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
 
 var gTab, gPanel, gDebugger;
 var gEditor, gSearchBox, gSearchBoxPanel;
 
 function test() {
   let options = {
-    source: "-01.js",
+    source: EXAMPLE_URL + "code_script-switching-01.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     gTab = aTab;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gEditor = gDebugger.DebuggerView.editor;
     gSearchBox = gDebugger.DebuggerView.Filtering._searchbox;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_source-maps-02.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_source-maps-02.js
@@ -10,17 +10,17 @@
 const TAB_URL = EXAMPLE_URL + "doc_binary_search.html";
 const JS_URL = EXAMPLE_URL + "code_binary_search.js";
 
 var gTab, gPanel, gDebugger, gEditor;
 var gSources, gFrames, gPrefs, gOptions;
 
 function test() {
   let options = {
-    source: ".coffee",
+    source: EXAMPLE_URL + "code_binary_search.coffee",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     gTab = aTab;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gEditor = gDebugger.DebuggerView.editor;
     gSources = gDebugger.DebuggerView.Sources;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_sources-cache.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_sources-cache.js
@@ -7,17 +7,17 @@
  * Tests if the sources cache knows how to cache sources when prompted.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_function-search.html";
 const TOTAL_SOURCES = 4;
 
 function test() {
   let options = {
-    source: "-01.js",
+    source: EXAMPLE_URL + "code_function-search-01.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab, aDebuggee, aPanel]) => {
     const gTab = aTab;
     const gDebuggee = aDebuggee;
     const gPanel = aPanel;
     const gDebugger = gPanel.panelWin;
     const gEditor = gDebugger.DebuggerView.editor;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_sources-eval-01.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_sources-eval-01.js
@@ -9,17 +9,17 @@
 
 const TAB_URL = EXAMPLE_URL + "doc_script-eval.html";
 
 function test() {
   let gTab, gPanel, gDebugger;
   let gSources, gBreakpoints;
 
   let options = {
-    source: "-eval.js",
+    source: EXAMPLE_URL + "code_script-eval.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     gTab = aTab;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gSources = gDebugger.DebuggerView.Sources;
     gBreakpoints = gDebugger.DebuggerController.Breakpoints;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_sources-eval-02.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_sources-eval-02.js
@@ -10,17 +10,17 @@
 
 const TAB_URL = EXAMPLE_URL + "doc_script-eval.html";
 
 function test() {
   let gTab, gPanel, gDebugger;
   let gSources, gBreakpoints, gEditor;
 
   let options = {
-    source: "-eval.js",
+    source: EXAMPLE_URL + "code_script-eval.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     gTab = aTab;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gSources = gDebugger.DebuggerView.Sources;
     gBreakpoints = gDebugger.DebuggerController.Breakpoints;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_sources-large.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_sources-large.js
@@ -8,17 +8,17 @@
  *   1) No parsing to determine current symbol is attempted when
  *      starting a search
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_function-search.html";
 
 function test() {
   let options = {
-    source: "-01.js",
+    source: EXAMPLE_URL + "code_function-search-01.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab, aDebuggee, aPanel]) => {
     const gTab = aTab;
     const gDebuggee = aDebuggee;
     const gPanel = aPanel;
     const gDebugger = gPanel.panelWin;
 
--- a/devtools/client/debugger/test/mochitest/browser_dbg_sources-webext-contentscript.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_sources-webext-contentscript.js
@@ -4,16 +4,18 @@
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Make sure eval scripts appear in the source list
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_script_webext_contentscript.html";
 
+let {getExtensionUUID} = Cu.import("resource://gre/modules/Extension.jsm", {});
+
 function test() {
   let gPanel, gDebugger;
   let gSources, gAddon;
 
   let cleanup = function* (e) {
     if (gAddon) {
       // Remove the addon, if any.
       yield removeAddon(gAddon);
@@ -24,19 +26,20 @@ function test() {
     } else {
       // If no debugger panel was opened, call finish directly.
       finish();
     }
   };
 
   return Task.spawn(function* () {
     gAddon = yield addAddon(EXAMPLE_URL + "/addon-webext-contentscript.xpi");
+    let uuid = getExtensionUUID(gAddon.id);
 
     let options = {
-      source: "webext-content-script.js",
+      source: `moz-extension://${uuid}/webext-content-script.js`,
       line: 1
     };
     [,, gPanel] = yield initDebugger(TAB_URL, options);
     gDebugger = gPanel.panelWin;
     gSources = gDebugger.DebuggerView.Sources;
 
     is(gSources.values.length, 1, "Should have 1 source");
 
--- a/devtools/client/debugger/test/mochitest/browser_dbg_stack-05.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_stack-05.js
@@ -7,17 +7,17 @@
  * Test that switching between stack frames properly sets the current debugger
  * location in the source editor.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
 
 function test() {
   let options = {
-    source: "-01.js",
+    source: EXAMPLE_URL + "code_script-switching-01.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     const gTab = aTab;
     const gPanel = aPanel;
     const gDebugger = gPanel.panelWin;
     const gEditor = gDebugger.DebuggerView.editor;
     const gSources = gDebugger.DebuggerView.Sources;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_stack-06.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_stack-06.js
@@ -10,17 +10,17 @@
 
 const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
 
 var gTab, gPanel, gDebugger;
 var gEditor, gSources, gFrames, gClassicFrames;
 
 function test() {
   let options = {
-    source: "-01.js",
+    source: EXAMPLE_URL + "code_script-switching-01.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     gTab = aTab;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gEditor = gDebugger.DebuggerView.editor;
     gSources = gDebugger.DebuggerView.Sources;
--- a/devtools/client/debugger/test/mochitest/browser_dbg_stack-07.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_stack-07.js
@@ -11,17 +11,17 @@
 
 const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
 
 var gTab, gPanel, gDebugger;
 var gEditor, gSources, gFrames, gClassicFrames, gToolbar;
 
 function test() {
   let options = {
-    source: "-01.js",
+    source: EXAMPLE_URL + "code_script-switching-01.js",
     line: 1
   };
   initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
     gTab = aTab;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gEditor = gDebugger.DebuggerView.editor;
     gSources = gDebugger.DebuggerView.Sources;
--- a/devtools/client/debugger/test/mochitest/head.js
+++ b/devtools/client/debugger/test/mochitest/head.js
@@ -233,16 +233,34 @@ function waitForTick() {
 }
 
 function waitForTime(aDelay) {
   let deferred = promise.defer();
   setTimeout(deferred.resolve, aDelay);
   return deferred.promise;
 }
 
+function waitForSourceLoaded(aPanel, aUrl) {
+  let { Sources } = aPanel.panelWin.DebuggerView;
+  let isLoaded = Sources.items.some(item =>
+    item.attachment.source.url === aUrl);
+  if (isLoaded) {
+    info("The correct source has been loaded.");
+    return promise.resolve(null);
+  } else {
+    return waitForDebuggerEvents(aPanel, aPanel.panelWin.EVENTS.NEW_SOURCE).then(() => {
+      // Wait for it to be loaded in the UI and appear into Sources.items.
+      return waitForTick();
+    }).then(() => {
+      return waitForSourceLoaded(aPanel, aUrl);
+    });
+  }
+
+}
+
 function waitForSourceShown(aPanel, aUrl) {
   return waitForDebuggerEvents(aPanel, aPanel.panelWin.EVENTS.SOURCE_SHOWN).then(aSource => {
     let sourceUrl = aSource.url || aSource.introductionUrl;
     info("Source shown: " + sourceUrl);
 
     if (!sourceUrl.includes(aUrl)) {
       return waitForSourceShown(aPanel, aUrl);
     } else {
@@ -554,16 +572,17 @@ let initDebugger = Task.async(function*(
   let debuggee = tab.linkedBrowser.contentWindow.wrappedJSObject;
   let target = TargetFactory.forTab(tab);
 
   let toolbox = yield gDevTools.showToolbox(target, "jsdebugger");
   info("Debugger panel shown successfully.");
 
   let debuggerPanel = toolbox.getCurrentPanel();
   let panelWin = debuggerPanel.panelWin;
+  let { Sources } = panelWin.DebuggerView;
 
   prepareDebugger(debuggerPanel);
 
   if (url && url != "about:blank") {
     let onCaretUpdated;
     if (line) {
       onCaretUpdated = waitForCaretUpdated(debuggerPanel, line);
     }
@@ -572,17 +591,25 @@ let initDebugger = Task.async(function*(
       // SOURCE_SHOWN event
       yield reload(debuggerPanel, url);
     } else {
       yield navigateActiveTabTo(debuggerPanel,
                                 url,
                                 panelWin.EVENTS.SOURCE_SHOWN);
     }
     if (source) {
-      ensureSourceIs(debuggerPanel, source);
+      let isSelected = Sources.selectedItem.attachment.source.url === source;
+      if (!isSelected) {
+        // Ensure that the source is loaded first before trying to select it
+        yield waitForSourceLoaded(debuggerPanel, source);
+        // Select the js file.
+        let onSource = waitForSourceAndCaret(debuggerPanel, source, line ? line : 1);
+        Sources.selectedValue = getSourceActor(Sources, source);
+        yield onSource;
+      }
     }
     yield onCaretUpdated;
   }
 
   return [tab, debuggee, debuggerPanel, window];
 });
 
 // Creates an add-on debugger for a given add-on. The returned AddonDebugger