OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-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/url_request/url_request_unittest.h" | 5 #include "net/url_request/url_request_unittest.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
10 #include <windows.h> | 10 #include <windows.h> |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 }; | 71 }; |
72 | 72 |
73 class TestURLRequest : public URLRequest { | 73 class TestURLRequest : public URLRequest { |
74 public: | 74 public: |
75 TestURLRequest(const GURL& url, Delegate* delegate) | 75 TestURLRequest(const GURL& url, Delegate* delegate) |
76 : URLRequest(url, delegate) { | 76 : URLRequest(url, delegate) { |
77 set_context(new URLRequestTestContext()); | 77 set_context(new URLRequestTestContext()); |
78 } | 78 } |
79 }; | 79 }; |
80 | 80 |
81 StringPiece TestNetResourceProvider(int key) { | 81 base::StringPiece TestNetResourceProvider(int key) { |
82 return "header"; | 82 return "header"; |
83 } | 83 } |
84 | 84 |
85 // Do a case-insensitive search through |haystack| for |needle|. | 85 // Do a case-insensitive search through |haystack| for |needle|. |
86 bool ContainsString(const std::string& haystack, const char* needle) { | 86 bool ContainsString(const std::string& haystack, const char* needle) { |
87 std::string::const_iterator it = | 87 std::string::const_iterator it = |
88 std::search(haystack.begin(), | 88 std::search(haystack.begin(), |
89 haystack.end(), | 89 haystack.end(), |
90 needle, | 90 needle, |
91 needle + strlen(needle), | 91 needle + strlen(needle), |
(...skipping 2001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2093 | 2093 |
2094 int64 file_size = 0; | 2094 int64 file_size = 0; |
2095 file_util::GetFileSize(app_path, &file_size); | 2095 file_util::GetFileSize(app_path, &file_size); |
2096 | 2096 |
2097 EXPECT_FALSE(r.is_pending()); | 2097 EXPECT_FALSE(r.is_pending()); |
2098 EXPECT_EQ(1, d.response_started_count()); | 2098 EXPECT_EQ(1, d.response_started_count()); |
2099 EXPECT_FALSE(d.received_data_before_response()); | 2099 EXPECT_FALSE(d.received_data_before_response()); |
2100 EXPECT_EQ(d.bytes_received(), static_cast<int>(file_size)); | 2100 EXPECT_EQ(d.bytes_received(), static_cast<int>(file_size)); |
2101 } | 2101 } |
2102 } | 2102 } |
OLD | NEW |