OLD | NEW |
1 // Copyright (c) 2010 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/test/test_timeouts.h" |
5 #include "chrome/app/chrome_command_ids.h" | 6 #include "chrome/app/chrome_command_ids.h" |
6 #include "chrome/common/chrome_switches.h" | 7 #include "chrome/common/chrome_switches.h" |
7 #include "chrome/common/url_constants.h" | 8 #include "chrome/common/url_constants.h" |
8 #include "chrome/test/automation/tab_proxy.h" | 9 #include "chrome/test/automation/tab_proxy.h" |
9 #include "chrome/test/ui/ui_layout_test.h" | 10 #include "chrome/test/ui/ui_layout_test.h" |
10 #include "chrome/test/ui_test_utils.h" | 11 #include "chrome/test/ui_test_utils.h" |
11 #include "net/base/escape.h" | 12 #include "net/base/escape.h" |
12 #include "net/test/test_server.h" | 13 #include "net/test/test_server.h" |
13 | 14 |
14 struct IsSearchProviderTestData; | 15 struct IsSearchProviderTestData; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // Bundle up information needed to verify the result. | 101 // Bundle up information needed to verify the result. |
101 return IsSearchProviderTestData(tab, host, test_url); | 102 return IsSearchProviderTestData(tab, host, test_url); |
102 } | 103 } |
103 | 104 |
104 void SearchProviderTest::FinishIsSearchProviderInstalledTest( | 105 void SearchProviderTest::FinishIsSearchProviderInstalledTest( |
105 const IsSearchProviderTestData& data) { | 106 const IsSearchProviderTestData& data) { |
106 ASSERT_TRUE(data.tab.get()); | 107 ASSERT_TRUE(data.tab.get()); |
107 | 108 |
108 std::string cookie_name = data.host + "testResult"; | 109 std::string cookie_name = data.host + "testResult"; |
109 std::string escaped_value = | 110 std::string escaped_value = |
110 WaitUntilCookieNonEmpty(data.tab, data.test_url, | 111 WaitUntilCookieNonEmpty(data.tab, |
111 cookie_name.c_str(), action_max_timeout_ms()); | 112 data.test_url, |
| 113 cookie_name.c_str(), |
| 114 TestTimeouts::action_max_timeout_ms()); |
112 | 115 |
113 // Unescapes and normalizes the actual result. | 116 // Unescapes and normalizes the actual result. |
114 std::string value = UnescapeURLComponent( | 117 std::string value = UnescapeURLComponent( |
115 escaped_value, | 118 escaped_value, |
116 UnescapeRule::NORMAL | UnescapeRule::SPACES | | 119 UnescapeRule::NORMAL | UnescapeRule::SPACES | |
117 UnescapeRule::URL_SPECIAL_CHARS | UnescapeRule::CONTROL_CHARS); | 120 UnescapeRule::URL_SPECIAL_CHARS | UnescapeRule::CONTROL_CHARS); |
118 value += "\n"; | 121 value += "\n"; |
119 ReplaceSubstringsAfterOffset(&value, 0, "\r", ""); | 122 ReplaceSubstringsAfterOffset(&value, 0, "\r", ""); |
120 EXPECT_STREQ("1\n", value.c_str()); | 123 EXPECT_STREQ("1\n", value.c_str()); |
121 } | 124 } |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 #if 0 | 165 #if 0 |
163 // Remove the calls to FinishIsSearchProviderInstalledTest above when | 166 // Remove the calls to FinishIsSearchProviderInstalledTest above when |
164 // re-enabling this code. | 167 // re-enabling this code. |
165 | 168 |
166 // Do the verification. | 169 // Do the verification. |
167 for (size_t i = 0; i < arraysize(test_data); ++i) { | 170 for (size_t i = 0; i < arraysize(test_data); ++i) { |
168 FinishIsSearchProviderInstalledTest(test_data[i]); | 171 FinishIsSearchProviderInstalledTest(test_data[i]); |
169 } | 172 } |
170 #endif | 173 #endif |
171 } | 174 } |
OLD | NEW |