OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/stringprintf.h" | 6 #include "base/stringprintf.h" |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/autocomplete/autocomplete_edit_view.h" | 8 #include "chrome/browser/autocomplete/autocomplete_edit_view.h" |
9 #include "chrome/browser/browser_list.h" | 9 #include "chrome/browser/browser_list.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 TabContents* preview_; | 155 TabContents* preview_; |
156 }; | 156 }; |
157 | 157 |
158 // TODO(tonyg): Add the following tests: | 158 // TODO(tonyg): Add the following tests: |
159 // 1. Test that setSuggestions() works. | 159 // 1. Test that setSuggestions() works. |
160 // 2. Test that the search box API is not populated for pages other than the | 160 // 2. Test that the search box API is not populated for pages other than the |
161 // default search provider. | 161 // default search provider. |
162 // 3. Test resize events. | 162 // 3. Test resize events. |
163 | 163 |
164 #if defined(OS_WIN) | 164 #if defined(OS_WIN) |
165 // Disabled, http://crbug.com/62940. | 165 #define MAYBE_OnChangeEvent OnChangeEvent |
166 #define MAYBE_OnChangeEvent DISABLED_OnChangeEvent | |
167 #else | 166 #else |
168 #define MAYBE_OnChangeEvent DISABLED_OnChangeEvent | 167 #define MAYBE_OnChangeEvent DISABLED_OnChangeEvent |
169 #endif | 168 #endif |
170 // Verify that the onchange event is dispatched upon typing in the box. | 169 // Verify that the onchange event is dispatched upon typing in the box. |
171 IN_PROC_BROWSER_TEST_F(InstantTest, MAYBE_OnChangeEvent) { | 170 IN_PROC_BROWSER_TEST_F(InstantTest, MAYBE_OnChangeEvent) { |
172 ASSERT_TRUE(test_server()->Start()); | 171 ASSERT_TRUE(test_server()->Start()); |
173 ASSERT_NO_FATAL_FAILURE(SetupInstantProvider("search.html")); | 172 ASSERT_NO_FATAL_FAILURE(SetupInstantProvider("search.html")); |
174 ASSERT_NO_FATAL_FAILURE(SetupLocationBar()); | 173 ASSERT_NO_FATAL_FAILURE(SetupLocationBar()); |
175 ASSERT_NO_FATAL_FAILURE(SetupPreview()); | 174 ASSERT_NO_FATAL_FAILURE(SetupPreview()); |
176 | 175 |
177 ASSERT_NO_FATAL_FAILURE(SetLocationBarText(L"abc")); | 176 ASSERT_NO_FATAL_FAILURE(SetLocationBarText(L"abc")); |
178 | 177 |
179 // Check that the value is reflected and onchange is called. | 178 // Check that the value is reflected and onchange is called. |
180 EXPECT_NO_FATAL_FAILURE(CheckStringValueFromJavascript( | 179 EXPECT_NO_FATAL_FAILURE(CheckStringValueFromJavascript( |
181 "abc", "window.chrome.searchBox.value", preview_)); | 180 "abc", "window.chrome.searchBox.value", preview_)); |
182 EXPECT_NO_FATAL_FAILURE(CheckBoolValueFromJavascript( | 181 EXPECT_NO_FATAL_FAILURE(CheckBoolValueFromJavascript( |
183 false, "window.chrome.searchBox.verbatim", preview_)); | 182 false, "window.chrome.searchBox.verbatim", preview_)); |
184 EXPECT_NO_FATAL_FAILURE(CheckIntValueFromJavascript( | 183 EXPECT_NO_FATAL_FAILURE(CheckIntValueFromJavascript( |
185 1, "window.onchangecalls", preview_)); | 184 1, "window.onchangecalls", preview_)); |
186 } | 185 } |
187 | 186 |
188 #if defined(OS_WIN) | 187 #if defined(OS_WIN) |
189 #define MAYBE_OnSubmitEvent OnSubmitEvent | 188 // Disabled, http://crbug.com/62940. |
| 189 #define MAYBE_OnSubmitEvent DISABLED_OnSubmitEvent |
190 #else | 190 #else |
191 #define MAYBE_OnSubmitEvent DISABLED_OnSubmitEvent | 191 #define MAYBE_OnSubmitEvent DISABLED_OnSubmitEvent |
192 #endif | 192 #endif |
193 // Verify that the onsubmit event is dispatched upon pressing enter. | 193 // Verify that the onsubmit event is dispatched upon pressing enter. |
194 IN_PROC_BROWSER_TEST_F(InstantTest, MAYBE_OnSubmitEvent) { | 194 IN_PROC_BROWSER_TEST_F(InstantTest, MAYBE_OnSubmitEvent) { |
195 ASSERT_TRUE(test_server()->Start()); | 195 ASSERT_TRUE(test_server()->Start()); |
196 ASSERT_NO_FATAL_FAILURE(SetupInstantProvider("search.html")); | 196 ASSERT_NO_FATAL_FAILURE(SetupInstantProvider("search.html")); |
197 ASSERT_NO_FATAL_FAILURE(SetupLocationBar()); | 197 ASSERT_NO_FATAL_FAILURE(SetupLocationBar()); |
198 ASSERT_NO_FATAL_FAILURE(SetupPreview()); | 198 ASSERT_NO_FATAL_FAILURE(SetupPreview()); |
199 | 199 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 // Check that the value is reflected and oncancel is called. | 240 // Check that the value is reflected and oncancel is called. |
241 EXPECT_NO_FATAL_FAILURE(CheckBoolValueFromJavascript( | 241 EXPECT_NO_FATAL_FAILURE(CheckBoolValueFromJavascript( |
242 true, "window.chrome.sv", contents)); | 242 true, "window.chrome.sv", contents)); |
243 EXPECT_NO_FATAL_FAILURE(CheckStringValueFromJavascript( | 243 EXPECT_NO_FATAL_FAILURE(CheckStringValueFromJavascript( |
244 "abc", "window.chrome.searchBox.value", contents)); | 244 "abc", "window.chrome.searchBox.value", contents)); |
245 EXPECT_NO_FATAL_FAILURE(CheckBoolValueFromJavascript( | 245 EXPECT_NO_FATAL_FAILURE(CheckBoolValueFromJavascript( |
246 false, "window.chrome.searchBox.verbatim", contents)); | 246 false, "window.chrome.searchBox.verbatim", contents)); |
247 EXPECT_NO_FATAL_FAILURE(CheckIntValueFromJavascript( | 247 EXPECT_NO_FATAL_FAILURE(CheckIntValueFromJavascript( |
248 1, "window.oncancelcalls", contents)); | 248 1, "window.oncancelcalls", contents)); |
249 } | 249 } |
OLD | NEW |