Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Side by Side Diff: content/browser/loader/resource_dispatcher_host_browsertest.cc

Issue 845973005: [New Tab Page] Change the mechanism to intercept online NTP errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: moved to profile_io_data Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "base/memory/ref_counted.h" 5 #include "base/memory/ref_counted.h"
6 #include "base/strings/string_util.h" 6 #include "base/strings/string_util.h"
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "content/browser/download/download_manager_impl.h" 9 #include "content/browser/download/download_manager_impl.h"
10 #include "content/browser/web_contents/web_contents_impl.h" 10 #include "content/browser/web_contents/web_contents_impl.h"
(...skipping 24 matching lines...) Expand all
35 35
36 class ResourceDispatcherHostBrowserTest : public ContentBrowserTest, 36 class ResourceDispatcherHostBrowserTest : public ContentBrowserTest,
37 public DownloadManager::Observer { 37 public DownloadManager::Observer {
38 public: 38 public:
39 ResourceDispatcherHostBrowserTest() : got_downloads_(false) {} 39 ResourceDispatcherHostBrowserTest() : got_downloads_(false) {}
40 40
41 protected: 41 protected:
42 void SetUpOnMainThread() override { 42 void SetUpOnMainThread() override {
43 base::FilePath path = GetTestFilePath("", ""); 43 base::FilePath path = GetTestFilePath("", "");
44 BrowserThread::PostTask( 44 BrowserThread::PostTask(
45 BrowserThread::IO, 45 BrowserThread::IO, FROM_HERE,
46 FROM_HERE,
47 base::Bind( 46 base::Bind(
48 &net::URLRequestMockHTTPJob::AddUrlHandler, 47 &net::URLRequestMockHTTPJob::AddUrlHandlers, path,
49 path,
50 make_scoped_refptr(content::BrowserThread::GetBlockingPool()))); 48 make_scoped_refptr(content::BrowserThread::GetBlockingPool())));
51 BrowserThread::PostTask( 49 BrowserThread::PostTask(
52 BrowserThread::IO, FROM_HERE, 50 BrowserThread::IO, FROM_HERE,
53 base::Bind(&net::URLRequestFailedJob::AddUrlHandler)); 51 base::Bind(&net::URLRequestFailedJob::AddUrlHandler));
54 } 52 }
55 53
56 void OnDownloadCreated(DownloadManager* manager, 54 void OnDownloadCreated(DownloadManager* manager,
57 DownloadItem* item) override { 55 DownloadItem* item) override {
58 if (!got_downloads_) 56 if (!got_downloads_)
59 got_downloads_ = !!manager->InProgressCount(); 57 got_downloads_ = !!manager->InProgressCount();
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 NavigateToURLBlockUntilNavigationsComplete( 512 NavigateToURLBlockUntilNavigationsComplete(
515 shell(), 513 shell(),
516 embedded_test_server()->GetURL("/client_redirect.html"), 514 embedded_test_server()->GetURL("/client_redirect.html"),
517 2); 515 2);
518 516
519 EXPECT_TRUE( 517 EXPECT_TRUE(
520 delegate.page_transition() & ui::PAGE_TRANSITION_CLIENT_REDIRECT); 518 delegate.page_transition() & ui::PAGE_TRANSITION_CLIENT_REDIRECT);
521 } 519 }
522 520
523 } // namespace content 521 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/download/drag_download_file_browsertest.cc ('k') | content/browser/plugin_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698