Bug 113327

Summary: Web Inspector: Exception in console on attempt to filter javascript messages.
Product: WebKit Reporter: Dmitry Zvorygin <zvorygin>
Component: Web Inspector (Deprecated)Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, keishi, loislo, pfeldman, pmuellr, vsevik, web-inspector-bugs, webkit.review.bot, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Dmitry Zvorygin 2013-03-26 11:11:47 PDT
Exception in console on attempt to filter javascript messages by source if console groups are used.
Comment 1 Dmitry Zvorygin 2013-03-26 11:38:23 PDT
Created attachment 195127 [details]
Patch
Comment 2 Pavel Feldman 2013-03-27 03:13:28 PDT
Comment on attachment 195127 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=195127&action=review

> Source/WebCore/inspector/front-end/ConsoleMessage.js:779
> +        if (!this._element) return;

return should be on the next line

> Source/WebCore/inspector/front-end/ConsoleView.js:559
> +                    } else if (sourceMessage.type === WebInspector.ConsoleMessage.MessageType.StartGroup || sourceMessage.type === WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed) {

This needs a test

> Source/WebCore/inspector/front-end/ConsoleView.js:673
> +        this._messages.push(message);

Let migrate tests back to this._messages
Comment 3 Dmitry Zvorygin 2013-03-27 07:28:07 PDT
Created attachment 195315 [details]
Patch
Comment 4 Dmitry Zvorygin 2013-03-27 07:36:06 PDT
Comment on attachment 195127 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=195127&action=review

>> Source/WebCore/inspector/front-end/ConsoleMessage.js:779
>> +        if (!this._element) return;
> 
> return should be on the next line

Done.

>> Source/WebCore/inspector/front-end/ConsoleView.js:559
>> +                    } else if (sourceMessage.type === WebInspector.ConsoleMessage.MessageType.StartGroup || sourceMessage.type === WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed) {
> 
> This needs a test

Added tests.

>> Source/WebCore/inspector/front-end/ConsoleView.js:673
>> +        this._messages.push(message);
> 
> Let migrate tests back to this._messages

Tests shouldn't use _messages field, but instead use DOM generated by console.
Comment 5 Pavel Feldman 2013-03-28 05:26:31 PDT
Comment on attachment 195315 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=195315&action=review

> LayoutTests/inspector/console/console-filter-test.html:17
> +            log1(i + "topGroup"); // from console-filter-test.html

Please don't change the tests when doing refactorings - it is hard to spot the regression and merge if necessary.
Comment 6 Dmitry Zvorygin 2013-03-28 05:55:02 PDT
Comment on attachment 195315 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=195315&action=review

>> LayoutTests/inspector/console/console-filter-test.html:17
>> +            log1(i + "topGroup"); // from console-filter-test.html
> 
> Please don't change the tests when doing refactorings - it is hard to spot the regression and merge if necessary.

That's the test which I wrote, and which originally worked fine(before and after refactoring). I just made this test to cover additional group-related cases.
Comment 7 Dmitry Zvorygin 2013-04-01 07:24:37 PDT
Created attachment 195966 [details]
Patch
Comment 8 WebKit Review Bot 2013-04-01 08:23:38 PDT
The commit-queue encountered the following flaky tests while processing attachment 195966 [details]:

fast/preloader/document-write-noscript.html bug 113464 (authors: rniwa@webkit.org and tonyg@chromium.org)
The commit-queue is continuing to process your patch.
Comment 9 WebKit Review Bot 2013-04-01 08:25:06 PDT
Comment on attachment 195966 [details]
Patch

Clearing flags on attachment: 195966

Committed r147327: <http://trac.webkit.org/changeset/147327>
Comment 10 WebKit Review Bot 2013-04-01 08:25:10 PDT
All reviewed patches have been landed.  Closing bug.