OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 base::MessageLoop::current()->RunUntilIdle(); | 590 base::MessageLoop::current()->RunUntilIdle(); |
591 EXPECT_FALSE(delegate.received_data().empty()); | 591 EXPECT_FALSE(delegate.received_data().empty()); |
592 EXPECT_EQ(kHandshakeResponseWithoutCookie, delegate.received_data()); | 592 EXPECT_EQ(kHandshakeResponseWithoutCookie, delegate.received_data()); |
593 EXPECT_EQ(WebSocketJob::OPEN, GetWebSocketJobState()); | 593 EXPECT_EQ(WebSocketJob::OPEN, GetWebSocketJobState()); |
594 CloseWebSocketJob(); | 594 CloseWebSocketJob(); |
595 } | 595 } |
596 | 596 |
597 INSTANTIATE_TEST_CASE_P( | 597 INSTANTIATE_TEST_CASE_P( |
598 NextProto, | 598 NextProto, |
599 WebSocketJobTest, | 599 WebSocketJobTest, |
600 testing::Values(kProtoSPDY2, kProtoSPDY3, kProtoSPDY31, kProtoSPDY4a2, | 600 testing::Values(kProtoDeprecatedSPDY2, |
| 601 kProtoSPDY3, kProtoSPDY31, kProtoSPDY4a2, |
601 kProtoHTTP2Draft04)); | 602 kProtoHTTP2Draft04)); |
602 | 603 |
603 TEST_P(WebSocketJobTest, DelayedCookies) { | 604 TEST_P(WebSocketJobTest, DelayedCookies) { |
604 WebSocketJob::set_websocket_over_spdy_enabled(true); | 605 WebSocketJob::set_websocket_over_spdy_enabled(true); |
605 GURL url("ws://example.com/demo"); | 606 GURL url("ws://example.com/demo"); |
606 GURL cookieUrl("http://example.com/demo"); | 607 GURL cookieUrl("http://example.com/demo"); |
607 CookieOptions cookie_options; | 608 CookieOptions cookie_options; |
608 scoped_refptr<DelayedCookieMonster> cookie_store = new DelayedCookieMonster(); | 609 scoped_refptr<DelayedCookieMonster> cookie_store = new DelayedCookieMonster(); |
609 context_->set_cookie_store(cookie_store.get()); | 610 context_->set_cookie_store(cookie_store.get()); |
610 cookie_store->SetCookieWithOptionsAsync(cookieUrl, | 611 cookie_store->SetCookieWithOptionsAsync(cookieUrl, |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1103 } | 1104 } |
1104 | 1105 |
1105 TEST_P(WebSocketJobTest, ThrottlingSpdySpdyEnabled) { | 1106 TEST_P(WebSocketJobTest, ThrottlingSpdySpdyEnabled) { |
1106 WebSocketJob::set_websocket_over_spdy_enabled(true); | 1107 WebSocketJob::set_websocket_over_spdy_enabled(true); |
1107 TestConnectBySpdy(SPDY_ON, THROTTLING_ON); | 1108 TestConnectBySpdy(SPDY_ON, THROTTLING_ON); |
1108 } | 1109 } |
1109 | 1110 |
1110 // TODO(toyoshim): Add tests to verify throttling, SPDY stream limitation. | 1111 // TODO(toyoshim): Add tests to verify throttling, SPDY stream limitation. |
1111 // TODO(toyoshim,yutak): Add tests to verify closing handshake. | 1112 // TODO(toyoshim,yutak): Add tests to verify closing handshake. |
1112 } // namespace net | 1113 } // namespace net |
OLD | NEW |