OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/websockets/websocket_job.h" | 5 #include "net/websockets/websocket_job.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 "Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=\r\n" | 537 "Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=\r\n" |
538 "Sec-WebSocket-Protocol: sample\r\n" | 538 "Sec-WebSocket-Protocol: sample\r\n" |
539 "Set-Cookie: CR-set-test=1\r\n" | 539 "Set-Cookie: CR-set-test=1\r\n" |
540 "\r\n"; | 540 "\r\n"; |
541 | 541 |
542 const char WebSocketJobSpdy3Test::kDataHello[] = "Hello, "; | 542 const char WebSocketJobSpdy3Test::kDataHello[] = "Hello, "; |
543 | 543 |
544 const char WebSocketJobSpdy3Test::kDataWorld[] = "World!\n"; | 544 const char WebSocketJobSpdy3Test::kDataWorld[] = "World!\n"; |
545 | 545 |
546 const char* const WebSocketJobSpdy3Test::kHandshakeRequestForSpdy[] = { | 546 const char* const WebSocketJobSpdy3Test::kHandshakeRequestForSpdy[] = { |
547 "path", "/demo", | 547 ":path", "/demo", |
548 "version", "WebSocket/13", | 548 ":version", "WebSocket/13", |
549 "scheme", "ws", | 549 ":scheme", "ws", |
550 "host", "example.com", | 550 ":host", "example.com", |
551 "origin", "http://example.com", | 551 ":origin", "http://example.com", |
552 "sec-websocket-protocol", "sample" | 552 ":sec-websocket-protocol", "sample" |
553 }; | 553 }; |
554 | 554 |
555 const char* const WebSocketJobSpdy3Test::kHandshakeResponseForSpdy[] = { | 555 const char* const WebSocketJobSpdy3Test::kHandshakeResponseForSpdy[] = { |
556 "status", "101 Switching Protocols", | 556 ":status", "101 Switching Protocols", |
557 "sec-websocket-protocol", "sample" | 557 ":sec-websocket-protocol", "sample" |
558 }; | 558 }; |
559 | 559 |
560 const size_t WebSocketJobSpdy3Test::kHandshakeRequestWithoutCookieLength = | 560 const size_t WebSocketJobSpdy3Test::kHandshakeRequestWithoutCookieLength = |
561 arraysize(kHandshakeRequestWithoutCookie) - 1; | 561 arraysize(kHandshakeRequestWithoutCookie) - 1; |
562 const size_t WebSocketJobSpdy3Test::kHandshakeRequestWithCookieLength = | 562 const size_t WebSocketJobSpdy3Test::kHandshakeRequestWithCookieLength = |
563 arraysize(kHandshakeRequestWithCookie) - 1; | 563 arraysize(kHandshakeRequestWithCookie) - 1; |
564 const size_t WebSocketJobSpdy3Test::kHandshakeRequestWithFilteredCookieLength = | 564 const size_t WebSocketJobSpdy3Test::kHandshakeRequestWithFilteredCookieLength = |
565 arraysize(kHandshakeRequestWithFilteredCookie) - 1; | 565 arraysize(kHandshakeRequestWithFilteredCookie) - 1; |
566 const size_t WebSocketJobSpdy3Test::kHandshakeResponseWithoutCookieLength = | 566 const size_t WebSocketJobSpdy3Test::kHandshakeResponseWithoutCookieLength = |
567 arraysize(kHandshakeResponseWithoutCookie) - 1; | 567 arraysize(kHandshakeResponseWithoutCookie) - 1; |
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1091 | 1091 |
1092 TEST_F(WebSocketJobSpdy3Test, ThrottlingSpdySpdyEnabled) { | 1092 TEST_F(WebSocketJobSpdy3Test, ThrottlingSpdySpdyEnabled) { |
1093 WebSocketJob::set_websocket_over_spdy_enabled(true); | 1093 WebSocketJob::set_websocket_over_spdy_enabled(true); |
1094 TestConnectBySpdy(SPDY_ON, THROTTLING_ON); | 1094 TestConnectBySpdy(SPDY_ON, THROTTLING_ON); |
1095 } | 1095 } |
1096 | 1096 |
1097 // TODO(toyoshim): Add tests to verify throttling, SPDY stream limitation. | 1097 // TODO(toyoshim): Add tests to verify throttling, SPDY stream limitation. |
1098 // TODO(toyoshim,yutak): Add tests to verify closing handshake. | 1098 // TODO(toyoshim,yutak): Add tests to verify closing handshake. |
1099 | 1099 |
1100 } // namespace net | 1100 } // namespace net |
OLD | NEW |