DevTools: migrate even more console tests

Bug: 667560
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Change-Id: I64e3a7082a4f4df3fd5312402e71a8c5dd623d7a
Reviewed-on: https://chromium-review.googlesource.com/767575
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Will Chen <chenwilliam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#516163}
diff --git a/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG b/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
index 94e53532..ef8a3cc 100644
--- a/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
+++ b/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
@@ -6432,7 +6432,7 @@
 crbug.com/591099 http/tests/devtools/console/command-line-api.js [ Pass Timeout ]
 crbug.com/591099 http/tests/devtools/console/console-format.html [ Failure ]
 crbug.com/591099 http/tests/devtools/console/console-functions.js [ Failure ]
-crbug.com/591099 http/tests/devtools/console/console-uncaught-promise.html [ Failure Pass ]
+crbug.com/591099 http/tests/devtools/console/console-uncaught-promise.js [ Failure Pass ]
 crbug.com/591099 http/tests/devtools/console/shadow-element.js [ Timeout ]
 crbug.com/591099 http/tests/devtools/editor/text-editor-ctrl-d-1.js [ Crash Timeout ]
 crbug.com/591099 http/tests/devtools/elements/edit/edit-dom-actions-1.js [ Crash ]
diff --git a/third_party/WebKit/LayoutTests/FlagExpectations/enable-features=NetworkService b/third_party/WebKit/LayoutTests/FlagExpectations/enable-features=NetworkService
index b0e900b..a107be0 100644
--- a/third_party/WebKit/LayoutTests/FlagExpectations/enable-features=NetworkService
+++ b/third_party/WebKit/LayoutTests/FlagExpectations/enable-features=NetworkService
@@ -121,7 +121,7 @@
 crbug.com/721408 http/tests/inspector-protocol/network/request-interception-resource-types.js [ Failure ]
 crbug.com/721408 http/tests/inspector-protocol/network/xhr-interception-auth-fail.js [ Failure ]
 crbug.com/721408 http/tests/inspector-protocol/network/xhr-interception.js [ Timeout ]
-crbug.com/721408 http/tests/devtools/console/console-uncaught-promise.html [ Failure ]
+crbug.com/721408 http/tests/devtools/console/console-uncaught-promise.js [ Failure ]
 crbug.com/721408 http/tests/devtools/sdk/network-interception-wildcard-pattern-matching.js [ Failure ]
 crbug.com/721408 http/tests/devtools/sources/debugger-async/async-callstack-xhrs.js [ Failure Timeout ]
 Bug(none) http/tests/loading/307-after-303-after-post.html [ Failure ]
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations
index 15b2e932..6738e32 100644
--- a/third_party/WebKit/LayoutTests/TestExpectations
+++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -2014,8 +2014,8 @@
 crbug.com/751952 http/tests/devtools/console/console-format.html [ Pass Failure ]
 crbug.com/751952 virtual/mojo-loading/http/tests/devtools/console/console-format.html [ Pass Failure ]
 crbug.com/751952 http/tests/devtools/unit/datagrid-editable-longtext.js [ Pass Failure ]
-crbug.com/751952 http/tests/devtools/console/console-uncaught-promise.html [ Pass Failure ]
-crbug.com/751952 virtual/mojo-loading/http/tests/devtools/console/console-uncaught-promise.html [ Pass Failure ]
+crbug.com/751952 http/tests/devtools/console/console-uncaught-promise.js [ Pass Failure ]
+crbug.com/751952 virtual/mojo-loading/http/tests/devtools/console/console-uncaught-promise.js [ Pass Failure ]
 crbug.com/751952 virtual/mojo-loading/http/tests/devtools/unit/datagrid-editable-longtext.js [ Pass Failure ]
 crbug.com/751952 virtual/origin-trials-runtimeflags-disabled/http/tests/origin_trials/webexposed/budget-api-origin-trial-interfaces.html [ Pass Failure ]
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/console/alert-toString-exception-expected.txt b/third_party/WebKit/LayoutTests/http/tests/devtools/console/alert-toString-exception-expected.txt
index 4037ee0..c58926336 100644
--- a/third_party/WebKit/LayoutTests/http/tests/devtools/console/alert-toString-exception-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/devtools/console/alert-toString-exception-expected.txt
@@ -1,9 +1,7 @@
-CONSOLE ERROR: line 6: Uncaught Exception in toString().
-CONSOLE ERROR: line 6: Uncaught Exception in toString().
 Test that browser won't crash if inspector is opened for a page that fails to convert alert() argument to string. The test passes if it doesn't crash. Bug 60541
 
 Page reloaded.
-alert-toString-exception.html:6 Uncaught Exception in toString().
-toString @ alert-toString-exception.html:6
-(anonymous) @ alert-toString-exception.html:6
+alert-toString-exception.html:2 Uncaught Exception in toString().
+toString @ alert-toString-exception.html:2
+(anonymous) @ alert-toString-exception.html:2
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/console/alert-toString-exception.html b/third_party/WebKit/LayoutTests/http/tests/devtools/console/alert-toString-exception.html
deleted file mode 100644
index 32afe4f..0000000
--- a/third_party/WebKit/LayoutTests/http/tests/devtools/console/alert-toString-exception.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<html>
-<head>
-<script src="../../inspector/inspector-test.js"></script>
-<script src="../../inspector/console-test.js"></script>
-<script>
-alert({toString: function() { throw "Exception in toString()."; }});
-</script>
-<script>
-function test() {
-  TestRunner.reloadPage(function() {
-    ConsoleTestRunner.dumpConsoleMessages();
-    TestRunner.completeTest();
-  });
-}
-</script>
-</head>
-<body onload="runTest()">
-<p>
-Test that browser won't crash if inspector is opened for a page that fails to convert
-alert() argument to string. The test passes if it doesn't crash.
-<a href="https://bugs.webkit.org/show_bug.cgi?id=60541">Bug 60541</a>
-</p>
-</body>
-</html>
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/console/alert-toString-exception.js b/third_party/WebKit/LayoutTests/http/tests/devtools/console/alert-toString-exception.js
new file mode 100644
index 0000000..b096a9e7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/devtools/console/alert-toString-exception.js
@@ -0,0 +1,15 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+(async function() {
+  TestRunner.addResult(
+      `Test that browser won't crash if inspector is opened for a page that fails to convert alert() argument to string. The test passes if it doesn't crash. Bug 60541\n`);
+  await TestRunner.loadModule('console_test_runner');
+  await TestRunner.showPanel('console');
+  await TestRunner.navigatePromise('resources/alert-toString-exception.html');
+  await TestRunner.reloadPagePromise();
+
+  ConsoleTestRunner.dumpConsoleMessages();
+  TestRunner.completeTest();
+})();
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-log-eval-syntax-error-expected.txt b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-log-eval-syntax-error-expected.txt
index 2b463915..7cac82b 100644
--- a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-log-eval-syntax-error-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-log-eval-syntax-error-expected.txt
@@ -1,15 +1,13 @@
-CONSOLE ERROR: line 1: Uncaught SyntaxError: Unexpected token }
-CONSOLE ERROR: line 2: Uncaught SyntaxError: Unexpected token }
 Tests that syntax errors in eval are logged into console, contains correct link and doesn't cause browser crash.
 
 VM:1 Uncaught SyntaxError: Unexpected token }
-    at foo (console-log-eval-syntax-error.html:8)
-foo @ console-log-eval-syntax-error.html:8
+    at foo (<anonymous>:13:11)
+foo @ VM:13
 setTimeout (async)
-(anonymous) @ VM:1
+(anonymous) @ console-log-eval-syntax-error.js:21
 boo.js:2 Uncaught SyntaxError: Unexpected token }
-    at boo (console-log-eval-syntax-error.html:12)
-boo @ console-log-eval-syntax-error.html:12
+    at boo (<anonymous>:17:11)
+boo @ VM:17
 setTimeout (async)
-(anonymous) @ VM:1
+(anonymous) @ console-log-eval-syntax-error.js:24
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-log-eval-syntax-error.html b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-log-eval-syntax-error.html
deleted file mode 100644
index 636da5e6..0000000
--- a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-log-eval-syntax-error.html
+++ /dev/null
@@ -1,35 +0,0 @@
-<html>
-<head>
-<script src="../../inspector/inspector-test.js"></script>
-<script src="../../inspector/console-test.js"></script>
-<script>
-function foo()
-{
-    eval("}");
-}
-function boo()
-{
-    eval("\n}\n//# sourceURL=boo.js");
-}
-</script>
-<script>
-function test() {
-  TestRunner.evaluateInPage('setTimeout(foo, 0);', ConsoleTestRunner.waitUntilMessageReceived.bind(this, step2));
-
-  function step2() {
-    TestRunner.evaluateInPage('setTimeout(boo, 0);', ConsoleTestRunner.waitUntilMessageReceived.bind(this, step3));
-  }
-
-  function step3() {
-    ConsoleTestRunner.dumpConsoleMessages();
-    TestRunner.completeTest();
-  }
-}
-</script>
-</head>
-<body onload="runTest()">
-<p>
-Tests that syntax errors in eval are logged into console, contains correct link and doesn't cause browser crash.
-</p>
-</body>
-</html>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-log-eval-syntax-error.js b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-log-eval-syntax-error.js
new file mode 100644
index 0000000..d6770cf
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-log-eval-syntax-error.js
@@ -0,0 +1,31 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+(async function() {
+  TestRunner.addResult(
+      `Tests that syntax errors in eval are logged into console, contains correct link and doesn't cause browser crash.\n`);
+  await TestRunner.loadModule('console_test_runner');
+  await TestRunner.showPanel('console');
+  await TestRunner.evaluateInPagePromise(`
+      function foo()
+      {
+          eval("}");
+      }
+      function boo()
+      {
+          eval("\\n}\\n//# sourceURL=boo.js");
+      }
+    `);
+
+  TestRunner.evaluateInPage('setTimeout(foo, 0);', ConsoleTestRunner.waitUntilMessageReceived.bind(this, step2));
+
+  function step2() {
+    TestRunner.evaluateInPage('setTimeout(boo, 0);', ConsoleTestRunner.waitUntilMessageReceived.bind(this, step3));
+  }
+
+  function step3() {
+    ConsoleTestRunner.dumpConsoleMessages();
+    TestRunner.completeTest();
+  }
+})();
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-log-linkify-stack-in-errors-expected.txt b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-log-linkify-stack-in-errors-expected.txt
index 0c3b1b7..5a2f8c3b 100644
--- a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-log-linkify-stack-in-errors-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-log-linkify-stack-in-errors-expected.txt
@@ -1,126 +1,64 @@
-CONSOLE MESSAGE: line 5: Error: Some test
-    at namedFunction (foob.js:5:17)
-    at foob.js:8:1
-CONSOLE MESSAGE: line 11: Error: line
-break
-    at forStack (console-log-linkify-stack-in-errors.html:11:17)
-    at console-log-linkify-stack-in-errors.html:14:1
-CONSOLE MESSAGE: line 30: TypeError: Cannot read property 'removeChild' of null
-    at domError (console-log-linkify-stack-in-errors.html:28:23)
-    at console-log-linkify-stack-in-errors.html:34:1
-CONSOLE MESSAGE: line 41: Error: some error
-CONSOLE MESSAGE: line 47: Error message without stacks http://www.chromium.org/
-CONSOLE MESSAGE: line 49: Error valid stack #2
-    at http://www.chromium.org/boo.js:40:70
-    at foo(http://www.chromium.org/foo.js:10:50)
-CONSOLE MESSAGE: line 50: Error valid stack #3
-    at http://www.chromium.org/foo.js:40
-CONSOLE MESSAGE: line 51: Error: MyError
-    at throwError (http://www.chromium.org/foo.js:40)
-    at eval (eval at <anonymous> (http://www.chromium.org/foo.js:42:1), <anonymous>:1:1)
-    at http://www.chromium.org/foo.js:239
-CONSOLE MESSAGE: line 20: ReferenceError: valid stack
-    at stack2 (console-log-linkify-stack-in-errors.html:20:21)
-    at stack1 (console-log-linkify-stack-in-errors.html:22:5)
-    at console-log-linkify-stack-in-errors.html:53:1
-CONSOLE MESSAGE: line 20: EvalError: valid stack
-    at stack2 (console-log-linkify-stack-in-errors.html:20:21)
-    at stack1 (console-log-linkify-stack-in-errors.html:22:5)
-    at console-log-linkify-stack-in-errors.html:54:1
-CONSOLE MESSAGE: line 20: SyntaxError: valid stack
-    at stack2 (console-log-linkify-stack-in-errors.html:20:21)
-    at stack1 (console-log-linkify-stack-in-errors.html:22:5)
-    at console-log-linkify-stack-in-errors.html:55:1
-CONSOLE MESSAGE: line 20: RangeError: valid stack
-    at stack2 (console-log-linkify-stack-in-errors.html:20:21)
-    at stack1 (console-log-linkify-stack-in-errors.html:22:5)
-    at console-log-linkify-stack-in-errors.html:56:1
-CONSOLE MESSAGE: line 20: TypeError: valid stack
-    at stack2 (console-log-linkify-stack-in-errors.html:20:21)
-    at stack1 (console-log-linkify-stack-in-errors.html:22:5)
-    at console-log-linkify-stack-in-errors.html:57:1
-CONSOLE MESSAGE: line 20: URIError: valid stack
-    at stack2 (console-log-linkify-stack-in-errors.html:20:21)
-    at stack1 (console-log-linkify-stack-in-errors.html:22:5)
-    at console-log-linkify-stack-in-errors.html:58:1
-CONSOLE MESSAGE: line 60: Error broken stack
-    at function_name(foob.js foob.js:30:1)
- at foob.js:40:70
-CONSOLE MESSAGE: line 61: Error broken stack #2
-    at function_name(foob.js:20:30
-CONSOLE MESSAGE: line 62: Error broken stack #3
-    at function_name(foob:20.js:30   bla
-CONSOLE MESSAGE: line 63: Error broken stack #4
-    at function_name)foob.js:20:30(
-CONSOLE MESSAGE: line 64: Error broken stack #5
-    at function_name foob.js:20:30)
-CONSOLE MESSAGE: line 65: Error broken stack #6
-    at foob.js foob.js:40:70
-CONSOLE MESSAGE: line 9: Error
-    at Failure.letsFailWithStack (http://127.0.0.1:8000/devtools/console/resources/stack-with-sourceMap.js:9:27)
-    at window.failure (http://127.0.0.1:8000/devtools/console/resources/stack-with-sourceMap.js:19:20)
-    at <anonymous>:1:1
 Test that console.log(new Error().stack) would linkify links in stacks for sourceUrls and sourceMaps Bug 424001.
 
 foob.js:5 Error: Some test
     at namedFunction (foob.js:5)
     at foob.js:8 console-message > source-code > console-message-anchor > devtools-link > hidden console-message-badge > hide-badge-title > console-message-text > devtools-link > devtools-link
-console-log-linkify-…ck-in-errors.html:4 Error: line
+console-log-linkify-…ack-in-errors.js:20 Error: line
 break
-    at forStack (console-log-linkify-…ck-in-errors.html:4)
-    at console-log-linkify-…ck-in-errors.html:7 console-message > source-code > console-message-anchor > devtools-link > devtools-link-ellipsis > hidden console-message-badge > hide-badge-title > console-message-text > devtools-link > devtools-link-ellipsis > devtools-link > devtools-link-ellipsis
-console-log-linkify-…k-in-errors.html:23 TypeError: Cannot read property 'removeChild' of null
-    at domError (console-log-linkify-…k-in-errors.html:21)
-    at console-log-linkify-…k-in-errors.html:27 console-message > source-code > console-message-anchor > devtools-link > devtools-link-ellipsis > hidden console-message-badge > hide-badge-title > console-message-text > devtools-link > devtools-link-ellipsis > devtools-link > devtools-link-ellipsis
-console-log-linkify-…k-in-errors.html:34 Error: some error
-    at logError (console-log-linkify-…k-in-errors.html:32)
-    at console-log-linkify-…k-in-errors.html:38 console-message > source-code > console-message-anchor > devtools-link > devtools-link-ellipsis > hidden console-message-badge > hide-badge-title > console-message-text > object-value-error source-code > devtools-link > devtools-link-ellipsis > devtools-link > devtools-link-ellipsis
-console-log-linkify-…k-in-errors.html:40 Error message without stacks http://www.chromium.org/ console-message > source-code > console-message-anchor > devtools-link > devtools-link-ellipsis > hidden console-message-badge > hide-badge-title > console-message-text > devtools-link
-console-log-linkify-…k-in-errors.html:42 Error valid stack #2
+    at forStack (console-log-linkify-…ack-in-errors.js:20)
+    at console-log-linkify-…ack-in-errors.js:23 console-message > source-code > console-message-anchor > devtools-link > devtools-link-ellipsis > hidden console-message-badge > hide-badge-title > console-message-text > devtools-link > devtools-link-ellipsis > devtools-link > devtools-link-ellipsis
+console-log-linkify-…ack-in-errors.js:39 Error: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
+    at domError (console-log-linkify-…ack-in-errors.js:37)
+    at console-log-linkify-…ack-in-errors.js:43 console-message > source-code > console-message-anchor > devtools-link > devtools-link-ellipsis > hidden console-message-badge > hide-badge-title > console-message-text > devtools-link > devtools-link-ellipsis > devtools-link > devtools-link-ellipsis
+console-log-linkify-…ack-in-errors.js:50 Error: some error
+    at logError (console-log-linkify-…ack-in-errors.js:48)
+    at console-log-linkify-…ack-in-errors.js:54 console-message > source-code > console-message-anchor > devtools-link > devtools-link-ellipsis > hidden console-message-badge > hide-badge-title > console-message-text > object-value-error source-code > devtools-link > devtools-link-ellipsis > devtools-link > devtools-link-ellipsis
+console-log-linkify-…ack-in-errors.js:56 Error message without stacks http://www.chromium.org/ console-message > source-code > console-message-anchor > devtools-link > devtools-link-ellipsis > hidden console-message-badge > hide-badge-title > console-message-text > devtools-link
+console-log-linkify-…ack-in-errors.js:58 Error valid stack #2
     at www.chromium.org/boo.js:40
     at foo(www.chromium.org/foo.js:10) console-message > source-code > console-message-anchor > devtools-link > devtools-link-ellipsis > hidden console-message-badge > hide-badge-title > console-message-text > devtools-link > devtools-link
-console-log-linkify-…k-in-errors.html:43 Error valid stack #3
+console-log-linkify-…ack-in-errors.js:59 Error valid stack #3
     at www.chromium.org/foo.js:40 console-message > source-code > console-message-anchor > devtools-link > devtools-link-ellipsis > hidden console-message-badge > hide-badge-title > console-message-text > devtools-link
-console-log-linkify-…k-in-errors.html:44 Error: MyError
+console-log-linkify-…ack-in-errors.js:60 Error: MyError
     at throwError (www.chromium.org/foo.js:40)
     at eval (eval at <anonymous> (www.chromium.org/foo.js:42), <anonymous>:1:1)
     at www.chromium.org/foo.js:239 console-message > source-code > console-message-anchor > devtools-link > devtools-link-ellipsis > hidden console-message-badge > hide-badge-title > console-message-text > devtools-link > devtools-link > devtools-link
-console-log-linkify-…k-in-errors.html:13 ReferenceError: valid stack
-    at stack2 (console-log-linkify-…k-in-errors.html:13)
-    at stack1 (console-log-linkify-…k-in-errors.html:15)
-    at console-log-linkify-…k-in-errors.html:46 console-message > source-code > console-message-anchor > devtools-link > devtools-link-ellipsis > hidden console-message-badge > hide-badge-title > console-message-text > devtools-link > devtools-link-ellipsis > devtools-link > devtools-link-ellipsis > devtools-link > devtools-link-ellipsis
-console-log-linkify-…k-in-errors.html:13 EvalError: valid stack
-    at stack2 (console-log-linkify-…k-in-errors.html:13)
-    at stack1 (console-log-linkify-…k-in-errors.html:15)
-    at console-log-linkify-…k-in-errors.html:47 console-message > source-code > console-message-anchor > devtools-link > devtools-link-ellipsis > hidden console-message-badge > hide-badge-title > console-message-text > devtools-link > devtools-link-ellipsis > devtools-link > devtools-link-ellipsis > devtools-link > devtools-link-ellipsis
-console-log-linkify-…k-in-errors.html:13 SyntaxError: valid stack
-    at stack2 (console-log-linkify-…k-in-errors.html:13)
-    at stack1 (console-log-linkify-…k-in-errors.html:15)
-    at console-log-linkify-…k-in-errors.html:48 console-message > source-code > console-message-anchor > devtools-link > devtools-link-ellipsis > hidden console-message-badge > hide-badge-title > console-message-text > devtools-link > devtools-link-ellipsis > devtools-link > devtools-link-ellipsis > devtools-link > devtools-link-ellipsis
-console-log-linkify-…k-in-errors.html:13 RangeError: valid stack
-    at stack2 (console-log-linkify-…k-in-errors.html:13)
-    at stack1 (console-log-linkify-…k-in-errors.html:15)
-    at console-log-linkify-…k-in-errors.html:49 console-message > source-code > console-message-anchor > devtools-link > devtools-link-ellipsis > hidden console-message-badge > hide-badge-title > console-message-text > devtools-link > devtools-link-ellipsis > devtools-link > devtools-link-ellipsis > devtools-link > devtools-link-ellipsis
-console-log-linkify-…k-in-errors.html:13 TypeError: valid stack
-    at stack2 (console-log-linkify-…k-in-errors.html:13)
-    at stack1 (console-log-linkify-…k-in-errors.html:15)
-    at console-log-linkify-…k-in-errors.html:50 console-message > source-code > console-message-anchor > devtools-link > devtools-link-ellipsis > hidden console-message-badge > hide-badge-title > console-message-text > devtools-link > devtools-link-ellipsis > devtools-link > devtools-link-ellipsis > devtools-link > devtools-link-ellipsis
-console-log-linkify-…k-in-errors.html:13 URIError: valid stack
-    at stack2 (console-log-linkify-…k-in-errors.html:13)
-    at stack1 (console-log-linkify-…k-in-errors.html:15)
-    at console-log-linkify-…k-in-errors.html:51 console-message > source-code > console-message-anchor > devtools-link > devtools-link-ellipsis > hidden console-message-badge > hide-badge-title > console-message-text > devtools-link > devtools-link-ellipsis > devtools-link > devtools-link-ellipsis > devtools-link > devtools-link-ellipsis
-console-log-linkify-…k-in-errors.html:53 Error broken stack
+console-log-linkify-…ack-in-errors.js:29 ReferenceError: valid stack
+    at stack2 (console-log-linkify-…ack-in-errors.js:29)
+    at stack1 (console-log-linkify-…ack-in-errors.js:31)
+    at console-log-linkify-…ack-in-errors.js:62 console-message > source-code > console-message-anchor > devtools-link > devtools-link-ellipsis > hidden console-message-badge > hide-badge-title > console-message-text > devtools-link > devtools-link-ellipsis > devtools-link > devtools-link-ellipsis > devtools-link > devtools-link-ellipsis
+console-log-linkify-…ack-in-errors.js:29 EvalError: valid stack
+    at stack2 (console-log-linkify-…ack-in-errors.js:29)
+    at stack1 (console-log-linkify-…ack-in-errors.js:31)
+    at console-log-linkify-…ack-in-errors.js:63 console-message > source-code > console-message-anchor > devtools-link > devtools-link-ellipsis > hidden console-message-badge > hide-badge-title > console-message-text > devtools-link > devtools-link-ellipsis > devtools-link > devtools-link-ellipsis > devtools-link > devtools-link-ellipsis
+console-log-linkify-…ack-in-errors.js:29 SyntaxError: valid stack
+    at stack2 (console-log-linkify-…ack-in-errors.js:29)
+    at stack1 (console-log-linkify-…ack-in-errors.js:31)
+    at console-log-linkify-…ack-in-errors.js:64 console-message > source-code > console-message-anchor > devtools-link > devtools-link-ellipsis > hidden console-message-badge > hide-badge-title > console-message-text > devtools-link > devtools-link-ellipsis > devtools-link > devtools-link-ellipsis > devtools-link > devtools-link-ellipsis
+console-log-linkify-…ack-in-errors.js:29 RangeError: valid stack
+    at stack2 (console-log-linkify-…ack-in-errors.js:29)
+    at stack1 (console-log-linkify-…ack-in-errors.js:31)
+    at console-log-linkify-…ack-in-errors.js:65 console-message > source-code > console-message-anchor > devtools-link > devtools-link-ellipsis > hidden console-message-badge > hide-badge-title > console-message-text > devtools-link > devtools-link-ellipsis > devtools-link > devtools-link-ellipsis > devtools-link > devtools-link-ellipsis
+console-log-linkify-…ack-in-errors.js:29 TypeError: valid stack
+    at stack2 (console-log-linkify-…ack-in-errors.js:29)
+    at stack1 (console-log-linkify-…ack-in-errors.js:31)
+    at console-log-linkify-…ack-in-errors.js:66 console-message > source-code > console-message-anchor > devtools-link > devtools-link-ellipsis > hidden console-message-badge > hide-badge-title > console-message-text > devtools-link > devtools-link-ellipsis > devtools-link > devtools-link-ellipsis > devtools-link > devtools-link-ellipsis
+console-log-linkify-…ack-in-errors.js:29 URIError: valid stack
+    at stack2 (console-log-linkify-…ack-in-errors.js:29)
+    at stack1 (console-log-linkify-…ack-in-errors.js:31)
+    at console-log-linkify-…ack-in-errors.js:67 console-message > source-code > console-message-anchor > devtools-link > devtools-link-ellipsis > hidden console-message-badge > hide-badge-title > console-message-text > devtools-link > devtools-link-ellipsis > devtools-link > devtools-link-ellipsis > devtools-link > devtools-link-ellipsis
+console-log-linkify-…ack-in-errors.js:69 Error broken stack
     at function_name(foob.js foob.js:30:1)
  at foob.js:40:70 console-message > source-code > console-message-anchor > devtools-link > devtools-link-ellipsis > hidden console-message-badge > hide-badge-title > console-message-text
-console-log-linkify-…k-in-errors.html:54 Error broken stack #2
+console-log-linkify-…ack-in-errors.js:70 Error broken stack #2
     at function_name(foob.js:20:30 console-message > source-code > console-message-anchor > devtools-link > devtools-link-ellipsis > hidden console-message-badge > hide-badge-title > console-message-text
-console-log-linkify-…k-in-errors.html:55 Error broken stack #3
+console-log-linkify-…ack-in-errors.js:71 Error broken stack #3
     at function_name(foob:20.js:30   bla console-message > source-code > console-message-anchor > devtools-link > devtools-link-ellipsis > hidden console-message-badge > hide-badge-title > console-message-text
-console-log-linkify-…k-in-errors.html:56 Error broken stack #4
+console-log-linkify-…ack-in-errors.js:72 Error broken stack #4
     at function_name)foob.js:20:30( console-message > source-code > console-message-anchor > devtools-link > devtools-link-ellipsis > hidden console-message-badge > hide-badge-title > console-message-text
-console-log-linkify-…k-in-errors.html:57 Error broken stack #5
+console-log-linkify-…ack-in-errors.js:73 Error broken stack #5
     at function_name foob.js:20:30) console-message > source-code > console-message-anchor > devtools-link > devtools-link-ellipsis > hidden console-message-badge > hide-badge-title > console-message-text
-console-log-linkify-…k-in-errors.html:58 Error broken stack #6
+console-log-linkify-…ack-in-errors.js:74 Error broken stack #6
     at foob.js foob.js:40:70 console-message > source-code > console-message-anchor > devtools-link > devtools-link-ellipsis > hidden console-message-badge > hide-badge-title > console-message-text
 stack-with-sourceMap.coffee:3 Error
     at Failure.letsFailWithStack (stack-with-sourceMap.coffee:3)
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-log-linkify-stack-in-errors.html b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-log-linkify-stack-in-errors.html
deleted file mode 100644
index 985e10a..0000000
--- a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-log-linkify-stack-in-errors.html
+++ /dev/null
@@ -1,90 +0,0 @@
-<html>
-<head>
-<script src="../../inspector/inspector-test.js"></script>
-<script src="../../inspector/console-test.js"></script>
-
-<script src="resources/stack-with-sourceUrl.js"></script>
-<script src="resources/stack-with-sourceMap.js"></script>
-<script>
-function forStack()
-{
-    console.log(new Error("line\nbreak").stack);
-}
-
-forStack();
-
-function stack1(errorConstructor, text)
-{
-    function stack2()
-    {
-        console.log(new errorConstructor(text).stack);
-    }
-    stack2();
-}
-
-function domError()
-{
-    try {
-        document.body.removeChild(document.createElement("a"));
-    } catch (e) {
-        console.log(e.stack);
-    }
-}
-
-domError();
-
-function logError()
-{
-    try {
-        throw new Error("some error");
-    } catch (e) {
-        console.log(e);
-    }
-}
-
-logError();
-
-console.log("Error message without stacks http://www.chromium.org/");
-
-console.log("Error valid stack #2\n    at http://www.chromium.org/boo.js:40:70\n    at foo(http://www.chromium.org/foo.js:10:50)");
-console.log("Error valid stack #3\n    at http://www.chromium.org/foo.js:40");
-console.log("Error: MyError\n    at throwError (http://www.chromium.org/foo.js:40)\n    at eval (eval at <anonymous> (http://www.chromium.org/foo.js:42:1), <anonymous>:1:1)\n    at http://www.chromium.org/foo.js:239");
-
-stack1(ReferenceError, "valid stack");
-stack1(EvalError, "valid stack");
-stack1(SyntaxError, "valid stack");
-stack1(RangeError, "valid stack");
-stack1(TypeError, "valid stack");
-stack1(URIError, "valid stack");
-
-console.log("Error broken stack\n    at function_name(foob.js foob.js:30:1)\n at foob.js:40:70");
-console.log("Error broken stack #2\n    at function_name(foob.js:20:30");
-console.log("Error broken stack #3\n    at function_name(foob:20.js:30   bla");
-console.log("Error broken stack #4\n    at function_name)foob.js:20:30(");
-console.log("Error broken stack #5\n    at function_name foob.js:20:30)");
-console.log("Error broken stack #6\n    at foob.js foob.js:40:70");
-
-//# sourceURL=console-log-linkify-stack-in-errors.html
-</script>
-
-<script>
-function test() {
-  TestRunner.evaluateInPageWithTimeout('failure()');
-  ConsoleTestRunner.waitUntilMessageReceived(waitForUISourceCode);
-  function waitForUISourceCode() {
-    TestRunner.waitForUISourceCode('stack-with-sourceMap.coffee').then(dumpMessages);
-  }
-
-  function dumpMessages() {
-    ConsoleTestRunner.dumpConsoleMessages(false, true);
-    TestRunner.completeTest();
-  }
-}
-</script>
-</head>
-<body onload="runTest()">
-<p>
-Test that console.log(new Error().stack) would linkify links in stacks for sourceUrls and sourceMaps  <a href="http://crbug.com/424001">Bug 424001.</a>
-</p>
-</body>
-</html>
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-log-linkify-stack-in-errors.js b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-log-linkify-stack-in-errors.js
new file mode 100644
index 0000000..84a1e326
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-log-linkify-stack-in-errors.js
@@ -0,0 +1,89 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+(async function() {
+  TestRunner.addResult(
+      `Test that console.log(new Error().stack) would linkify links in stacks for sourceUrls and sourceMaps Bug 424001.\n`);
+  await TestRunner.loadModule('console_test_runner');
+  await TestRunner.showPanel('console');
+  await TestRunner.loadHTML(`
+      <p>
+      Test that console.log(new Error().stack) would linkify links in stacks for sourceUrls and sourceMaps  <a href="http://crbug.com/424001">Bug 424001.</a>
+      </p>
+    `);
+  await TestRunner.addScriptTag('resources/stack-with-sourceUrl.js');
+  await TestRunner.addScriptTag('resources/stack-with-sourceMap.js');
+  await TestRunner.evaluateInPagePromise(`
+      function forStack()
+      {
+          console.log(new Error("line\\nbreak").stack);
+      }
+
+      forStack();
+
+      function stack1(errorConstructor, text)
+      {
+          function stack2()
+          {
+              console.log(new errorConstructor(text).stack);
+          }
+          stack2();
+      }
+
+      function domError()
+      {
+          try {
+              document.body.removeChild(document.createElement("a"));
+          } catch (e) {
+              console.log(e.stack);
+          }
+      }
+
+      domError();
+
+      function logError()
+      {
+          try {
+              throw new Error("some error");
+          } catch (e) {
+              console.log(e);
+          }
+      }
+
+      logError();
+
+      console.log("Error message without stacks http://www.chromium.org/");
+
+      console.log("Error valid stack #2\\n    at http://www.chromium.org/boo.js:40:70\\n    at foo(http://www.chromium.org/foo.js:10:50)");
+      console.log("Error valid stack #3\\n    at http://www.chromium.org/foo.js:40");
+      console.log("Error: MyError\\n    at throwError (http://www.chromium.org/foo.js:40)\\n    at eval (eval at <anonymous> (http://www.chromium.org/foo.js:42:1), <anonymous>:1:1)\\n    at http://www.chromium.org/foo.js:239");
+
+      stack1(ReferenceError, "valid stack");
+      stack1(EvalError, "valid stack");
+      stack1(SyntaxError, "valid stack");
+      stack1(RangeError, "valid stack");
+      stack1(TypeError, "valid stack");
+      stack1(URIError, "valid stack");
+
+      console.log("Error broken stack\\n    at function_name(foob.js foob.js:30:1)\\n at foob.js:40:70");
+      console.log("Error broken stack #2\\n    at function_name(foob.js:20:30");
+      console.log("Error broken stack #3\\n    at function_name(foob:20.js:30   bla");
+      console.log("Error broken stack #4\\n    at function_name)foob.js:20:30(");
+      console.log("Error broken stack #5\\n    at function_name foob.js:20:30)");
+      console.log("Error broken stack #6\\n    at foob.js foob.js:40:70");
+
+      //# sourceURL=console-log-linkify-stack-in-errors.js
+    `);
+
+  TestRunner.evaluateInPageWithTimeout('failure()');
+  ConsoleTestRunner.waitUntilMessageReceived(waitForUISourceCode);
+  function waitForUISourceCode() {
+    TestRunner.waitForUISourceCode('stack-with-sourceMap.coffee').then(dumpMessages);
+  }
+
+  function dumpMessages() {
+    ConsoleTestRunner.dumpConsoleMessages(false, true);
+    TestRunner.completeTest();
+  }
+})();
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-log-toString-object-expected.txt b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-log-toString-object-expected.txt
index 83422083..e7fa8ba 100644
--- a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-log-toString-object-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-log-toString-object-expected.txt
@@ -1,7 +1,5 @@
-CONSOLE MESSAGE: line 7: [object Object]
-CONSOLE MESSAGE: line 7: [object Object]
 Tests that passing an object which throws on string conversion into console.log won't crash inspected Page. The test passes if it doesn't crash. Bug 57557
 
 Page reloaded.
-console-log-toString-object.html:7 {toString: {…}}
+console-log-toString-object.html:2 {toString: {…}}
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-log-toString-object.html b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-log-toString-object.html
deleted file mode 100644
index dfa8e65..0000000
--- a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-log-toString-object.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<html>
-<head>
-<script src="../../inspector/inspector-test.js"></script>
-<script src="../../inspector/console-test.js"></script>
-<script>
-
-console.log({toString:{}});
-
-function test() {
-  TestRunner.reloadPage(function() {
-    ConsoleTestRunner.dumpConsoleMessages();
-    TestRunner.completeTest();
-  });
-}
-</script>
-</head>
-<body onload="runTest()">
-<p>
-Tests that passing an object which throws on string conversion into console.log won't crash
-inspected Page. The test passes if it doesn't crash.
-<a href="https://bugs.webkit.org/show_bug.cgi?id=57557">Bug 57557</a>
-</p>
-</body>
-</html>
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-log-toString-object.js b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-log-toString-object.js
new file mode 100644
index 0000000..7e178ba
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-log-toString-object.js
@@ -0,0 +1,14 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+(async function() {
+  TestRunner.addResult(
+      `Tests that passing an object which throws on string conversion into console.log won't crash inspected Page. The test passes if it doesn't crash. Bug 57557\n`);
+  await TestRunner.loadModule('console_test_runner');
+  await TestRunner.showPanel('console');
+  await TestRunner.navigatePromise('resources/console-log-toString-object.html');
+  await TestRunner.reloadPagePromise();
+  ConsoleTestRunner.dumpConsoleMessages();
+  TestRunner.completeTest();
+})();
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-uncaught-promise-expected.txt b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-uncaught-promise-expected.txt
index d835048..2660668 100644
--- a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-uncaught-promise-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-uncaught-promise-expected.txt
@@ -1,86 +1,77 @@
-CONSOLE ERROR: line 23: Uncaught (in promise) Error: err1
-CONSOLE ERROR: line 44: Uncaught (in promise) Error: err2
-CONSOLE ERROR: line 62: Uncaught (in promise) NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
-CONSOLE ERROR: line 68: Uncaught (in promise) 42
-CONSOLE ERROR: line 73: Uncaught (in promise) 1e+100
-CONSOLE ERROR: line 78: Uncaught (in promise) foo
-CONSOLE ERROR: line 83: Uncaught (in promise) #<Object>
-CONSOLE ERROR: line 88: Uncaught (in promise) undefined
-CONSOLE ERROR: Uncaught (in promise) TypeError: Failed to register a ServiceWorker: A bad HTTP response code (404) was received when fetching the script.
 Tests that uncaught promise rejections are logged into console.
 
-console-uncaught-promise.html:23 Uncaught (in promise) Error: err1
-promiseTest1 @ console-uncaught-promise.html:23
-timeout @ console-uncaught-promise.html:16
+console-uncaught-promise.js:26 Uncaught (in promise) Error: err1
+promiseTest1 @ console-uncaught-promise.js:26
+timeout @ console-uncaught-promise.js:19
 Promise rejected (async)
-promiseTest1 @ console-uncaught-promise.html:26
-timeout @ console-uncaught-promise.html:16
+promiseTest1 @ console-uncaught-promise.js:29
+timeout @ console-uncaught-promise.js:19
 setTimeout (async)
-runNextPromiseTest @ console-uncaught-promise.html:15
-(anonymous) @ VM:1
-console-uncaught-promise.html:44 Uncaught (in promise) Error: err2
-promiseTest2 @ console-uncaught-promise.html:44
-timeout @ console-uncaught-promise.html:16
+runNextPromiseTest @ console-uncaught-promise.js:18
+(anonymous) @ console-uncaught-promise.js:103
+console-uncaught-promise.js:47 Uncaught (in promise) Error: err2
+promiseTest2 @ console-uncaught-promise.js:47
+timeout @ console-uncaught-promise.js:19
 Promise rejected (async)
-(anonymous) @ console-uncaught-promise.html:40
+(anonymous) @ console-uncaught-promise.js:43
 Promise rejected (async)
-(anonymous) @ console-uncaught-promise.html:39
+(anonymous) @ console-uncaught-promise.js:42
 Promise rejected (async)
-(anonymous) @ console-uncaught-promise.html:38
+(anonymous) @ console-uncaught-promise.js:41
 Promise rejected (async)
-promiseTest2 @ console-uncaught-promise.html:37
-timeout @ console-uncaught-promise.html:16
+promiseTest2 @ console-uncaught-promise.js:40
+timeout @ console-uncaught-promise.js:19
 setTimeout (async)
-runNextPromiseTest @ console-uncaught-promise.html:15
-(anonymous) @ VM:1
-console-uncaught-promise.html:62 Uncaught (in promise) DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
-throwDOMException @ console-uncaught-promise.html:62
-catcher @ console-uncaught-promise.html:54
+runNextPromiseTest @ console-uncaught-promise.js:18
+(anonymous) @ console-uncaught-promise.js:106
+console-uncaught-promise.js:65 Uncaught (in promise) DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
+throwDOMException @ console-uncaught-promise.js:65
+catcher @ console-uncaught-promise.js:57
 Promise rejected (async)
-promiseTest3 @ console-uncaught-promise.html:53
-timeout @ console-uncaught-promise.html:16
+promiseTest3 @ console-uncaught-promise.js:56
+timeout @ console-uncaught-promise.js:19
 setTimeout (async)
-runNextPromiseTest @ console-uncaught-promise.html:15
-(anonymous) @ VM:1
-console-uncaught-promise.html:68 Uncaught (in promise) 42
-promiseTest4 @ console-uncaught-promise.html:68
-timeout @ console-uncaught-promise.html:16
+runNextPromiseTest @ console-uncaught-promise.js:18
+(anonymous) @ console-uncaught-promise.js:106
+console-uncaught-promise.js:71 Uncaught (in promise) 42
+promiseTest4 @ console-uncaught-promise.js:71
+timeout @ console-uncaught-promise.js:19
 setTimeout (async)
-runNextPromiseTest @ console-uncaught-promise.html:15
-(anonymous) @ VM:1
-console-uncaught-promise.html:73 Uncaught (in promise) 1e+100
-promiseTest5 @ console-uncaught-promise.html:73
-timeout @ console-uncaught-promise.html:16
+runNextPromiseTest @ console-uncaught-promise.js:18
+(anonymous) @ console-uncaught-promise.js:106
+console-uncaught-promise.js:76 Uncaught (in promise) 1e+100
+promiseTest5 @ console-uncaught-promise.js:76
+timeout @ console-uncaught-promise.js:19
 setTimeout (async)
-runNextPromiseTest @ console-uncaught-promise.html:15
-(anonymous) @ VM:1
-console-uncaught-promise.html:78 Uncaught (in promise) foo
-promiseTest6 @ console-uncaught-promise.html:78
-timeout @ console-uncaught-promise.html:16
+runNextPromiseTest @ console-uncaught-promise.js:18
+(anonymous) @ console-uncaught-promise.js:106
+console-uncaught-promise.js:81 Uncaught (in promise) foo
+promiseTest6 @ console-uncaught-promise.js:81
+timeout @ console-uncaught-promise.js:19
 setTimeout (async)
-runNextPromiseTest @ console-uncaught-promise.html:15
-(anonymous) @ VM:1
-console-uncaught-promise.html:83 Uncaught (in promise) {foo: 42}
+runNextPromiseTest @ console-uncaught-promise.js:18
+(anonymous) @ console-uncaught-promise.js:106
+console-uncaught-promise.js:86 Uncaught (in promise) {foo: 42}
     foo: 42
     __proto__: Object
-promiseTest7 @ console-uncaught-promise.html:83
-timeout @ console-uncaught-promise.html:16
+promiseTest7 @ console-uncaught-promise.js:86
+timeout @ console-uncaught-promise.js:19
 setTimeout (async)
-runNextPromiseTest @ console-uncaught-promise.html:15
-(anonymous) @ VM:1
-console-uncaught-promise.html:88 Uncaught (in promise) undefined
-promiseTest8 @ console-uncaught-promise.html:88
-timeout @ console-uncaught-promise.html:16
+runNextPromiseTest @ console-uncaught-promise.js:18
+(anonymous) @ console-uncaught-promise.js:106
+console-uncaught-promise.js:91 Uncaught (in promise) undefined
+promiseTest8 @ console-uncaught-promise.js:91
+timeout @ console-uncaught-promise.js:19
 setTimeout (async)
-runNextPromiseTest @ console-uncaught-promise.html:15
-(anonymous) @ VM:1
+runNextPromiseTest @ console-uncaught-promise.js:18
+(anonymous) @ console-uncaught-promise.js:106
 A bad HTTP response code (404) was received when fetching the script.
-404 Failed to load resource: net::ERR_INVALID_RESPONSE
-console-uncaught-promise.html:1 Uncaught (in promise) TypeError: Failed to register a ServiceWorker: A bad HTTP response code (404) was received when fetching the script.
+:8000/devtools/console/404 Failed to load resource: net::ERR_INVALID_RESPONSE
+inspected-page.html:1 Uncaught (in promise) TypeError: Failed to register a ServiceWorker: A bad HTTP response code (404) was received when fetching the script.
 Promise (async)
-promiseTest9 @ console-uncaught-promise.html:93
-timeout @ console-uncaught-promise.html:16
+promiseTest9 @ console-uncaught-promise.js:96
+timeout @ console-uncaught-promise.js:19
 setTimeout (async)
-runNextPromiseTest @ console-uncaught-promise.html:15
-(anonymous) @ VM:1
+runNextPromiseTest @ console-uncaught-promise.js:18
+(anonymous) @ console-uncaught-promise.js:106
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-uncaught-promise.html b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-uncaught-promise.html
deleted file mode 100644
index 7bed4f76..0000000
--- a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-uncaught-promise.html
+++ /dev/null
@@ -1,126 +0,0 @@
-<html>
-<head>
-<script src="../../inspector/inspector-test.js"></script>
-<script src="../../inspector/console-test.js"></script>
-<script>
-
-var tested = 0;
-function runNextPromiseTest()
-{
-    ++tested;
-    var name = "promiseTest" + tested;
-    if (typeof window[name] !== "function")
-        return false;
-    // setTimeout to cut off VM call frames from the stack trace.
-    setTimeout(function timeout() {
-        window[name].call(window);
-    }, 0);
-    return true;
-}
-
-function promiseTest1()
-{
-    Promise.reject(new Error("err1"))
-        .then()
-        .then()
-        .then(); // Last is unhandled.
-}
-
-function promiseTest2()
-{
-    var reject;
-    var m0 = new Promise(function(res, rej) { reject = rej; });
-    var m1 = m0.then(function() {});
-    var m2 = m0.then(function() {});
-    var m3 = m0.then(function() {});
-    var m4 = 0;
-    m0.catch(function() {
-        m2.catch(function() {
-            m1.catch(function() {
-                m4 = m3.then(function() {}); // Unhandled.
-            });
-        });
-    });
-    reject(new Error("err2"));
-}
-
-function promiseTest3()
-{
-    var reject;
-    var p = new Promise(function(res, rej) {
-        reject = rej;
-    });
-    p.then().catch(function catcher() {
-        throwDOMException();
-    });
-    reject(new Error("FAIL: Should not be printed to console"));
-
-    function throwDOMException()
-    {
-        var a = document.createElement("div");
-        var b = document.createElement("div");
-        a.removeChild(b);
-    }
-}
-
-function promiseTest4()
-{
-    Promise.reject(42);
-}
-
-function promiseTest5()
-{
-    Promise.reject(1e+100);
-}
-
-function promiseTest6()
-{
-    Promise.reject("foo");
-}
-
-function promiseTest7()
-{
-    Promise.reject({ foo: 42 });
-}
-
-function promiseTest8()
-{
-    Promise.reject();
-}
-
-function promiseTest9()
-{
-    navigator.serviceWorker.register('404');
-}
-
-function test() {
-  ConsoleTestRunner.addConsoleViewSniffer(checkConsoleMessages, true);
-  Common.console.showPromise();
-
-  checkConsoleMessages();
-
-  function checkConsoleMessages() {
-    TestRunner.evaluateInPage('runNextPromiseTest()', callback);
-
-    function callback(result) {
-      if (!result.value)
-        ConsoleTestRunner.expandConsoleMessages(dump);
-    }
-  }
-
-  function dump() {
-    ConsoleTestRunner.dumpConsoleMessagesIgnoreErrorStackFrames();
-    TestRunner.completeTest();
-  }
-}
-
-</script>
-</head>
-
-<body onload="runTest()">
-<p>
-Tests that uncaught promise rejections are logged into console.
-</p>
-
-</body>
-</html>
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-uncaught-promise.js b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-uncaught-promise.js
new file mode 100644
index 0000000..106a3e98
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-uncaught-promise.js
@@ -0,0 +1,118 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+(async function() {
+  TestRunner.addResult(`Tests that uncaught promise rejections are logged into console.\n`);
+  await TestRunner.loadModule('console_test_runner');
+  await TestRunner.showPanel('console');
+  await TestRunner.evaluateInPagePromise(`
+      var tested = 0;
+      function runNextPromiseTest()
+      {
+          ++tested;
+          var name = "promiseTest" + tested;
+          if (typeof window[name] !== "function")
+              return false;
+          // setTimeout to cut off VM call frames from the stack trace.
+          setTimeout(function timeout() {
+              window[name].call(window);
+          }, 0);
+          return true;
+      }
+
+      function promiseTest1()
+      {
+          Promise.reject(new Error("err1"))
+              .then()
+              .then()
+              .then(); // Last is unhandled.
+      }
+
+      function promiseTest2()
+      {
+          var reject;
+          var m0 = new Promise(function(res, rej) { reject = rej; });
+          var m1 = m0.then(function() {});
+          var m2 = m0.then(function() {});
+          var m3 = m0.then(function() {});
+          var m4 = 0;
+          m0.catch(function() {
+              m2.catch(function() {
+                  m1.catch(function() {
+                      m4 = m3.then(function() {}); // Unhandled.
+                  });
+              });
+          });
+          reject(new Error("err2"));
+      }
+
+      function promiseTest3()
+      {
+          var reject;
+          var p = new Promise(function(res, rej) {
+              reject = rej;
+          });
+          p.then().catch(function catcher() {
+              throwDOMException();
+          });
+          reject(new Error("FAIL: Should not be printed to console"));
+
+          function throwDOMException()
+          {
+              var a = document.createElement("div");
+              var b = document.createElement("div");
+              a.removeChild(b);
+          }
+      }
+
+      function promiseTest4()
+      {
+          Promise.reject(42);
+      }
+
+      function promiseTest5()
+      {
+          Promise.reject(1e+100);
+      }
+
+      function promiseTest6()
+      {
+          Promise.reject("foo");
+      }
+
+      function promiseTest7()
+      {
+          Promise.reject({ foo: 42 });
+      }
+
+      function promiseTest8()
+      {
+          Promise.reject();
+      }
+
+      function promiseTest9()
+      {
+          navigator.serviceWorker.register('404');
+      }
+  `);
+
+  ConsoleTestRunner.addConsoleViewSniffer(checkConsoleMessages, true);
+  Common.console.showPromise();
+
+  checkConsoleMessages();
+
+  function checkConsoleMessages() {
+    TestRunner.evaluateInPage('runNextPromiseTest()', callback);
+
+    function callback(result) {
+      if (!result.value)
+        ConsoleTestRunner.expandConsoleMessages(dump);
+    }
+  }
+
+  function dump() {
+    ConsoleTestRunner.dumpConsoleMessagesIgnoreErrorStackFrames();
+    TestRunner.completeTest();
+  }
+})();
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/console/resources/alert-toString-exception.html b/third_party/WebKit/LayoutTests/http/tests/devtools/console/resources/alert-toString-exception.html
new file mode 100644
index 0000000..7dfc57fc
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/devtools/console/resources/alert-toString-exception.html
@@ -0,0 +1,3 @@
+<script>
+alert({toString: function() { throw "Exception in toString()."; }});
+</script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/console/resources/console-log-toString-object.html b/third_party/WebKit/LayoutTests/http/tests/devtools/console/resources/console-log-toString-object.html
new file mode 100644
index 0000000..5c6f58e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/devtools/console/resources/console-log-toString-object.html
@@ -0,0 +1,3 @@
+<script>
+console.log({toString:{}});
+</script>
\ No newline at end of file