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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 std::string cookie_name = data.host + "testResult"; | 113 std::string cookie_name = data.host + "testResult"; |
114 std::string escaped_value = | 114 std::string escaped_value = |
115 WaitUntilCookieNonEmpty(data.tab, | 115 WaitUntilCookieNonEmpty(data.tab, |
116 data.test_url, | 116 data.test_url, |
117 cookie_name.c_str(), | 117 cookie_name.c_str(), |
118 TestTimeouts::action_max_timeout_ms()); | 118 TestTimeouts::action_max_timeout_ms()); |
119 | 119 |
120 // Unescapes and normalizes the actual result. | 120 // Unescapes and normalizes the actual result. |
121 std::string value = net::UnescapeURLComponent( | 121 std::string value = net::UnescapeURLComponent( |
122 escaped_value, | 122 escaped_value, |
123 UnescapeRule::NORMAL | UnescapeRule::SPACES | | 123 net::UnescapeRule::NORMAL | net::UnescapeRule::SPACES | |
124 UnescapeRule::URL_SPECIAL_CHARS | UnescapeRule::CONTROL_CHARS); | 124 net::UnescapeRule::URL_SPECIAL_CHARS | net::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 // Flaky on XP debug. http://crbug.com/62777 | 131 // Flaky on XP debug. http://crbug.com/62777 |
132 #if defined(OS_WIN) | 132 #if defined(OS_WIN) |
133 #define MAYBE_TestIsSearchProviderInstalled FLAKY_TestIsSearchProviderInstalled | 133 #define MAYBE_TestIsSearchProviderInstalled FLAKY_TestIsSearchProviderInstalled |
134 #else | 134 #else |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 TEST_F(SearchProviderTest, TestIsSearchProviderInstalledWithException) { | 186 TEST_F(SearchProviderTest, TestIsSearchProviderInstalledWithException) { |
187 // 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 |
188 // toString is called on the argument given to isSearchProviderInstalled. | 188 // toString is called on the argument given to isSearchProviderInstalled. |
189 search_provider_test_url_ = test_server_.GetURL( | 189 search_provider_test_url_ = test_server_.GetURL( |
190 "files/is_search_provider_installed_with_exception.html"); | 190 "files/is_search_provider_installed_with_exception.html"); |
191 | 191 |
192 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); | 192 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); |
193 FinishIsSearchProviderInstalledTest(StartIsSearchProviderInstalledTest( | 193 FinishIsSearchProviderInstalledTest(StartIsSearchProviderInstalledTest( |
194 browser, "www.google.com", "")); | 194 browser, "www.google.com", "")); |
195 } | 195 } |
OLD | NEW |