| 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/spdy/spdy_session.h" | 5 #include "net/spdy/spdy_session.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 2357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2368 spdy_stream->Cancel(); | 2368 spdy_stream->Cancel(); |
| 2369 | 2369 |
| 2370 EXPECT_EQ(NULL, spdy_stream.get()); | 2370 EXPECT_EQ(NULL, spdy_stream.get()); |
| 2371 EXPECT_TRUE(delegate.StreamIsClosed()); | 2371 EXPECT_TRUE(delegate.StreamIsClosed()); |
| 2372 | 2372 |
| 2373 data.RunFor(2); // Write the RST_STREAM & GOAWAY. | 2373 data.RunFor(2); // Write the RST_STREAM & GOAWAY. |
| 2374 base::MessageLoop::current()->RunUntilIdle(); | 2374 base::MessageLoop::current()->RunUntilIdle(); |
| 2375 EXPECT_TRUE(session == NULL); | 2375 EXPECT_TRUE(session == NULL); |
| 2376 } | 2376 } |
| 2377 | 2377 |
| 2378 TEST_P(SpdySessionTest, DISABLED_VerifyDomainAuthentication) { | 2378 TEST_P(SpdySessionTest, VerifyDomainAuthentication) { |
| 2379 session_deps_.host_resolver->set_synchronous_mode(true); | 2379 session_deps_.host_resolver->set_synchronous_mode(true); |
| 2380 | 2380 |
| 2381 MockConnect connect_data(SYNCHRONOUS, OK); | 2381 MockConnect connect_data(SYNCHRONOUS, OK); |
| 2382 | 2382 |
| 2383 // No actual data will be sent. | 2383 // No actual data will be sent. |
| 2384 MockWrite writes[] = { | 2384 MockWrite writes[] = { |
| 2385 MockWrite(ASYNC, 0, 1) // EOF | 2385 MockWrite(ASYNC, 0, 1) // EOF |
| 2386 }; | 2386 }; |
| 2387 | 2387 |
| 2388 MockRead reads[] = { | 2388 MockRead reads[] = { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 2410 | 2410 |
| 2411 base::WeakPtr<SpdySession> session = | 2411 base::WeakPtr<SpdySession> session = |
| 2412 CreateSecureSpdySession(http_session_, key_, BoundNetLog()); | 2412 CreateSecureSpdySession(http_session_, key_, BoundNetLog()); |
| 2413 | 2413 |
| 2414 EXPECT_TRUE(session->VerifyDomainAuthentication("www.example.org")); | 2414 EXPECT_TRUE(session->VerifyDomainAuthentication("www.example.org")); |
| 2415 EXPECT_TRUE(session->VerifyDomainAuthentication("mail.example.org")); | 2415 EXPECT_TRUE(session->VerifyDomainAuthentication("mail.example.org")); |
| 2416 EXPECT_TRUE(session->VerifyDomainAuthentication("mail.example.com")); | 2416 EXPECT_TRUE(session->VerifyDomainAuthentication("mail.example.com")); |
| 2417 EXPECT_FALSE(session->VerifyDomainAuthentication("mail.google.com")); | 2417 EXPECT_FALSE(session->VerifyDomainAuthentication("mail.google.com")); |
| 2418 } | 2418 } |
| 2419 | 2419 |
| 2420 // TODO(rch): re-enable this. | 2420 TEST_P(SpdySessionTest, ConnectionPooledWithTlsChannelId) { |
| 2421 TEST_P(SpdySessionTest, DISABLED_ConnectionPooledWithTlsChannelId) { | |
| 2422 session_deps_.host_resolver->set_synchronous_mode(true); | 2421 session_deps_.host_resolver->set_synchronous_mode(true); |
| 2423 | 2422 |
| 2424 MockConnect connect_data(SYNCHRONOUS, OK); | 2423 MockConnect connect_data(SYNCHRONOUS, OK); |
| 2425 | 2424 |
| 2426 // No actual data will be sent. | 2425 // No actual data will be sent. |
| 2427 MockWrite writes[] = { | 2426 MockWrite writes[] = { |
| 2428 MockWrite(ASYNC, 0, 1) // EOF | 2427 MockWrite(ASYNC, 0, 1) // EOF |
| 2429 }; | 2428 }; |
| 2430 | 2429 |
| 2431 MockRead reads[] = { | 2430 MockRead reads[] = { |
| (...skipping 2563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4995 CHECK_EQ(GOAWAY_PROTOCOL_ERROR, | 4994 CHECK_EQ(GOAWAY_PROTOCOL_ERROR, |
| 4996 MapNetErrorToGoAwayStatus(ERR_SPDY_PROTOCOL_ERROR)); | 4995 MapNetErrorToGoAwayStatus(ERR_SPDY_PROTOCOL_ERROR)); |
| 4997 CHECK_EQ(GOAWAY_COMPRESSION_ERROR, | 4996 CHECK_EQ(GOAWAY_COMPRESSION_ERROR, |
| 4998 MapNetErrorToGoAwayStatus(ERR_SPDY_COMPRESSION_ERROR)); | 4997 MapNetErrorToGoAwayStatus(ERR_SPDY_COMPRESSION_ERROR)); |
| 4999 CHECK_EQ(GOAWAY_FRAME_SIZE_ERROR, | 4998 CHECK_EQ(GOAWAY_FRAME_SIZE_ERROR, |
| 5000 MapNetErrorToGoAwayStatus(ERR_SPDY_FRAME_SIZE_ERROR)); | 4999 MapNetErrorToGoAwayStatus(ERR_SPDY_FRAME_SIZE_ERROR)); |
| 5001 CHECK_EQ(GOAWAY_PROTOCOL_ERROR, MapNetErrorToGoAwayStatus(ERR_UNEXPECTED)); | 5000 CHECK_EQ(GOAWAY_PROTOCOL_ERROR, MapNetErrorToGoAwayStatus(ERR_UNEXPECTED)); |
| 5002 } | 5001 } |
| 5003 | 5002 |
| 5004 } // namespace net | 5003 } // namespace net |
| OLD | NEW |