| 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 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 base::MessageLoop::current()->RunUntilIdle(); | 704 base::MessageLoop::current()->RunUntilIdle(); |
| 705 EXPECT_FALSE(delegate.received_data().empty()); | 705 EXPECT_FALSE(delegate.received_data().empty()); |
| 706 EXPECT_EQ(kHandshakeResponseWithoutCookie, delegate.received_data()); | 706 EXPECT_EQ(kHandshakeResponseWithoutCookie, delegate.received_data()); |
| 707 EXPECT_EQ(WebSocketJob::OPEN, GetWebSocketJobState()); | 707 EXPECT_EQ(WebSocketJob::OPEN, GetWebSocketJobState()); |
| 708 CloseWebSocketJob(); | 708 CloseWebSocketJob(); |
| 709 } | 709 } |
| 710 | 710 |
| 711 INSTANTIATE_TEST_CASE_P( | 711 INSTANTIATE_TEST_CASE_P( |
| 712 NextProto, | 712 NextProto, |
| 713 WebSocketJobTest, | 713 WebSocketJobTest, |
| 714 testing::Values(kProtoDeprecatedSPDY2, | 714 testing::Values(kProtoSPDY31, kProtoSPDY4)); |
| 715 kProtoSPDY3, kProtoSPDY31, kProtoSPDY4)); | |
| 716 | 715 |
| 717 TEST_P(WebSocketJobTest, DelayedCookies) { | 716 TEST_P(WebSocketJobTest, DelayedCookies) { |
| 718 enable_websocket_over_spdy_ = true; | 717 enable_websocket_over_spdy_ = true; |
| 719 GURL url("ws://example.com/demo"); | 718 GURL url("ws://example.com/demo"); |
| 720 GURL cookieUrl("http://example.com/demo"); | 719 GURL cookieUrl("http://example.com/demo"); |
| 721 CookieOptions cookie_options; | 720 CookieOptions cookie_options; |
| 722 scoped_refptr<DelayedCookieMonster> cookie_store = new DelayedCookieMonster(); | 721 scoped_refptr<DelayedCookieMonster> cookie_store = new DelayedCookieMonster(); |
| 723 context_->set_cookie_store(cookie_store.get()); | 722 context_->set_cookie_store(cookie_store.get()); |
| 724 cookie_store->SetCookieWithOptionsAsync(cookieUrl, | 723 cookie_store->SetCookieWithOptionsAsync(cookieUrl, |
| 725 "CR-test=1", | 724 "CR-test=1", |
| (...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1278 job()->Connect(); | 1277 job()->Connect(); |
| 1279 SetDeleteNext(); | 1278 SetDeleteNext(); |
| 1280 job()->OnReceivedData( | 1279 job()->OnReceivedData( |
| 1281 socket_.get(), kMinimalResponse, arraysize(kMinimalResponse) - 1); | 1280 socket_.get(), kMinimalResponse, arraysize(kMinimalResponse) - 1); |
| 1282 EXPECT_FALSE(job()); | 1281 EXPECT_FALSE(job()); |
| 1283 } | 1282 } |
| 1284 | 1283 |
| 1285 // TODO(toyoshim): Add tests to verify throttling, SPDY stream limitation. | 1284 // TODO(toyoshim): Add tests to verify throttling, SPDY stream limitation. |
| 1286 // TODO(toyoshim,yutak): Add tests to verify closing handshake. | 1285 // TODO(toyoshim,yutak): Add tests to verify closing handshake. |
| 1287 } // namespace net | 1286 } // namespace net |
| OLD | NEW |