Bug 106705

Summary: Web Inspector: add text editor formatter test
Product: WebKit Reporter: Andrey Lushnikov <lushnikov>
Component: Web Inspector (Deprecated)Assignee: Andrey Lushnikov <lushnikov>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, buildbot, dglazkov, keishi, loislo, pfeldman, pmuellr, rniwa, vsevik, web-inspector-bugs, webkit.review.bot, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on: 106650, 106883    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch none

Description Andrey Lushnikov 2013-01-11 14:56:49 PST
Make a test that would simulate some code input into text editor and check if it formats it correctly.
Comment 1 Andrey Lushnikov 2013-01-11 15:06:47 PST
Created attachment 182428 [details]
Patch
Comment 2 Build Bot 2013-01-11 19:27:59 PST
Comment on attachment 182428 [details]
Patch

Attachment 182428 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/15817140

New failing tests:
inspector/editor/text-editor-formatter.html
Comment 3 WebKit Review Bot 2013-01-11 21:39:12 PST
Comment on attachment 182428 [details]
Patch

Attachment 182428 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/15822195

New failing tests:
inspector/editor/text-editor-formatter.html
Comment 4 Pavel Feldman 2013-01-14 01:38:10 PST
Comment on attachment 182428 [details]
Patch

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

> LayoutTests/inspector/editor/text-editor-formatter.html:12
> +    function enter() {

{ on the next line.

> LayoutTests/inspector/editor/text-editor-formatter.html:16
> +    function printLine(line) {

ditto and move this into editor-test.js InspectorTest.printEditorLine

> LayoutTests/inspector/editor/text-editor-formatter.html:24
> +    var textEditor = new WebInspector.DefaultTextEditor("", new WebInspector.TextEditorDelegate());

You should use editor test's implementation.

> LayoutTests/inspector/editor/text-editor-formatter.html:26
> +    textEditor.mimeType="text/javascript";

mimeType =

> LayoutTests/inspector/editor/text-editor-formatter.html:51
> +    testRunner.closeWebInspector();

try calling InspectorFrontendHost.bringToFront instead.

> LayoutTests/inspector/editor/text-editor-formatter.html:68
> +function foo(n) {

declare it in test and use its toString().split("\n")
Comment 5 Andrey Lushnikov 2013-01-14 07:21:19 PST
Created attachment 182572 [details]
Patch
Comment 6 WebKit Review Bot 2013-01-14 08:23:01 PST
Comment on attachment 182572 [details]
Patch

Attachment 182572 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/15870546

New failing tests:
inspector/editor/text-editor-formatter.html
Comment 7 Andrey Lushnikov 2013-01-14 08:42:24 PST
Created attachment 182582 [details]
Patch
Comment 8 Pavel Feldman 2013-01-14 08:49:12 PST
Comment on attachment 182582 [details]
Patch

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

> LayoutTests/inspector/editor/editor-test.js:22
> +function enter()

Please declare it inline

> LayoutTests/inspector/editor/text-editor-formatter.html:21
> +        for(var i = 0; i < codeLines.length; ++i) {

Remove {}

> LayoutTests/inspector/editor/text-editor-formatter.html:54
> +    function bar() {

{ on the next line
Comment 9 Andrey Lushnikov 2013-01-14 08:55:16 PST
Created attachment 182585 [details]
Patch
Comment 10 WebKit Review Bot 2013-01-14 09:26:29 PST
Comment on attachment 182585 [details]
Patch

Clearing flags on attachment: 182585

Committed r139617: <http://trac.webkit.org/changeset/139617>
Comment 11 WebKit Review Bot 2013-01-14 09:26:33 PST
All reviewed patches have been landed.  Closing bug.