| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/string_util.h" | 5 #include "base/string_util.h" |
| 6 #include "base/test/test_timeouts.h" | 6 #include "base/test/test_timeouts.h" |
| 7 #include "chrome/app/chrome_command_ids.h" | 7 #include "chrome/app/chrome_command_ids.h" |
| 8 #include "chrome/common/chrome_switches.h" | 8 #include "chrome/common/chrome_switches.h" |
| 9 #include "chrome/common/url_constants.h" | 9 #include "chrome/common/url_constants.h" |
| 10 #include "chrome/test/automation/automation_proxy.h" | 10 #include "chrome/test/automation/automation_proxy.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 std::string value = UnescapeURLComponent( | 121 std::string value = UnescapeURLComponent( |
| 122 escaped_value, | 122 escaped_value, |
| 123 UnescapeRule::NORMAL | UnescapeRule::SPACES | | 123 UnescapeRule::NORMAL | UnescapeRule::SPACES | |
| 124 UnescapeRule::URL_SPECIAL_CHARS | UnescapeRule::CONTROL_CHARS); | 124 UnescapeRule::URL_SPECIAL_CHARS | UnescapeRule::CONTROL_CHARS); |
| 125 value += "\n"; | 125 value += "\n"; |
| 126 ReplaceSubstringsAfterOffset(&value, 0, "\r", ""); | 126 ReplaceSubstringsAfterOffset(&value, 0, "\r", ""); |
| 127 EXPECT_STREQ("1\n", value.c_str()); | 127 EXPECT_STREQ("1\n", value.c_str()); |
| 128 EXPECT_TRUE(data.tab->Close(true)); | 128 EXPECT_TRUE(data.tab->Close(true)); |
| 129 } | 129 } |
| 130 | 130 |
| 131 TEST_F(SearchProviderTest, TestIsSearchProviderInstalled) { | 131 // Flaky on XP debug. http://crbug.com/62777 |
| 132 #if defined(OS_WIN) |
| 133 #define MAYBE_TestIsSearchProviderInstalled FLAKY_TestIsSearchProviderInstalled |
| 134 #else |
| 135 #define MAYBE_TestIsSearchProviderInstalled TestIsSearchProviderInstalled |
| 136 #endif |
| 137 TEST_F(SearchProviderTest, MAYBE_TestIsSearchProviderInstalled) { |
| 132 ASSERT_TRUE(test_server_started_); | 138 ASSERT_TRUE(test_server_started_); |
| 133 | 139 |
| 134 // Use the default search provider, other installed search provider, and | 140 // Use the default search provider, other installed search provider, and |
| 135 // one not installed as well. (Note that yahoo isn't tested because the | 141 // one not installed as well. (Note that yahoo isn't tested because the |
| 136 // its host name varies a lot for different locales unlike Google and Bing, | 142 // its host name varies a lot for different locales unlike Google and Bing, |
| 137 // which would make the test fail depending on the machine's locale.) | 143 // which would make the test fail depending on the machine's locale.) |
| 138 const char* test_hosts[] = { "www.google.com", | 144 const char* test_hosts[] = { "www.google.com", |
| 139 "www.bing.com", | 145 "www.bing.com", |
| 140 "localhost" }; | 146 "localhost" }; |
| 141 const char* expected_results[] = { "2", | 147 const char* expected_results[] = { "2", |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 TEST_F(SearchProviderTest, TestIsSearchProviderInstalledWithException) { | 186 TEST_F(SearchProviderTest, TestIsSearchProviderInstalledWithException) { |
| 181 // Change the url for the test page to one that throws an exception when | 187 // Change the url for the test page to one that throws an exception when |
| 182 // toString is called on the argument given to isSearchProviderInstalled. | 188 // toString is called on the argument given to isSearchProviderInstalled. |
| 183 search_provider_test_url_ = test_server_.GetURL( | 189 search_provider_test_url_ = test_server_.GetURL( |
| 184 "files/is_search_provider_installed_with_exception.html"); | 190 "files/is_search_provider_installed_with_exception.html"); |
| 185 | 191 |
| 186 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); | 192 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); |
| 187 FinishIsSearchProviderInstalledTest(StartIsSearchProviderInstalledTest( | 193 FinishIsSearchProviderInstalledTest(StartIsSearchProviderInstalledTest( |
| 188 browser, "www.google.com", "")); | 194 browser, "www.google.com", "")); |
| 189 } | 195 } |
| OLD | NEW |