Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Unified Diff: third_party/WebKit/LayoutTests/http/tests/inspector-enabled/console-promise-reject-and-handle.html

Issue 2150993004: [DevTools] Remove V8Debugger::consoleMessagesCount. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/http/tests/inspector-enabled/console-promise-reject-and-handle.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-enabled/console-promise-reject-and-handle.html b/third_party/WebKit/LayoutTests/http/tests/inspector-enabled/console-promise-reject-and-handle.html
new file mode 100644
index 0000000000000000000000000000000000000000..10f35f2ee1fed6f1d17babb9772768e89ca01b4a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector-enabled/console-promise-reject-and-handle.html
@@ -0,0 +1,63 @@
+<html>
+<head>
+<script src="../inspector/inspector-test.js"></script>
+<script src="../inspector/console-test.js"></script>
+<script>
+if (window.testRunner) {
+ testRunner.waitUntilDone();
+ testRunner.dumpAsText();
+}
+
+function setupPromise1()
+{
+ var p = Promise.reject(new Error('e'));
+ window.onunhandledrejection = function(evt) {
+ console.log("onunhandledrejection1");
+ evt.preventDefault();
+ setTimeout(function() {
+ p.then(function(){}, function(){});
+ }, 10);
+ };
+ window.onrejectionhandled = function(evt) {
+ console.log("onrejectionhandled1");
+ setTimeout(setupPromise2, 0);
+ };
+}
+
+function setupPromise2()
+{
+ var p = Promise.reject(new Error('e'));
+ window.onunhandledrejection = function(evt) {
+ console.log("onunhandledrejection2");
+ setTimeout(function() {
+ p.then(function(){}, function(){});
+ }, 10);
+ };
+ window.onrejectionhandled = function(evt) {
+ console.log("onrejectionhandled2");
+ setTimeout(startTest, 0);
+ };
+ function startTest()
+ {
+ if (window.testRunner)
+ testRunner.showWebInspector();
+ runTest();
+ }
+}
+
+function test()
+{
+ InspectorTest.expandConsoleMessages();
+ InspectorTest.addResult("----console messages start----");
+ InspectorTest.dumpConsoleMessages();
+ InspectorTest.addResult("----console messages end----");
+ InspectorTest.completeTest();
+}
+</script>
+</head>
+<body onload="setupPromise1()">
+<p>
+Tests that evt.preventDefault() in window.onunhandledrejection suppresses console output.
+</p>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698