Bug 1561435 - Fix test failures for toolkit/, r=standard8
authorVictor Porof <vporof@mozilla.com>
Thu, 27 Jun 2019 15:53:42 +0200
changeset 544285 970453d65b194690181134c0271dfe675f813f81
parent 544284 aaadca9b31255590a2df9c0fa01dd2f25ac0f808
child 544286 2106cbe66fff3ea3be766493a665cd96c1475e12
push id2131
push userffxbld-merge
push dateMon, 26 Aug 2019 18:30:20 +0000
treeherdermozilla-release@b19ffb3ca153 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersstandard8
bugs1561435
milestone69.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 1561435 - Fix test failures for toolkit/, r=standard8 # ignore-this-changeset Differential Revision: https://phabricator.services.mozilla.com/D36202
toolkit/components/extensions/test/xpcshell/test_proxy_scripts.js
toolkit/modules/tests/xpcshell/test_Log.js
toolkit/modules/tests/xpcshell/test_Log_stackTrace.js
--- a/toolkit/components/extensions/test/xpcshell/test_proxy_scripts.js
+++ b/toolkit/components/extensions/test/xpcshell/test_proxy_scripts.js
@@ -73,17 +73,17 @@ async function testProxyScript(script, e
     equal(proxyInfo.host, host, `Expected proxy host to be ${host}`);
     equal(proxyInfo.port, port, `Expected proxy port to be ${port}`);
     equal(proxyInfo.type, type, `Expected proxy type to be ${type}`);
   }
   if (expected.errorInfo) {
     ok(error.fileName.includes("proxy.js"), "Error should include file name");
     equal(error.lineNumber, 3, "Error should include line number");
     ok(
-      error.stack.includes("proxy.js:3:7"),
+      error.stack.includes("proxy.js:3:9"),
       "Error should include stack trace"
     );
   }
   extension.sendMessage("unregister-proxy-script");
   await extension.awaitFinish("proxy");
   await extension.unload();
 }
 
--- a/toolkit/modules/tests/xpcshell/test_Log.js
+++ b/toolkit/modules/tests/xpcshell/test_Log.js
@@ -269,17 +269,17 @@ add_task(async function log_message_with
   let vOf = {
     a: 1,
     valueOf: function() {
       throw new Error("oh noes valueOf");
     },
   };
   Assert.equal(
     formatMessage("Broken valueOf ${}", vOf),
-    'Broken valueOf ({a:1, valueOf:(function() {throw new Error("oh noes valueOf");})})'
+    'Broken valueOf ({a:1, valueOf:(function() {\n      throw new Error("oh noes valueOf");\n    })})'
   );
   /* eslint-enable object-shorthand */
 
   // Test edge cases of bad data to formatter:
   // If 'params' is not an object, format it as a basic type.
   Assert.equal(
     formatMessage("non-object no subst", 1),
     "non-object no subst: 1"
--- a/toolkit/modules/tests/xpcshell/test_Log_stackTrace.js
+++ b/toolkit/modules/tests/xpcshell/test_Log_stackTrace.js
@@ -1,18 +1,18 @@
 print("Define some functions in well defined line positions for the test");
 function foo(v) {
   return bar(v + 1);
-} // line 2
+} // line 3
 function bar(v) {
   return baz(v + 1);
-} // line 3
+} // line 6
 function baz(v) {
   throw new Error(v + 1);
-} // line 4
+} // line 9
 
 print("Make sure lazy constructor calling/assignment works");
 const { Log } = ChromeUtils.import("resource://gre/modules/Log.jsm");
 
 function run_test() {
   print(
     "Make sure functions, arguments, files are pretty printed in the trace"
   );
@@ -20,18 +20,18 @@ function run_test() {
   try {
     foo(0);
   } catch (ex) {
     trace = Log.stackTrace(ex);
   }
   print(`Got trace: ${trace}`);
   Assert.notEqual(trace, "");
 
-  let bazPos = trace.indexOf("baz@test_Log_stackTrace.js:4");
-  let barPos = trace.indexOf("bar@test_Log_stackTrace.js:3");
-  let fooPos = trace.indexOf("foo@test_Log_stackTrace.js:2");
+  let bazPos = trace.indexOf("baz@test_Log_stackTrace.js:9");
+  let barPos = trace.indexOf("bar@test_Log_stackTrace.js:6");
+  let fooPos = trace.indexOf("foo@test_Log_stackTrace.js:3");
   print(`String positions: ${bazPos} ${barPos} ${fooPos}`);
 
   print("Make sure the desired messages show up");
   Assert.ok(bazPos >= 0);
   Assert.ok(barPos > bazPos);
   Assert.ok(fooPos > barPos);
 }