OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <set> | 6 #include <set> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
11 #include "base/run_loop.h" | 11 #include "base/run_loop.h" |
12 #include "base/threading/sequenced_worker_pool.h" | 12 #include "base/task_scheduler/post_task.h" |
13 #include "base/threading/thread_restrictions.h" | 13 #include "base/threading/thread_restrictions.h" |
14 #include "chrome/browser/browser_process.h" | 14 #include "chrome/browser/browser_process.h" |
15 #include "chrome/browser/io_thread.h" | 15 #include "chrome/browser/io_thread.h" |
16 #include "chrome/browser/net/dns_probe_test_util.h" | 16 #include "chrome/browser/net/dns_probe_test_util.h" |
17 #include "chrome/browser/net/net_error_tab_helper.h" | 17 #include "chrome/browser/net/net_error_tab_helper.h" |
18 #include "chrome/browser/net/url_request_mock_util.h" | 18 #include "chrome/browser/net/url_request_mock_util.h" |
19 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
20 #include "chrome/browser/ui/browser.h" | 20 #include "chrome/browser/ui/browser.h" |
21 #include "chrome/browser/ui/browser_commands.h" | 21 #include "chrome/browser/ui/browser_commands.h" |
22 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 22 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 DelayableURLRequestMockHTTPJob( | 178 DelayableURLRequestMockHTTPJob( |
179 net::URLRequest* request, | 179 net::URLRequest* request, |
180 net::NetworkDelegate* network_delegate, | 180 net::NetworkDelegate* network_delegate, |
181 const base::FilePath& file_path, | 181 const base::FilePath& file_path, |
182 bool should_delay, | 182 bool should_delay, |
183 const DestructionCallback& destruction_callback) | 183 const DestructionCallback& destruction_callback) |
184 : URLRequestMockHTTPJob( | 184 : URLRequestMockHTTPJob( |
185 request, | 185 request, |
186 network_delegate, | 186 network_delegate, |
187 file_path, | 187 file_path, |
188 BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior( | 188 base::CreateTaskRunnerWithTraits( |
189 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)), | 189 base::TaskTraits() |
| 190 .MayBlock() |
| 191 .WithPriority(base::TaskPriority::BACKGROUND) |
| 192 .WithShutdownBehavior( |
| 193 base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN))), |
190 should_delay_(should_delay), | 194 should_delay_(should_delay), |
191 start_delayed_(false), | 195 start_delayed_(false), |
192 destruction_callback_(destruction_callback) {} | 196 destruction_callback_(destruction_callback) {} |
193 | 197 |
194 void Start() override { | 198 void Start() override { |
195 if (should_delay_) { | 199 if (should_delay_) { |
196 DCHECK(!start_delayed_); | 200 DCHECK(!start_delayed_); |
197 start_delayed_ = true; | 201 start_delayed_ = true; |
198 return; | 202 return; |
199 } | 203 } |
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
981 | 985 |
982 EXPECT_EQ(error_page::DNS_PROBE_FINISHED_INCONCLUSIVE, | 986 EXPECT_EQ(error_page::DNS_PROBE_FINISHED_INCONCLUSIVE, |
983 WaitForSentStatus()); | 987 WaitForSentStatus()); |
984 EXPECT_EQ(0, pending_status_count()); | 988 EXPECT_EQ(0, pending_status_count()); |
985 ExpectDisplayingLocalErrorPage("ERR_NAME_NOT_RESOLVED"); | 989 ExpectDisplayingLocalErrorPage("ERR_NAME_NOT_RESOLVED"); |
986 } | 990 } |
987 | 991 |
988 } // namespace | 992 } // namespace |
989 | 993 |
990 } // namespace chrome_browser_net | 994 } // namespace chrome_browser_net |
OLD | NEW |