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/test/automation/browser_proxy.h" | 6 #include "chrome/test/automation/browser_proxy.h" |
6 #include "chrome/test/automation/tab_proxy.h" | 7 #include "chrome/test/automation/tab_proxy.h" |
7 #include "chrome/test/automation/window_proxy.h" | 8 #include "chrome/test/automation/window_proxy.h" |
8 #include "chrome/test/ui/ui_test.h" | 9 #include "chrome/test/ui/ui_test.h" |
9 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
10 #include "ui/base/keycodes/keyboard_codes.h" | 11 #include "ui/base/keycodes/keyboard_codes.h" |
11 #include "views/event.h" | 12 #include "views/event.h" |
12 | 13 |
13 // This functionality currently works on Windows and on Linux when | 14 // This functionality currently works on Windows and on Linux when |
14 // toolkit_views is defined (i.e. for Chrome OS). It's not needed | 15 // toolkit_views is defined (i.e. for Chrome OS). It's not needed |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 ASSERT_EQ(tab_count, 2); | 148 ASSERT_EQ(tab_count, 2); |
148 | 149 |
149 int active_tab = 0; | 150 int active_tab = 0; |
150 ASSERT_TRUE(browser->GetActiveTabIndex(&active_tab)); | 151 ASSERT_TRUE(browser->GetActiveTabIndex(&active_tab)); |
151 ASSERT_EQ(active_tab, 1); | 152 ASSERT_EQ(active_tab, 1); |
152 | 153 |
153 scoped_refptr<WindowProxy> window(browser->GetWindow()); | 154 scoped_refptr<WindowProxy> window(browser->GetWindow()); |
154 ASSERT_TRUE(window); | 155 ASSERT_TRUE(window); |
155 ASSERT_TRUE(window->SimulateOSKeyPress( | 156 ASSERT_TRUE(window->SimulateOSKeyPress( |
156 ui::VKEY_TAB, views::Event::EF_CONTROL_DOWN)); | 157 ui::VKEY_TAB, views::Event::EF_CONTROL_DOWN)); |
157 ASSERT_TRUE(browser->WaitForTabToBecomeActive(0, action_max_timeout_ms())); | 158 ASSERT_TRUE(browser->WaitForTabToBecomeActive( |
| 159 0, TestTimeouts::action_max_timeout_ms())); |
158 | 160 |
159 #if !defined(OS_MACOSX) // see BrowserWindowCocoa::GetCommandId | 161 #if !defined(OS_MACOSX) // see BrowserWindowCocoa::GetCommandId |
160 ASSERT_TRUE(browser->ActivateTab(1)); | 162 ASSERT_TRUE(browser->ActivateTab(1)); |
161 ASSERT_TRUE(window->SimulateOSKeyPress( | 163 ASSERT_TRUE(window->SimulateOSKeyPress( |
162 ui::VKEY_F4, views::Event::EF_CONTROL_DOWN)); | 164 ui::VKEY_F4, views::Event::EF_CONTROL_DOWN)); |
163 ASSERT_TRUE(browser->WaitForTabCountToBecome(1)); | 165 ASSERT_TRUE(browser->WaitForTabCountToBecome(1)); |
164 #endif | 166 #endif |
165 } | 167 } |
166 | 168 |
167 } // namespace | 169 } // namespace |
168 | 170 |
169 #endif // defined(TOOLKIT_VIEWS) | 171 #endif // defined(TOOLKIT_VIEWS) |
OLD | NEW |