Bug 80650 - [WebSocket] Add a layout test where server force to disable all extensions
Summary: [WebSocket] Add a layout test where server force to disable all extensions
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Takashi Toyoshima
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-08 16:00 PST by Takashi Toyoshima
Modified: 2012-03-09 03:40 PST (History)
5 users (show)

See Also:


Attachments
Patch (7.10 KB, patch)
2012-03-08 16:33 PST, Takashi Toyoshima
no flags Details | Formatted Diff | Diff
Patch (7.08 KB, patch)
2012-03-08 17:14 PST, Takashi Toyoshima
no flags Details | Formatted Diff | Diff
Patch (7.94 KB, patch)
2012-03-08 21:26 PST, Takashi Toyoshima
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Takashi Toyoshima 2012-03-08 16:00:30 PST
Currently, WebSocket extensions which WebKit implement are all enabled by default.
But this enabled extension list could be changed when WebKit support other extensions or rename existing extensions.
It means that the expectation of a test which verify extensions property depends on WebKit.
This is not good for embedder's unit tests.

So, I'd like to add a layout test where server pyewebsocket just omit all extensions and the extensions property returns empty string.
Comment 1 Takashi Toyoshima 2012-03-08 16:33:35 PST
Created attachment 130937 [details]
Patch
Comment 2 Kenichi Ishibashi 2012-03-08 17:07:26 PST
Comment on attachment 130937 [details]
Patch

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

> LayoutTests/http/tests/websocket/tests/hybi/echo-with-no-extension.html:25
> +    shouldBeEqualToString("ws.extensions", "x-webkit-deflate-frame");

shouldBeEqualToString("ws.extensions", ""); ?
Comment 3 Takashi Toyoshima 2012-03-08 17:12:12 PST
Comment on attachment 130937 [details]
Patch

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

>> LayoutTests/http/tests/websocket/tests/hybi/echo-with-no-extension.html:25
>> +    shouldBeEqualToString("ws.extensions", "x-webkit-deflate-frame");
> 
> shouldBeEqualToString("ws.extensions", ""); ?

Oops, right.
I mistakenly overwrite the expectation.
Comment 4 Takashi Toyoshima 2012-03-08 17:14:51 PST
Created attachment 130940 [details]
Patch
Comment 5 Kent Tamura 2012-03-08 20:34:36 PST
Comment on attachment 130940 [details]
Patch

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

> LayoutTests/http/tests/websocket/tests/hybi/echo-with-no-extension-expected.txt:7
> +PASS ws.extensions is ""
> +PASS ws.extensions is ""
> +PASS ws.extensions is ""

It's hard to understand what are tested here with this result. At least we should show:

Check the value before opening the connection:
PASS ws.extensions is ""
PASS ws.extensions = "foo"; ws.extensions is ""
Check the value after opening the connection:
PASS ws.extensions is ""

> LayoutTests/http/tests/websocket/tests/hybi/echo-with-no-extension.html:21
> +ws.extensions = "foo";
> +shouldBeEqualToString("ws.extensions", "");

I prefer shouldBeEqualToString("ws.extensions = 'foo'; ws.extensions", "");

> LayoutTests/http/tests/websocket/tests/hybi/extensions-expected.txt:7
>  PASS ws.extensions is ""
>  PASS ws.extensions is ""
> +PASS ws.extensions is "x-webkit-deflate-frame"

I'd like to make the same comment with echo-with-no-extension-expected.txt.
Comment 6 Takashi Toyoshima 2012-03-08 21:25:20 PST
Comment on attachment 130940 [details]
Patch

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

>> LayoutTests/http/tests/websocket/tests/hybi/echo-with-no-extension-expected.txt:7
>> +PASS ws.extensions is ""
> 
> It's hard to understand what are tested here with this result. At least we should show:
> 
> Check the value before opening the connection:
> PASS ws.extensions is ""
> PASS ws.extensions = "foo"; ws.extensions is ""
> Check the value after opening the connection:
> PASS ws.extensions is ""

Agreed.

>> LayoutTests/http/tests/websocket/tests/hybi/echo-with-no-extension.html:21
>> +shouldBeEqualToString("ws.extensions", "");
> 
> I prefer shouldBeEqualToString("ws.extensions = 'foo'; ws.extensions", "");

I see.

>> LayoutTests/http/tests/websocket/tests/hybi/extensions-expected.txt:7
>> +PASS ws.extensions is "x-webkit-deflate-frame"
> 
> I'd like to make the same comment with echo-with-no-extension-expected.txt.

Done.
Comment 7 Takashi Toyoshima 2012-03-08 21:26:01 PST
Created attachment 130975 [details]
Patch
Comment 8 Kent Tamura 2012-03-08 21:27:41 PST
Comment on attachment 130975 [details]
Patch

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

> LayoutTests/http/tests/websocket/tests/hybi/echo-with-no-extension.html:21
> +// extensions attribute is read-only.
> +debug("Check if the value is read only:");

nit: The comment is not helpful.

> LayoutTests/http/tests/websocket/tests/hybi/extensions.html:20
>  // extensions attribute is read-only.

ditto.
Comment 9 WebKit Review Bot 2012-03-09 00:48:34 PST
Comment on attachment 130975 [details]
Patch

Clearing flags on attachment: 130975

Committed r110274: <http://trac.webkit.org/changeset/110274>
Comment 10 WebKit Review Bot 2012-03-09 00:48:40 PST
All reviewed patches have been landed.  Closing bug.
Comment 11 Nandor Huszka 2012-03-09 01:51:00 PST
This revision (r110274) causes fail on Qt. The diff:

--- /ramdisk/qt-linux-64-release/build/layout-test-results/http/tests/websocket/tests/hybi/extensions-expected.txt 
+++ /ramdisk/qt-linux-64-release/build/layout-test-results/http/tests/websocket/tests/hybi/extensions-actual.txt 
@@ -7,7 +7,7 @@
 Check if the value is read only:
 PASS ws.extensions = 'foo'; ws.extensions is ""
 Check the value after the connection is established:
-PASS ws.extensions is "x-webkit-deflate-frame"
+FAIL ws.extensions should be x-webkit-deflate-frame. Was .
 PASS successfullyParsed is true
 
 TEST COMPLETE
Comment 12 Kent Tamura 2012-03-09 02:01:53 PST
(In reply to comment #11)
> This revision (r110274) causes fail on Qt. The diff:

It's the same reason with compressed-control-frame.html, deflate-frame-invalid-parameter.html, deflate-frame-parameter.html, and handshake-fail-by-extensions-header.html.  They are skipped in Qt.
Comment 13 Nandor Huszka 2012-03-09 03:40:41 PST
(In reply to comment #12)
> It's the same reason with compressed-control-frame.html, deflate-frame-invalid-parameter.html, deflate-frame-parameter.html, and handshake-fail-by-extensions-header.html.  They are skipped in Qt.

Thank you for the information, test will be inserted to that group.