OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/test/reliability/automated_ui_test_base.h" | 5 #include "chrome/test/reliability/automated_ui_test_base.h" |
6 | 6 |
7 #include "base/test/test_timeouts.h" | 7 #include "base/test/test_timeouts.h" |
8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
9 #include "chrome/browser/ui/view_ids.h" | 9 #include "chrome/browser/ui/view_ids.h" |
10 #include "chrome/test/automation/automation_proxy.h" | 10 #include "chrome/test/automation/automation_proxy.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 bool application_closed; | 67 bool application_closed; |
68 CloseBrowser(active_browser(), &application_closed); | 68 CloseBrowser(active_browser(), &application_closed); |
69 if (application_closed) { | 69 if (application_closed) { |
70 LogErrorMessage("Application closed unexpectedly."); | 70 LogErrorMessage("Application closed unexpectedly."); |
71 return false; | 71 return false; |
72 } | 72 } |
73 for (int i = 0; i < browser_windows_count - 1; ++i) { | 73 for (int i = 0; i < browser_windows_count - 1; ++i) { |
74 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(i)); | 74 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(i)); |
75 Browser::Type type; | 75 Browser::Type type; |
76 if (browser->GetType(&type) && type == Browser::TYPE_TABBED) { | 76 if (browser->GetType(&type) && type == Browser::TYPE_TABBED) { |
77 set_active_browser(browser); | 77 set_active_browser(browser.get()); |
78 return true; | 78 return true; |
79 } | 79 } |
80 } | 80 } |
81 | 81 |
82 LogErrorMessage("Can't find browser window."); | 82 LogErrorMessage("Can't find browser window."); |
83 return false; | 83 return false; |
84 } | 84 } |
85 | 85 |
86 bool AutomatedUITestBase::DuplicateTab() { | 86 bool AutomatedUITestBase::DuplicateTab() { |
87 return RunCommand(IDC_DUPLICATE_TAB); | 87 return RunCommand(IDC_DUPLICATE_TAB); |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 | 225 |
226 scoped_refptr<WindowProxy> AutomatedUITestBase::GetAndActivateWindowForBrowser( | 226 scoped_refptr<WindowProxy> AutomatedUITestBase::GetAndActivateWindowForBrowser( |
227 BrowserProxy* browser) { | 227 BrowserProxy* browser) { |
228 if (!browser->BringToFront()) { | 228 if (!browser->BringToFront()) { |
229 LogWarningMessage("failed_to_bring_window_to_front"); | 229 LogWarningMessage("failed_to_bring_window_to_front"); |
230 return NULL; | 230 return NULL; |
231 } | 231 } |
232 | 232 |
233 return browser->GetWindow(); | 233 return browser->GetWindow(); |
234 } | 234 } |
OLD | NEW |