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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
12 #include "base/prefs/pref_service.h" | 12 #include "base/prefs/pref_service.h" |
13 #include "base/strings/stringprintf.h" | 13 #include "base/strings/stringprintf.h" |
14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
15 #include "base/synchronization/lock.h" | 15 #include "base/synchronization/lock.h" |
16 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 16 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
17 #include "chrome/browser/browsing_data/browsing_data_remover.h" | 17 #include "chrome/browser/browsing_data/browsing_data_remover.h" |
| 18 #include "chrome/browser/google/google_profile_helper.h" |
18 #include "chrome/browser/google/google_util.h" | 19 #include "chrome/browser/google/google_util.h" |
19 #include "chrome/browser/net/url_request_mock_util.h" | 20 #include "chrome/browser/net/url_request_mock_util.h" |
20 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
21 #include "chrome/browser/ui/browser.h" | 22 #include "chrome/browser/ui/browser.h" |
22 #include "chrome/browser/ui/browser_commands.h" | 23 #include "chrome/browser/ui/browser_commands.h" |
23 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 24 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
24 #include "chrome/common/chrome_paths.h" | 25 #include "chrome/common/chrome_paths.h" |
25 #include "chrome/common/chrome_switches.h" | 26 #include "chrome/common/chrome_switches.h" |
26 #include "chrome/common/pref_names.h" | 27 #include "chrome/common/pref_names.h" |
27 #include "chrome/test/base/in_process_browser_test.h" | 28 #include "chrome/test/base/in_process_browser_test.h" |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 protected: | 408 protected: |
408 virtual void SetUpOnMainThread() OVERRIDE { | 409 virtual void SetUpOnMainThread() OVERRIDE { |
409 link_doctor_handler_ = new LinkDoctorProtocolHandler(); | 410 link_doctor_handler_ = new LinkDoctorProtocolHandler(); |
410 scoped_ptr<URLRequestJobFactory::ProtocolHandler> owned_handler( | 411 scoped_ptr<URLRequestJobFactory::ProtocolHandler> owned_handler( |
411 link_doctor_handler_); | 412 link_doctor_handler_); |
412 // Ownership of the |protocol_handler_| is passed to an object the IO | 413 // Ownership of the |protocol_handler_| is passed to an object the IO |
413 // thread, but a pointer is kept in the test fixture. As soon as anything | 414 // thread, but a pointer is kept in the test fixture. As soon as anything |
414 // calls URLRequestFilter::ClearHandlers(), |protocol_handler_| can become | 415 // calls URLRequestFilter::ClearHandlers(), |protocol_handler_| can become |
415 // invalid. | 416 // invalid. |
416 BrowserThread::PostTask( | 417 BrowserThread::PostTask( |
417 BrowserThread::IO, FROM_HERE, | 418 BrowserThread::IO, |
| 419 FROM_HERE, |
418 base::Bind(&InstallMockProtocolHandlers, | 420 base::Bind(&InstallMockProtocolHandlers, |
419 google_util::GetGoogleSearchURL(browser()->profile()), | 421 google_util::GetGoogleSearchURL( |
| 422 google_profile_helper::GetGoogleHomePageURL( |
| 423 browser()->profile())), |
420 base::Passed(&owned_handler))); | 424 base::Passed(&owned_handler))); |
421 } | 425 } |
422 | 426 |
423 // Returns a GURL that results in a DNS error. | 427 // Returns a GURL that results in a DNS error. |
424 GURL GetDnsErrorURL() const { | 428 GURL GetDnsErrorURL() const { |
425 return URLRequestFailedJob::GetMockHttpUrl(net::ERR_NAME_NOT_RESOLVED); | 429 return URLRequestFailedJob::GetMockHttpUrl(net::ERR_NAME_NOT_RESOLVED); |
426 } | 430 } |
427 | 431 |
428 private: | 432 private: |
429 // Navigates the browser the indicated direction in the history and waits for | 433 // Navigates the browser the indicated direction in the history and waits for |
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1103 browser(), | 1107 browser(), |
1104 URLRequestFailedJob::GetMockHttpUrlForHostname(net::ERR_UNSAFE_PORT, | 1108 URLRequestFailedJob::GetMockHttpUrlForHostname(net::ERR_UNSAFE_PORT, |
1105 kHostname), | 1109 kHostname), |
1106 1); | 1110 1); |
1107 | 1111 |
1108 ToggleHelpBox(browser()); | 1112 ToggleHelpBox(browser()); |
1109 EXPECT_TRUE(IsDisplayingText(browser(), kHostnameJSUnicode)); | 1113 EXPECT_TRUE(IsDisplayingText(browser(), kHostnameJSUnicode)); |
1110 } | 1114 } |
1111 | 1115 |
1112 } // namespace | 1116 } // namespace |
OLD | NEW |