Chromium Code Reviews| Index: LayoutTests/inspector/console/console-uncaught-promise.html |
| diff --git a/LayoutTests/inspector/console/console-uncaught-promise.html b/LayoutTests/inspector/console/console-uncaught-promise.html |
| index ee47a7151042db9dd430fdc34077dac51acdc1b5..d2c3c05ad263b581495594b463bcd2f2bbba2928 100644 |
| --- a/LayoutTests/inspector/console/console-uncaught-promise.html |
| +++ b/LayoutTests/inspector/console/console-uncaught-promise.html |
| @@ -33,29 +33,33 @@ function onload() |
| runTest(); |
| } |
| +function runPromisesFromInspector() |
| +{ |
| + // setTimeout to cut off VM call frames from the stack trace. |
| + setTimeout(function timeout() { |
|
yurys
2014/10/16 07:43:44
style: { should go on the next line.
aandrey
2014/10/16 09:01:38
This is a function argument, so it should not. I v
|
| + runPromises("inspector") |
| + }, 0); |
| +} |
| + |
| function test() |
| { |
| - InspectorTest.addConsoleViewSniffer(addMessage, true); |
| + InspectorTest.addConsoleViewSniffer(checkConsoleMessages, true); |
| + WebInspector.console.showPromise().done(); |
|
yurys
2014/10/16 07:43:44
Why do we need to call done here?
aandrey
2014/10/16 09:01:38
It will report error to console, should the promis
|
| - WebInspector.console.showPromise().then(function() { |
| - InspectorTest.evaluateInPage("runPromises('inspector')"); |
| - }); |
| + checkConsoleMessages(); |
| - var count = 0; |
| - function addMessage(uiMessage) |
| + function checkConsoleMessages() |
| { |
| - if (uiMessage.toString().indexOf("inspector.err") !== -1) |
| - ++count; |
| + var count = InspectorTest.consoleMessagesCount(); |
| if (count === 2) |
| + InspectorTest.evaluateInPage("runPromisesFromInspector()"); |
| + else if (count === 4) |
| InspectorTest.expandConsoleMessages(dump); |
| } |
| function dump() |
| { |
| - // Sort console messages from async Promises to avoid flakiness. |
| - var results = InspectorTest.dumpConsoleMessagesIntoArray(false, false, InspectorTest.textContentWithLineBreaks); |
| - results.sort(); |
| - InspectorTest.addResults(results); |
| + InspectorTest.dumpConsoleMessages(false, false, InspectorTest.textContentWithLineBreaks); |
| InspectorTest.completeTest(); |
| } |
| } |