OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/loader/chrome_resource_dispatcher_host_delegate.h" | 5 #include "chrome/browser/loader/chrome_resource_dispatcher_host_delegate.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <memory> | 10 #include <memory> |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 : root_http_(root_http), report_on_ui_(report_on_ui) {} | 384 : root_http_(root_http), report_on_ui_(report_on_ui) {} |
385 ~MirrorMockJobInterceptor() override = default; | 385 ~MirrorMockJobInterceptor() override = default; |
386 | 386 |
387 // URLRequestInterceptor implementation | 387 // URLRequestInterceptor implementation |
388 net::URLRequestJob* MaybeInterceptRequest( | 388 net::URLRequestJob* MaybeInterceptRequest( |
389 net::URLRequest* request, | 389 net::URLRequest* request, |
390 net::NetworkDelegate* network_delegate) const override { | 390 net::NetworkDelegate* network_delegate) const override { |
391 return new MirrorMockURLRequestJob( | 391 return new MirrorMockURLRequestJob( |
392 request, network_delegate, root_http_, | 392 request, network_delegate, root_http_, |
393 base::CreateTaskRunnerWithTraits( | 393 base::CreateTaskRunnerWithTraits( |
394 base::TaskTraits() | 394 {base::MayBlock(), base::TaskPriority::BACKGROUND, |
395 .MayBlock() | 395 base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}), |
396 .WithPriority(base::TaskPriority::BACKGROUND) | |
397 .WithShutdownBehavior( | |
398 base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN)), | |
399 report_on_ui_); | 396 report_on_ui_); |
400 } | 397 } |
401 | 398 |
402 static void Register(const GURL& url, | 399 static void Register(const GURL& url, |
403 const base::FilePath& root_http, | 400 const base::FilePath& root_http, |
404 ReportResponseHeadersOnUI report_on_ui) { | 401 ReportResponseHeadersOnUI report_on_ui) { |
405 EXPECT_TRUE( | 402 EXPECT_TRUE( |
406 content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); | 403 content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); |
407 base::FilePath file_path(root_http); | 404 base::FilePath file_path(root_http); |
408 file_path = | 405 file_path = |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 DownloadTestObserverNotInProgress download_observer( | 633 DownloadTestObserverNotInProgress download_observer( |
637 content::BrowserContext::GetDownloadManager(browser()->profile()), 1); | 634 content::BrowserContext::GetDownloadManager(browser()->profile()), 1); |
638 download_observer.StartObserving(); | 635 download_observer.StartObserving(); |
639 ui_test_utils::NavigateToURL(browser(), embedded_test_server()->GetURL( | 636 ui_test_utils::NavigateToURL(browser(), embedded_test_server()->GetURL( |
640 "/download-anchor-attrib.html")); | 637 "/download-anchor-attrib.html")); |
641 download_observer.WaitForFinished(); | 638 download_observer.WaitForFinished(); |
642 EXPECT_EQ(1, | 639 EXPECT_EQ(1, |
643 GetTimesStandardThrottlesAddedForURL( | 640 GetTimesStandardThrottlesAddedForURL( |
644 embedded_test_server()->GetURL("/anchor_download_test.png"))); | 641 embedded_test_server()->GetURL("/anchor_download_test.png"))); |
645 } | 642 } |
OLD | NEW |