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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <shlobj.h> | 9 #include <shlobj.h> |
10 #endif | 10 #endif |
(...skipping 4232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4243 EXPECT_EQ(URLRequestStatus::SUCCESS, req.status().status()); | 4243 EXPECT_EQ(URLRequestStatus::SUCCESS, req.status().status()); |
4244 | 4244 |
4245 base::FilePath path; | 4245 base::FilePath path; |
4246 PathService::Get(base::DIR_SOURCE_ROOT, &path); | 4246 PathService::Get(base::DIR_SOURCE_ROOT, &path); |
4247 path = path.Append(FILE_PATH_LITERAL("net")); | 4247 path = path.Append(FILE_PATH_LITERAL("net")); |
4248 path = path.Append(FILE_PATH_LITERAL("data")); | 4248 path = path.Append(FILE_PATH_LITERAL("data")); |
4249 path = path.Append(FILE_PATH_LITERAL("url_request_unittest")); | 4249 path = path.Append(FILE_PATH_LITERAL("url_request_unittest")); |
4250 path = path.Append(FILE_PATH_LITERAL("with-headers.html")); | 4250 path = path.Append(FILE_PATH_LITERAL("with-headers.html")); |
4251 | 4251 |
4252 std::string contents; | 4252 std::string contents; |
4253 EXPECT_TRUE(file_util::ReadFileToString(path, &contents)); | 4253 EXPECT_TRUE(base::ReadFileToString(path, &contents)); |
4254 EXPECT_EQ(contents, d.data_received()); | 4254 EXPECT_EQ(contents, d.data_received()); |
4255 } | 4255 } |
4256 } | 4256 } |
4257 | 4257 |
4258 TEST_F(URLRequestTestHTTP, DeferredRedirect_GetFullRequestHeaders) { | 4258 TEST_F(URLRequestTestHTTP, DeferredRedirect_GetFullRequestHeaders) { |
4259 ASSERT_TRUE(test_server_.Start()); | 4259 ASSERT_TRUE(test_server_.Start()); |
4260 | 4260 |
4261 TestDelegate d; | 4261 TestDelegate d; |
4262 { | 4262 { |
4263 d.set_quit_on_redirect(true); | 4263 d.set_quit_on_redirect(true); |
(...skipping 21 matching lines...) Expand all Loading... |
4285 EXPECT_EQ(URLRequestStatus::SUCCESS, req.status().status()); | 4285 EXPECT_EQ(URLRequestStatus::SUCCESS, req.status().status()); |
4286 | 4286 |
4287 base::FilePath path; | 4287 base::FilePath path; |
4288 PathService::Get(base::DIR_SOURCE_ROOT, &path); | 4288 PathService::Get(base::DIR_SOURCE_ROOT, &path); |
4289 path = path.Append(FILE_PATH_LITERAL("net")); | 4289 path = path.Append(FILE_PATH_LITERAL("net")); |
4290 path = path.Append(FILE_PATH_LITERAL("data")); | 4290 path = path.Append(FILE_PATH_LITERAL("data")); |
4291 path = path.Append(FILE_PATH_LITERAL("url_request_unittest")); | 4291 path = path.Append(FILE_PATH_LITERAL("url_request_unittest")); |
4292 path = path.Append(FILE_PATH_LITERAL("with-headers.html")); | 4292 path = path.Append(FILE_PATH_LITERAL("with-headers.html")); |
4293 | 4293 |
4294 std::string contents; | 4294 std::string contents; |
4295 EXPECT_TRUE(file_util::ReadFileToString(path, &contents)); | 4295 EXPECT_TRUE(base::ReadFileToString(path, &contents)); |
4296 EXPECT_EQ(contents, d.data_received()); | 4296 EXPECT_EQ(contents, d.data_received()); |
4297 } | 4297 } |
4298 } | 4298 } |
4299 | 4299 |
4300 TEST_F(URLRequestTestHTTP, CancelDeferredRedirect) { | 4300 TEST_F(URLRequestTestHTTP, CancelDeferredRedirect) { |
4301 ASSERT_TRUE(test_server_.Start()); | 4301 ASSERT_TRUE(test_server_.Start()); |
4302 | 4302 |
4303 TestDelegate d; | 4303 TestDelegate d; |
4304 { | 4304 { |
4305 d.set_quit_on_redirect(true); | 4305 d.set_quit_on_redirect(true); |
(...skipping 1980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6286 | 6286 |
6287 EXPECT_FALSE(r.is_pending()); | 6287 EXPECT_FALSE(r.is_pending()); |
6288 EXPECT_EQ(1, d->response_started_count()); | 6288 EXPECT_EQ(1, d->response_started_count()); |
6289 EXPECT_FALSE(d->received_data_before_response()); | 6289 EXPECT_FALSE(d->received_data_before_response()); |
6290 EXPECT_EQ(d->bytes_received(), static_cast<int>(file_size)); | 6290 EXPECT_EQ(d->bytes_received(), static_cast<int>(file_size)); |
6291 } | 6291 } |
6292 } | 6292 } |
6293 #endif // !defined(DISABLE_FTP_SUPPORT) | 6293 #endif // !defined(DISABLE_FTP_SUPPORT) |
6294 | 6294 |
6295 } // namespace net | 6295 } // namespace net |
OLD | NEW |