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 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 | 384 |
385 } // namespace | 385 } // namespace |
386 | 386 |
387 class WebSocketJobTest : public PlatformTest, | 387 class WebSocketJobTest : public PlatformTest, |
388 public ::testing::WithParamInterface<NextProto> { | 388 public ::testing::WithParamInterface<NextProto> { |
389 public: | 389 public: |
390 WebSocketJobTest() | 390 WebSocketJobTest() |
391 : spdy_util_(GetParam()), | 391 : spdy_util_(GetParam()), |
392 enable_websocket_over_spdy_(false) {} | 392 enable_websocket_over_spdy_(false) {} |
393 | 393 |
394 virtual void SetUp() override { | 394 void SetUp() override { |
395 stream_type_ = STREAM_INVALID; | 395 stream_type_ = STREAM_INVALID; |
396 cookie_store_ = new MockCookieStore; | 396 cookie_store_ = new MockCookieStore; |
397 context_.reset(new MockURLRequestContext(cookie_store_.get())); | 397 context_.reset(new MockURLRequestContext(cookie_store_.get())); |
398 } | 398 } |
399 virtual void TearDown() override { | 399 void TearDown() override { |
400 cookie_store_ = NULL; | 400 cookie_store_ = NULL; |
401 context_.reset(); | 401 context_.reset(); |
402 websocket_ = NULL; | 402 websocket_ = NULL; |
403 socket_ = NULL; | 403 socket_ = NULL; |
404 } | 404 } |
405 void DoSendRequest() { | 405 void DoSendRequest() { |
406 EXPECT_TRUE(websocket_->SendData(kHandshakeRequestWithoutCookie, | 406 EXPECT_TRUE(websocket_->SendData(kHandshakeRequestWithoutCookie, |
407 kHandshakeRequestWithoutCookieLength)); | 407 kHandshakeRequestWithoutCookieLength)); |
408 } | 408 } |
409 void DoSendData() { | 409 void DoSendData() { |
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1278 job()->Connect(); | 1278 job()->Connect(); |
1279 SetDeleteNext(); | 1279 SetDeleteNext(); |
1280 job()->OnReceivedData( | 1280 job()->OnReceivedData( |
1281 socket_.get(), kMinimalResponse, arraysize(kMinimalResponse) - 1); | 1281 socket_.get(), kMinimalResponse, arraysize(kMinimalResponse) - 1); |
1282 EXPECT_FALSE(job()); | 1282 EXPECT_FALSE(job()); |
1283 } | 1283 } |
1284 | 1284 |
1285 // TODO(toyoshim): Add tests to verify throttling, SPDY stream limitation. | 1285 // TODO(toyoshim): Add tests to verify throttling, SPDY stream limitation. |
1286 // TODO(toyoshim,yutak): Add tests to verify closing handshake. | 1286 // TODO(toyoshim,yutak): Add tests to verify closing handshake. |
1287 } // namespace net | 1287 } // namespace net |
OLD | NEW |