Bug 879246 - Fix intermittent failure in test_sourcemaps-02.js. r=past
authorNick Fitzgerald <fitzgen@gmail.com>
Wed, 05 Jun 2013 12:13:31 -0400
changeset 134139 0f23a2e50620f0932469697df5f8fbe1596b34fa
parent 134068 8f9ba85eb61c673f18dfca106240c9e72c751ccc
child 134140 ec4504144bcfd34a4c4458bda80e92464db4ada7
push id29067
push userryanvm@gmail.com
push dateWed, 05 Jun 2013 20:37:20 +0000
treeherdermozilla-inbound@72fbfb2f8e51 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspast
bugs879246
milestone24.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 879246 - Fix intermittent failure in test_sourcemaps-02.js. r=past
toolkit/devtools/server/tests/unit/test_sourcemaps-02.js
--- a/toolkit/devtools/server/tests/unit/test_sourcemaps-02.js
+++ b/toolkit/devtools/server/tests/unit/test_sourcemaps-02.js
@@ -30,42 +30,38 @@ function test_simple_source_map()
   // Because we are source mapping, we should be notified of a.js, b.js, and
   // c.js as sources, and shouldn"t receive abc.js or test_sourcemaps-01.js.
   let expectedSources = new Set(["http://example.com/www/js/a.js",
                                  "http://example.com/www/js/b.js",
                                  "http://example.com/www/js/c.js"]);
 
   let numNewSources = 0;
 
-  gClient.addListener("newSource", function _onNewSource(aEvent, aPacket) {
-    if (++numNewSources !== 3) {
-      return;
-    }
-    gClient.removeListener("newSource", _onNewSource);
-
+  gClient.addOneTimeListener("paused", function (aEvent, aPacket) {
     gThreadClient.getSources(function (aResponse) {
       do_check_true(!aResponse.error, "Should not get an error");
 
       for (let s of aResponse.sources) {
-        do_check_true(expectedSources.has(s.url),
-                      "The source's url should be one of our original sources");
+        do_check_neq(s.url, "http://example.com/www/js/abc.js",
+                     "Shouldn't get the generated source's url.")
         expectedSources.delete(s.url);
       }
 
       do_check_eq(expectedSources.size, 0,
-                  "Shouldn't be expecting any more sources");
+                  "Should have found all the expected sources sources by now.");
 
       finishClient(gClient);
     });
   });
 
   let { code, map } = (new SourceNode(null, null, null, [
     new SourceNode(1, 0, "a.js", "function a() { return 'a'; }\n"),
     new SourceNode(1, 0, "b.js", "function b() { return 'b'; }\n"),
     new SourceNode(1, 0, "c.js", "function c() { return 'c'; }\n"),
+    "debugger;\n"
   ])).toStringWithSourceMap({
     file: "abc.js",
     sourceRoot: "http://example.com/www/js/"
   });
 
   code += "//@ sourceMappingURL=data:text/json;base64," + btoa(map.toString());
 
   Components.utils.evalInSandbox(code, gDebuggee, "1.8",