From e7414531e2078fffd2c62b6f080aebc589625b02 Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Wed, 5 Jun 2013 12:13:31 -0400 Subject: [PATCH] Bug 879246 - Fix intermittent failure in test_sourcemaps-02.js. r=past --- .../server/tests/unit/test_sourcemaps-02.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/toolkit/devtools/server/tests/unit/test_sourcemaps-02.js b/toolkit/devtools/server/tests/unit/test_sourcemaps-02.js index c2df4b632e16..bc60f56fdafe 100644 --- a/toolkit/devtools/server/tests/unit/test_sourcemaps-02.js +++ b/toolkit/devtools/server/tests/unit/test_sourcemaps-02.js @@ -35,23 +35,18 @@ function test_simple_source_map() 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); }); @@ -61,6 +56,7 @@ function test_simple_source_map() 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/"