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 <memory> | 5 #include <memory> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 3049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3060 | 3060 |
3061 EXPECT_NE(d.data_received().find("secure-origin=1"), std::string::npos); | 3061 EXPECT_NE(d.data_received().find("secure-origin=1"), std::string::npos); |
3062 EXPECT_EQ(0, network_delegate.blocked_get_cookies_count()); | 3062 EXPECT_EQ(0, network_delegate.blocked_get_cookies_count()); |
3063 EXPECT_EQ(0, network_delegate.blocked_set_cookie_count()); | 3063 EXPECT_EQ(0, network_delegate.blocked_set_cookie_count()); |
3064 } | 3064 } |
3065 } | 3065 } |
3066 | 3066 |
3067 // Tests that a request is cancelled while entering suspend mode. Uses mocks | 3067 // Tests that a request is cancelled while entering suspend mode. Uses mocks |
3068 // rather than a spawned test server because the connection used to talk to | 3068 // rather than a spawned test server because the connection used to talk to |
3069 // the test server is affected by entering suspend mode on Android. | 3069 // the test server is affected by entering suspend mode on Android. |
3070 TEST_F(URLRequestTest, CancelOnSuspend) { | 3070 TEST_F(URLRequestTest, DISABLED_CancelOnSuspend) { |
3071 TestPowerMonitorSource* power_monitor_source = new TestPowerMonitorSource(); | 3071 TestPowerMonitorSource* power_monitor_source = new TestPowerMonitorSource(); |
3072 base::PowerMonitor power_monitor(base::WrapUnique(power_monitor_source)); | 3072 base::PowerMonitor power_monitor(base::WrapUnique(power_monitor_source)); |
3073 | 3073 |
3074 URLRequestFailedJob::AddUrlHandler(); | 3074 URLRequestFailedJob::AddUrlHandler(); |
3075 | 3075 |
3076 TestDelegate d; | 3076 TestDelegate d; |
3077 // Request that just hangs. | 3077 // Request that just hangs. |
3078 GURL url(URLRequestFailedJob::GetMockHttpUrl(ERR_IO_PENDING)); | 3078 GURL url(URLRequestFailedJob::GetMockHttpUrl(ERR_IO_PENDING)); |
3079 std::unique_ptr<URLRequest> r( | 3079 std::unique_ptr<URLRequest> r( |
3080 default_context_.CreateRequest(url, DEFAULT_PRIORITY, &d)); | 3080 default_context_.CreateRequest(url, DEFAULT_PRIORITY, &d)); |
(...skipping 7847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10928 AddTestInterceptor()->set_main_intercept_job(std::move(job)); | 10928 AddTestInterceptor()->set_main_intercept_job(std::move(job)); |
10929 | 10929 |
10930 req->Start(); | 10930 req->Start(); |
10931 req->Cancel(); | 10931 req->Cancel(); |
10932 base::RunLoop().RunUntilIdle(); | 10932 base::RunLoop().RunUntilIdle(); |
10933 EXPECT_EQ(ERR_ABORTED, d.request_status()); | 10933 EXPECT_EQ(ERR_ABORTED, d.request_status()); |
10934 EXPECT_EQ(0, d.received_redirect_count()); | 10934 EXPECT_EQ(0, d.received_redirect_count()); |
10935 } | 10935 } |
10936 | 10936 |
10937 } // namespace net | 10937 } // namespace net |
OLD | NEW |