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

Unified Diff: chrome/browser/errorpage_browsertest.cc

Issue 896943002: Use UIThreadSearchTermsData to get the Google base URL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Compile fixes 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/android/logo_service.cc ('k') | chrome/browser/google/google_profile_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/errorpage_browsertest.cc
diff --git a/chrome/browser/errorpage_browsertest.cc b/chrome/browser/errorpage_browsertest.cc
index 289898ba331654b0b36de87b250d5711f87d3738..6c4708af8908d112f60e780c2325077775fd0069 100644
--- a/chrome/browser/errorpage_browsertest.cc
+++ b/chrome/browser/errorpage_browsertest.cc
@@ -15,9 +15,9 @@
#include "base/synchronization/lock.h"
#include "chrome/browser/browsing_data/browsing_data_helper.h"
#include "chrome/browser/browsing_data/browsing_data_remover.h"
-#include "chrome/browser/google/google_profile_helper.h"
#include "chrome/browser/net/url_request_mock_util.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/search_engines/ui_thread_search_terms_data.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
@@ -279,10 +279,11 @@ void InstallMockInterceptors(
// Add a mock for the search engine the error page will use.
base::FilePath root_http;
PathService::Get(chrome::DIR_TEST_DATA, &root_http);
- net::URLRequestMockHTTPJob::AddHostnameToFileHandler(
- search_url.host(),
- root_http.AppendASCII("title3.html"),
- BrowserThread::GetBlockingPool());
+ net::URLRequestFilter::GetInstance()->AddHostnameInterceptor(
+ search_url.scheme(), search_url.host(),
+ net::URLRequestMockHTTPJob::CreateInterceptorForSingleFile(
+ root_http.AppendASCII("title3.html"),
+ BrowserThread::GetBlockingPool()));
}
class ErrorPageTest : public InProcessBrowserTest {
@@ -412,12 +413,11 @@ class ErrorPageTest : public InProcessBrowserTest {
// Ownership of the |interceptor_| is passed to an object the IO thread, but
// a pointer is kept in the test fixture. As soon as anything calls
// URLRequestFilter::ClearHandlers(), |interceptor_| can become invalid.
+ UIThreadSearchTermsData search_terms_data(browser()->profile());
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
base::Bind(&InstallMockInterceptors,
- google_util::GetGoogleSearchURL(
- google_profile_helper::GetGoogleHomePageURL(
- browser()->profile())),
+ GURL(search_terms_data.GoogleBaseURLValue()),
base::Passed(&owned_interceptor)));
}
« no previous file with comments | « chrome/browser/android/logo_service.cc ('k') | chrome/browser/google/google_profile_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698