| 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 "base/basictypes.h" | 5 #include "base/basictypes.h" | 
| 6 #include "base/compiler_specific.h" | 6 #include "base/compiler_specific.h" | 
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" | 
| 8 #include "net/base/mock_cert_verifier.h" | 8 #include "net/base/mock_cert_verifier.h" | 
| 9 #include "net/base/test_completion_callback.h" | 9 #include "net/base/test_completion_callback.h" | 
| 10 #include "net/dns/mock_host_resolver.h" | 10 #include "net/dns/mock_host_resolver.h" | 
| (...skipping 23 matching lines...) Expand all  Loading... | 
| 34 #include "net/ssl/ssl_config_service_defaults.h" | 34 #include "net/ssl/ssl_config_service_defaults.h" | 
| 35 #include "testing/gtest/include/gtest/gtest.h" | 35 #include "testing/gtest/include/gtest/gtest.h" | 
| 36 #include "testing/platform_test.h" | 36 #include "testing/platform_test.h" | 
| 37 | 37 | 
| 38 //----------------------------------------------------------------------------- | 38 //----------------------------------------------------------------------------- | 
| 39 | 39 | 
| 40 namespace { | 40 namespace { | 
| 41 | 41 | 
| 42 // This is the expected return from a current server advertising QUIC. | 42 // This is the expected return from a current server advertising QUIC. | 
| 43 static const char kQuicAlternateProtocolHttpHeader[] = | 43 static const char kQuicAlternateProtocolHttpHeader[] = | 
| 44     "Alternate-Protocol: 443:quic/1\r\n\r\n"; | 44     "Alternate-Protocol: 443:quic\r\n\r\n"; | 
| 45 | 45 | 
| 46 // Returns a vector of NPN protocol strings for negotiating QUIC. | 46 // Returns a vector of NPN protocol strings for negotiating QUIC. | 
| 47 std::vector<std::string> QuicNextProtos() { | 47 std::vector<std::string> QuicNextProtos() { | 
| 48   std::vector<std::string> protos; | 48   std::vector<std::string> protos; | 
| 49   protos.push_back("http/1.1"); | 49   protos.push_back("http/1.1"); | 
| 50   protos.push_back("quic/1"); | 50   protos.push_back("quic"); | 
| 51   return protos; | 51   return protos; | 
| 52 } | 52 } | 
| 53 | 53 | 
| 54 }  // namespace | 54 }  // namespace | 
| 55 | 55 | 
| 56 namespace net { | 56 namespace net { | 
| 57 namespace test { | 57 namespace test { | 
| 58 | 58 | 
| 59 class QuicNetworkTransactionTest : public PlatformTest { | 59 class QuicNetworkTransactionTest : public PlatformTest { | 
| 60  protected: | 60  protected: | 
| (...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 518   ASSERT_TRUE(response->headers != NULL); | 518   ASSERT_TRUE(response->headers != NULL); | 
| 519   EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); | 519   EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); | 
| 520   EXPECT_FALSE(response->was_fetched_via_spdy); | 520   EXPECT_FALSE(response->was_fetched_via_spdy); | 
| 521 | 521 | 
| 522   ASSERT_EQ(OK, ReadTransaction(trans.get(), &response_data)); | 522   ASSERT_EQ(OK, ReadTransaction(trans.get(), &response_data)); | 
| 523   EXPECT_EQ("hello!", response_data); | 523   EXPECT_EQ("hello!", response_data); | 
| 524 } | 524 } | 
| 525 | 525 | 
| 526 }  // namespace test | 526 }  // namespace test | 
| 527 }  // namespace net | 527 }  // namespace net | 
| OLD | NEW | 
|---|