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 <stdio.h> | 5 #include <stdio.h> |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/string16.h" | 8 #include "base/string16.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "chrome/browser/ui/browser.h" | 25 #include "chrome/browser/ui/browser.h" |
26 #include "chrome/browser/ui/browser_window.h" | 26 #include "chrome/browser/ui/browser_window.h" |
27 #include "chrome/browser/ui/omnibox/location_bar.h" | 27 #include "chrome/browser/ui/omnibox/location_bar.h" |
28 #include "chrome/browser/ui/omnibox/omnibox_view.h" | 28 #include "chrome/browser/ui/omnibox/omnibox_view.h" |
29 #include "chrome/common/chrome_notification_types.h" | 29 #include "chrome/common/chrome_notification_types.h" |
30 #include "chrome/common/chrome_paths.h" | 30 #include "chrome/common/chrome_paths.h" |
31 #include "chrome/common/url_constants.h" | 31 #include "chrome/common/url_constants.h" |
32 #include "chrome/test/base/in_process_browser_test.h" | 32 #include "chrome/test/base/in_process_browser_test.h" |
33 #include "chrome/test/base/ui_test_utils.h" | 33 #include "chrome/test/base/ui_test_utils.h" |
34 #include "content/browser/tab_contents/tab_contents.h" | 34 #include "content/browser/tab_contents/tab_contents.h" |
35 #include "content/common/notification_service.h" | 35 #include "content/public/browser/notification_service.h" |
36 #include "net/base/mock_host_resolver.h" | 36 #include "net/base/mock_host_resolver.h" |
37 #include "ui/base/events.h" | 37 #include "ui/base/events.h" |
38 #include "ui/base/keycodes/keyboard_codes.h" | 38 #include "ui/base/keycodes/keyboard_codes.h" |
39 | 39 |
40 #if defined(TOOLKIT_USES_GTK) | 40 #if defined(TOOLKIT_USES_GTK) |
41 #include <gdk/gdk.h> | 41 #include <gdk/gdk.h> |
42 #include <gtk/gtk.h> | 42 #include <gtk/gtk.h> |
43 #endif | 43 #endif |
44 | 44 |
45 #if defined(TOOLKIT_VIEWS) | 45 #if defined(TOOLKIT_VIEWS) |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 int expected_tab_count) { | 222 int expected_tab_count) { |
223 int tab_count = browser->tab_count(); | 223 int tab_count = browser->tab_count(); |
224 if (tab_count == expected_tab_count) | 224 if (tab_count == expected_tab_count) |
225 return; | 225 return; |
226 | 226 |
227 content::NotificationRegistrar registrar; | 227 content::NotificationRegistrar registrar; |
228 registrar.Add(this, | 228 registrar.Add(this, |
229 (tab_count < expected_tab_count ? | 229 (tab_count < expected_tab_count ? |
230 content::NOTIFICATION_TAB_PARENTED : | 230 content::NOTIFICATION_TAB_PARENTED : |
231 content::NOTIFICATION_TAB_CLOSED), | 231 content::NOTIFICATION_TAB_CLOSED), |
232 NotificationService::AllSources()); | 232 content::NotificationService::AllSources()); |
233 | 233 |
234 while (!HasFailure() && browser->tab_count() != expected_tab_count) | 234 while (!HasFailure() && browser->tab_count() != expected_tab_count) |
235 ui_test_utils::RunMessageLoop(); | 235 ui_test_utils::RunMessageLoop(); |
236 | 236 |
237 ASSERT_EQ(expected_tab_count, browser->tab_count()); | 237 ASSERT_EQ(expected_tab_count, browser->tab_count()); |
238 } | 238 } |
239 | 239 |
240 void WaitForTabOpenOrClose(int expected_tab_count) { | 240 void WaitForTabOpenOrClose(int expected_tab_count) { |
241 WaitForTabOpenOrCloseForBrowser(browser(), expected_tab_count); | 241 WaitForTabOpenOrCloseForBrowser(browser(), expected_tab_count); |
242 } | 242 } |
(...skipping 1165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1408 PersistKeywordModeOnTabSwitch) { | 1408 PersistKeywordModeOnTabSwitch) { |
1409 PersistKeywordModeOnTabSwitch(); | 1409 PersistKeywordModeOnTabSwitch(); |
1410 } | 1410 } |
1411 | 1411 |
1412 IN_PROC_BROWSER_TEST_F(OmniboxViewViewsTest, | 1412 IN_PROC_BROWSER_TEST_F(OmniboxViewViewsTest, |
1413 CtrlKeyPressedWithInlineAutocompleteTest) { | 1413 CtrlKeyPressedWithInlineAutocompleteTest) { |
1414 CtrlKeyPressedWithInlineAutocompleteTest(); | 1414 CtrlKeyPressedWithInlineAutocompleteTest(); |
1415 } | 1415 } |
1416 | 1416 |
1417 #endif | 1417 #endif |
OLD | NEW |