Bug 1080025 - Fix browser_dbg_bug-896139.js on Linux-asan. CLOSED TREE r=me
authorAlexandre Poirot <poirot.alex@gmail.com>
Thu, 26 May 2016 12:36:54 -0700
changeset 338105 6a6155e3afa6148ef93255e6d9e126c2974f0319
parent 338104 7b2fc29e5d9db05f171dea679a3e5d50f8a9e2d6
child 338106 def937e0dda7f3e9409e3f5bd70a659c4232782f
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)
reviewersme
bugs1080025, 896139
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 1080025 - Fix browser_dbg_bug-896139.js on Linux-asan. CLOSED TREE r=me
devtools/client/debugger/test/mochitest/browser_dbg_bug-896139.js
--- a/devtools/client/debugger/test/mochitest/browser_dbg_bug-896139.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_bug-896139.js
@@ -19,26 +19,37 @@ function test() {
     }
 
     let [tab,, panel] = yield initDebugger();
     let win = panel.panelWin;
 
     let Sources = win.DebuggerView.Sources;
 
     // Load the debugger against a blank document and load the test url only
-    // here. That to allow catching SOURCE_SHOWN event for SCRIPT_URL.
-    // Here the load of TAB_URL is going to dispatch two SOURCE_SHOWN.
-    // One for the HTML page and another for the JS file which is dynamically
-    // inserted on load event.
-    let onSource = waitForSourceAndCaret(panel, SCRIPT_URL, 1);
+    // 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);
-    yield onSource;
 
+    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),
       line: 6
     });
 
     // Race condition: the setBreakpoint request sometimes leaves the
     // debugger in paused state for a bit because we are called before