Bug 1069490 - Part 4: Update tests. r=past
authorEric Rahm <erahm@mozilla.com>
Mon, 22 Sep 2014 11:29:16 -0700
changeset 206583 31ff3ab5c143e064e27d5a815d7e76086965a350
parent 206582 55363f62f7ad2c189b7fd86c5df7140d3c28966e
child 206584 eb5bd78a635f49e34f210f6e58a6e0ece2bf12bc
push id27532
push userkwierso@gmail.com
push dateTue, 23 Sep 2014 01:57:26 +0000
treeherdermozilla-central@790f41c631cc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspast
bugs1069490
milestone35.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 1069490 - Part 4: Update tests. r=past
browser/devtools/webconsole/test/browser_webconsole_bug_585956_console_trace.js
browser/devtools/webconsole/test/browser_webconsole_console_trace_duplicates.js
dom/tests/browser/browser_ConsoleAPITests.js
--- a/browser/devtools/webconsole/test/browser_webconsole_bug_585956_console_trace.js
+++ b/browser/devtools/webconsole/test/browser_webconsole_bug_585956_console_trace.js
@@ -28,19 +28,19 @@ function test() {
     let node = [...result.matched][0];
     ok(node, "found trace log node");
 
     let obj = node._messageObject;
     ok(obj, "console.trace message object");
 
     // The expected stack trace object.
     let stacktrace = [
-      { filename: TEST_URI, functionName: "window.foobar585956c", language: 2, lineNumber: 9 },
-      { filename: TEST_URI, functionName: "foobar585956b", language: 2, lineNumber: 14 },
-      { filename: TEST_URI, functionName: "foobar585956a", language: 2, lineNumber: 18 },
-      { filename: TEST_URI, functionName: "", language: 2, lineNumber: 21 }
+      { columnNumber: 2, filename: TEST_URI, functionName: "window.foobar585956c", language: 2, lineNumber: 9 },
+      { columnNumber: 9, filename: TEST_URI, functionName: "foobar585956b", language: 2, lineNumber: 14 },
+      { columnNumber: 9, filename: TEST_URI, functionName: "foobar585956a", language: 2, lineNumber: 18 },
+      { columnNumber: 0, filename: TEST_URI, functionName: "", language: 2, lineNumber: 21 }
     ];
 
     ok(obj._stacktrace, "found stacktrace object");
     is(obj._stacktrace.toSource(), stacktrace.toSource(), "stacktrace is correct");
     isnot(node.textContent.indexOf("bug-585956"), -1, "found file name");
   }
 }
--- a/browser/devtools/webconsole/test/browser_webconsole_console_trace_duplicates.js
+++ b/browser/devtools/webconsole/test/browser_webconsole_console_trace_duplicates.js
@@ -8,22 +8,32 @@ function test() {
   Task.spawn(runner).then(finishTest);
 
   function* runner() {
     const {tab} = yield loadTab("data:text/html;charset=utf8,<p>hello");
     const hud = yield openConsole(tab);
 
     content.location = TEST_URI;
 
+    // NB: Now that stack frames include a column number multiple invocations
+    //     on the same line are considered unique. ie:
+    //       |foo(); foo();|
+    //     will generate two distinct trace entries.
     yield waitForMessages({
       webconsole: hud,
       messages: [{
         name: "console.trace output for foo1()",
         text: "foo1()",
-        repeats: 2,
+        consoleTrace: {
+          file: "test-bug_939783_console_trace_duplicates.html",
+          fn: "foo3()",
+        },
+      }, {
+        name: "console.trace output for foo1()",
+        text: "foo1()",
         consoleTrace: {
           file: "test-bug_939783_console_trace_duplicates.html",
           fn: "foo3()",
         },
       }, {
         name: "console.trace output for foo1b()",
         text: "foo1b()",
         consoleTrace: {
--- a/dom/tests/browser/browser_ConsoleAPITests.js
+++ b/dom/tests/browser/browser_ConsoleAPITests.js
@@ -169,20 +169,20 @@ function testConsoleGroup(aMessageObject
   if (aMessageObject.level == "groupEnd") {
     startTimeTest();
   }
 }
 
 function startTraceTest() {
   gLevel = "trace";
   gArgs = [
-    {filename: TEST_URI, functionName: "window.foobar585956c", language: 2, lineNumber: 6},
-    {filename: TEST_URI, functionName: "foobar585956b", language: 2, lineNumber: 11},
-    {filename: TEST_URI, functionName: "foobar585956a", language: 2, lineNumber: 15},
-    {filename: TEST_URI, functionName: "onclick", language: 2, lineNumber: 1}
+    {columnNumber: 8, filename: TEST_URI, functionName: "window.foobar585956c", language: 2, lineNumber: 6},
+    {columnNumber: 15, filename: TEST_URI, functionName: "foobar585956b", language: 2, lineNumber: 11},
+    {columnNumber: 15, filename: TEST_URI, functionName: "foobar585956a", language: 2, lineNumber: 15},
+    {columnNumber: 0, filename: TEST_URI, functionName: "onclick", language: 2, lineNumber: 1}
   ];
 
   let button = gWindow.document.getElementById("test-trace");
   ok(button, "found #test-trace button");
   EventUtils.synthesizeMouseAtCenter(button, {}, gWindow);
 }
 
 function startLocationTest() {