| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/flip/flip_network_transaction.h" | 5 #include "net/flip/flip_network_transaction.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/ref_counted.h" | 8 #include "base/ref_counted.h" |
| 9 #include "net/base/completion_callback.h" | 9 #include "net/base/completion_callback.h" |
| 10 #include "net/base/mock_host_resolver.h" | 10 #include "net/base/mock_host_resolver.h" |
| (...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 873 request.url = GURL("http://www.google.com/"); | 873 request.url = GURL("http://www.google.com/"); |
| 874 request.load_flags = 0; | 874 request.load_flags = 0; |
| 875 scoped_refptr<DelayedSocketData> data( | 875 scoped_refptr<DelayedSocketData> data( |
| 876 new DelayedSocketData(reads, kChunks, writes.get())); | 876 new DelayedSocketData(reads, kChunks, writes.get())); |
| 877 TransactionHelperResult out = TransactionHelper(request, data.get()); | 877 TransactionHelperResult out = TransactionHelper(request, data.get()); |
| 878 EXPECT_EQ(OK, out.rv); | 878 EXPECT_EQ(OK, out.rv); |
| 879 EXPECT_EQ("HTTP/1.1 200 OK", out.status_line); | 879 EXPECT_EQ("HTTP/1.1 200 OK", out.status_line); |
| 880 EXPECT_EQ("hello!", out.response_data); | 880 EXPECT_EQ("hello!", out.response_data); |
| 881 } | 881 } |
| 882 | 882 |
| 883 TEST_F(FlipNetworkTransactionTest, ConnectFailure) { | 883 // Disabled due to flaky mac (and possibly linux) valgrind errors. |
| 884 // http://crbug.com/29471 |
| 885 TEST_F(FlipNetworkTransactionTest, DISABLED_ConnectFailure) { |
| 884 MockConnect connects[] = { | 886 MockConnect connects[] = { |
| 885 MockConnect(true, ERR_NAME_NOT_RESOLVED), | 887 MockConnect(true, ERR_NAME_NOT_RESOLVED), |
| 886 MockConnect(false, ERR_NAME_NOT_RESOLVED), | 888 MockConnect(false, ERR_NAME_NOT_RESOLVED), |
| 887 MockConnect(true, ERR_INTERNET_DISCONNECTED), | 889 MockConnect(true, ERR_INTERNET_DISCONNECTED), |
| 888 MockConnect(false, ERR_INTERNET_DISCONNECTED) | 890 MockConnect(false, ERR_INTERNET_DISCONNECTED) |
| 889 }; | 891 }; |
| 890 | 892 |
| 891 for (size_t index = 0; index < arraysize(connects); ++index) { | 893 for (size_t index = 0; index < arraysize(connects); ++index) { |
| 892 MockWrite writes[] = { | 894 MockWrite writes[] = { |
| 893 MockWrite(true, reinterpret_cast<const char*>(kGetSyn), | 895 MockWrite(true, reinterpret_cast<const char*>(kGetSyn), |
| (...skipping 14 matching lines...) Expand all Loading... |
| 908 request.url = GURL("http://www.google.com/"); | 910 request.url = GURL("http://www.google.com/"); |
| 909 request.load_flags = 0; | 911 request.load_flags = 0; |
| 910 scoped_refptr<DelayedSocketData> data( | 912 scoped_refptr<DelayedSocketData> data( |
| 911 new DelayedSocketData(connects[index], reads, 1, writes)); | 913 new DelayedSocketData(connects[index], reads, 1, writes)); |
| 912 TransactionHelperResult out = TransactionHelper(request, data.get()); | 914 TransactionHelperResult out = TransactionHelper(request, data.get()); |
| 913 EXPECT_EQ(connects[index].result, out.rv); | 915 EXPECT_EQ(connects[index].result, out.rv); |
| 914 } | 916 } |
| 915 } | 917 } |
| 916 | 918 |
| 917 } // namespace net | 919 } // namespace net |
| OLD | NEW |