| 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/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/prefs/pref_service.h" | 6 #include "base/prefs/pref_service.h" |
| 7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| 11 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 11 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 12 #include "chrome/common/chrome_switches.h" | 12 #include "chrome/common/chrome_switches.h" |
| 13 #include "chrome/test/base/in_process_browser_test.h" | 13 #include "chrome/test/base/in_process_browser_test.h" |
| 14 #include "chrome/test/base/ui_test_utils.h" | 14 #include "chrome/test/base/ui_test_utils.h" |
| 15 #include "components/google/core/browser/google_switches.h" | 15 #include "components/google/core/browser/google_switches.h" |
| 16 #include "components/search_engines/search_engines_pref_names.h" | 16 #include "components/search_engines/search_engines_pref_names.h" |
| 17 #include "content/public/browser/web_contents.h" | 17 #include "content/public/browser/web_contents.h" |
| 18 #include "content/public/common/url_constants.h" | 18 #include "content/public/common/url_constants.h" |
| 19 #include "content/public/test/browser_test_utils.h" | 19 #include "content/public/test/browser_test_utils.h" |
| 20 #include "net/test/spawned_test_server/spawned_test_server.h" | 20 #include "net/test/spawned_test_server/spawned_test_server.h" |
| 21 | 21 |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 struct IsSearchProviderTestData { | 24 struct IsSearchProviderTestData { |
| 25 IsSearchProviderTestData() : tab(NULL) {} | 25 IsSearchProviderTestData() : tab(NULL) {} |
| 26 IsSearchProviderTestData(content::WebContents* t, std::string h, GURL url) | 26 IsSearchProviderTestData(content::WebContents* t, |
| 27 : tab(t), host(h), test_url(url) { | 27 const std::string& h, |
| 28 } | 28 GURL url) |
| 29 : tab(t), host(h), test_url(url) {} |
| 29 | 30 |
| 30 content::WebContents* tab; | 31 content::WebContents* tab; |
| 31 std::string host; | 32 std::string host; |
| 32 GURL test_url; | 33 GURL test_url; |
| 33 }; | 34 }; |
| 34 | 35 |
| 35 } // namespace | 36 } // namespace |
| 36 | 37 |
| 37 class SearchProviderTest : public InProcessBrowserTest { | 38 class SearchProviderTest : public InProcessBrowserTest { |
| 38 protected: | 39 protected: |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 IN_PROC_BROWSER_TEST_F(SearchProviderTest, | 152 IN_PROC_BROWSER_TEST_F(SearchProviderTest, |
| 152 TestIsSearchProviderInstalledWithException) { | 153 TestIsSearchProviderInstalledWithException) { |
| 153 // Change the url for the test page to one that throws an exception when | 154 // Change the url for the test page to one that throws an exception when |
| 154 // toString is called on the argument given to isSearchProviderInstalled. | 155 // toString is called on the argument given to isSearchProviderInstalled. |
| 155 search_provider_test_url_ = test_server()->GetURL( | 156 search_provider_test_url_ = test_server()->GetURL( |
| 156 "files/is_search_provider_installed_with_exception.html"); | 157 "files/is_search_provider_installed_with_exception.html"); |
| 157 | 158 |
| 158 FinishIsSearchProviderInstalledTest(StartIsSearchProviderInstalledTest( | 159 FinishIsSearchProviderInstalledTest(StartIsSearchProviderInstalledTest( |
| 159 browser(), "www.google.com", "")); | 160 browser(), "www.google.com", "")); |
| 160 } | 161 } |
| OLD | NEW |