OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/app/chrome_dll_resource.h" | 5 #include "chrome/app/chrome_dll_resource.h" |
6 #include "chrome/browser/view_ids.h" | 6 #include "chrome/browser/view_ids.h" |
7 #include "chrome/test/automated_ui_tests/automated_ui_test_base.h" | 7 #include "chrome/test/automated_ui_tests/automated_ui_test_base.h" |
8 #include "chrome/test/automation/browser_proxy.h" | 8 #include "chrome/test/automation/browser_proxy.h" |
9 #include "chrome/test/automation/tab_proxy.h" | 9 #include "chrome/test/automation/tab_proxy.h" |
10 #include "chrome/test/automation/window_proxy.h" | 10 #include "chrome/test/automation/window_proxy.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 return false; | 74 return false; |
75 } | 75 } |
76 set_active_browser(browser); | 76 set_active_browser(browser); |
77 return true; | 77 return true; |
78 } | 78 } |
79 | 79 |
80 bool AutomatedUITestBase::DuplicateTab() { | 80 bool AutomatedUITestBase::DuplicateTab() { |
81 return RunCommand(IDC_DUPLICATE_TAB); | 81 return RunCommand(IDC_DUPLICATE_TAB); |
82 } | 82 } |
83 | 83 |
| 84 #if defined(OS_WIN) |
84 bool AutomatedUITestBase::DragTabOut() { | 85 bool AutomatedUITestBase::DragTabOut() { |
85 BrowserProxy* browser = active_browser(); | 86 BrowserProxy* browser = active_browser(); |
86 if (browser == NULL) { | 87 if (browser == NULL) { |
87 LogErrorMessage("browser_window_not_found"); | 88 LogErrorMessage("browser_window_not_found"); |
88 return false; | 89 return false; |
89 } | 90 } |
90 | 91 |
91 scoped_refptr<WindowProxy> window( | 92 scoped_refptr<WindowProxy> window( |
92 GetAndActivateWindowForBrowser(browser)); | 93 GetAndActivateWindowForBrowser(browser)); |
93 if (window.get() == NULL) { | 94 if (window.get() == NULL) { |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 return false; | 229 return false; |
229 } | 230 } |
230 | 231 |
231 if (!browser->WaitForTabToBecomeActive(new_tab_index, action_timeout_ms())) { | 232 if (!browser->WaitForTabToBecomeActive(new_tab_index, action_timeout_ms())) { |
232 LogWarningMessage("failed_to_reindex_tab"); | 233 LogWarningMessage("failed_to_reindex_tab"); |
233 return false; | 234 return false; |
234 } | 235 } |
235 | 236 |
236 return true; | 237 return true; |
237 } | 238 } |
| 239 #endif |
238 | 240 |
239 bool AutomatedUITestBase::ForwardButton() { | 241 bool AutomatedUITestBase::ForwardButton() { |
240 return RunCommand(IDC_FORWARD); | 242 return RunCommand(IDC_FORWARD); |
241 } | 243 } |
242 | 244 |
243 bool AutomatedUITestBase::GoOffTheRecord() { | 245 bool AutomatedUITestBase::GoOffTheRecord() { |
244 return RunCommand(IDC_NEW_INCOGNITO_WINDOW); | 246 return RunCommand(IDC_NEW_INCOGNITO_WINDOW); |
245 } | 247 } |
246 | 248 |
247 bool AutomatedUITestBase::OpenAndActivateNewBrowserWindow( | 249 bool AutomatedUITestBase::OpenAndActivateNewBrowserWindow( |
248 scoped_refptr<BrowserProxy>* previous_browser) { | 250 scoped_refptr<BrowserProxy>* previous_browser) { |
249 if (!automation()->OpenNewBrowserWindow(SW_SHOWNORMAL)) { | 251 if (!automation()->OpenNewBrowserWindow(true /* SW_SHOWNORMAL */)) { |
250 LogWarningMessage("failed_to_open_new_browser_window"); | 252 LogWarningMessage("failed_to_open_new_browser_window"); |
251 return false; | 253 return false; |
252 } | 254 } |
253 int num_browser_windows; | 255 int num_browser_windows; |
254 automation()->GetBrowserWindowCount(&num_browser_windows); | 256 automation()->GetBrowserWindowCount(&num_browser_windows); |
255 // Get the most recently opened browser window and activate the tab | 257 // Get the most recently opened browser window and activate the tab |
256 // in order to activate this browser window. | 258 // in order to activate this browser window. |
257 scoped_refptr<BrowserProxy> browser( | 259 scoped_refptr<BrowserProxy> browser( |
258 automation()->GetBrowserWindow(num_browser_windows - 1)); | 260 automation()->GetBrowserWindow(num_browser_windows - 1)); |
259 if (browser.get() == NULL) { | 261 if (browser.get() == NULL) { |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 BrowserProxy* browser) { | 357 BrowserProxy* browser) { |
356 bool did_timeout; | 358 bool did_timeout; |
357 if (!browser->BringToFrontWithTimeout(action_max_timeout_ms(), | 359 if (!browser->BringToFrontWithTimeout(action_max_timeout_ms(), |
358 &did_timeout)) { | 360 &did_timeout)) { |
359 LogWarningMessage("failed_to_bring_window_to_front"); | 361 LogWarningMessage("failed_to_bring_window_to_front"); |
360 return NULL; | 362 return NULL; |
361 } | 363 } |
362 | 364 |
363 return browser->GetWindow(); | 365 return browser->GetWindow(); |
364 } | 366 } |
OLD | NEW |