Commit 96d3f1ad authored by Erik Luo's avatar Erik Luo Committed by Commit Bot

DevTools: fix repeat bubble overlap for commands, results

Console Commands and Results no longer show a repeat count bubble.
It was possible to get consecutive Commands using expressions
starting with 'await', which collapsed when they should not.

Screenshot: https://imgur.com/a/8iOkL9p

Bug: 871940
Change-Id: I1dc2306d13c1511daa92fcd678520f3e8706e853
Reviewed-on: https://chromium-review.googlesource.com/1173265Reviewed-by: default avatarAndrey Lushnikov <lushnikov@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582968}
parent d5cb559a
Tests that repeat count is properly updated.
Message count: 7
Message count: 2
Message count: 4
Message count: 11
await delayedPromise
await delayedPromise
undefined
undefined
2console-repeat-count.js:15 Message
2console-repeat-count.js:18 Error: Message with error
at dumpMessages (console-repeat-count.js:18)
at console-repeat-count.js:36
at console-repeat-count.js:49
console-repeat-count.js:21 {a: 1}
dumpMessages @ console-repeat-count.js:21
(anonymous) @ console-repeat-count.js:36
(anonymous) @ console-repeat-count.js:49
console-repeat-count.js:21 {a: 1}
dumpMessages @ console-repeat-count.js:21
(anonymous) @ console-repeat-count.js:36
(anonymous) @ console-repeat-count.js:49
2console-repeat-count.js:31 Uncaught Primitive value
setTimeout @ console-repeat-count.js:31
setTimeout (async)
throwPrimitiveValues @ console-repeat-count.js:31
(anonymous) @ console-repeat-count.js:37
(anonymous) @ console-repeat-count.js:50
console-repeat-count.js:26 Uncaught {a: 1}
setTimeout @ console-repeat-count.js:26
setTimeout (async)
throwObjects @ console-repeat-count.js:26
(anonymous) @ console-repeat-count.js:38
(anonymous) @ console-repeat-count.js:51
console-repeat-count.js:26 Uncaught {a: 1}
setTimeout @ console-repeat-count.js:26
setTimeout (async)
throwObjects @ console-repeat-count.js:26
(anonymous) @ console-repeat-count.js:38
(anonymous) @ console-repeat-count.js:51
......@@ -30,14 +30,27 @@
for (var i = 0; i < 2; ++i)
setTimeout(() => { throw "Primitive value"; }, 0);
}
var delayedResolver;
var delayedPromise = new Promise(resolve => { delayedResolver = resolve; });
//# sourceURL=console-repeat-count.js
`);
// Same Command multiple times with no immediate result.
ConsoleTestRunner.evaluateInConsolePromise('await delayedPromise');
ConsoleTestRunner.evaluateInConsolePromise('await delayedPromise');
await ConsoleTestRunner.waitForConsoleMessagesPromise(2);
// Multiple Results with the same value.
await TestRunner.evaluateInPagePromise(`delayedResolver()`);
await ConsoleTestRunner.waitForConsoleMessagesPromise(4);
await TestRunner.evaluateInPagePromise('dumpMessages()');
await TestRunner.evaluateInPagePromise('throwPrimitiveValues()');
await TestRunner.evaluateInPagePromise('throwObjects()');
ConsoleTestRunner.waitForConsoleMessages(7, () => {
ConsoleTestRunner.dumpConsoleMessages();
TestRunner.completeTest();
});
await ConsoleTestRunner.waitForConsoleMessagesPromise(11);
ConsoleTestRunner.dumpConsoleMessages();
TestRunner.completeTest();
})();
......@@ -705,6 +705,8 @@ Console.ConsoleView = class extends UI.VBox {
_tryToCollapseMessages(viewMessage, lastMessage) {
const timestampsShown = this._timestampsSetting.get();
if (!timestampsShown && lastMessage && !viewMessage.consoleMessage().isGroupMessage() &&
viewMessage.consoleMessage().type !== SDK.ConsoleMessage.MessageType.Command &&
viewMessage.consoleMessage().type !== SDK.ConsoleMessage.MessageType.Result &&
viewMessage.consoleMessage().isEqual(lastMessage.consoleMessage())) {
lastMessage.incrementRepeatCount();
if (viewMessage.isLastInSimilarGroup())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment