Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(957)

Unified Diff: chrome/test/automated_ui_tests/automated_ui_tests.cc

Issue 67139: Remove the usage of GetLastActiveBrowserWindow... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/automated_ui_tests/automated_ui_test_base.cc ('k') | chrome/test/automation/automation_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/automated_ui_tests/automated_ui_tests.cc
===================================================================
--- chrome/test/automated_ui_tests/automated_ui_tests.cc (revision 13620)
+++ chrome/test/automated_ui_tests/automated_ui_tests.cc (working copy)
@@ -340,6 +340,7 @@
did_complete_action = ShowBookmarkBar();
} else if (LowerCaseEqualsASCII(action, "setup")) {
LaunchBrowserAndServer();
+ set_active_browser(automation()->GetBrowserWindow(0));
Finnur 2009/04/14 20:22:14 Do you need a release_active_browser somewhere?
huanr 2009/04/14 20:58:26 set_active_browser() calls active_browser_.reset()
did_complete_action = true;
} else if (LowerCaseEqualsASCII(action, "sleep")) {
// This is for debugging, it probably shouldn't be used real tests.
@@ -417,8 +418,8 @@
bool AutomatedUITest::CloseActiveTab() {
bool return_value = false;
- scoped_ptr<BrowserProxy> browser(automation()->GetLastActiveBrowserWindow());
- if (browser.get() == NULL) {
+ BrowserProxy* browser = active_browser();
+ if (browser == NULL) {
AddErrorAttribute("browser_window_not_found");
return false;
}
@@ -478,8 +479,8 @@
}
bool AutomatedUITest::Navigate() {
- scoped_ptr<BrowserProxy> browser(automation()->GetLastActiveBrowserWindow());
- if (browser.get() == NULL) {
+ BrowserProxy* browser = active_browser();
+ if (browser == NULL) {
AddErrorAttribute("browser_window_not_found");
return false;
}
@@ -676,8 +677,8 @@
}
bool AutomatedUITest::ForceCrash() {
- scoped_ptr<BrowserProxy> browser(automation()->GetLastActiveBrowserWindow());
- if (browser.get() == NULL) {
+ BrowserProxy* browser = active_browser();
+ if (browser == NULL) {
AddErrorAttribute("browser_window_not_found");
return false;
}
@@ -693,19 +694,20 @@
}
bool AutomatedUITest::DragActiveTab(bool drag_right, bool drag_out) {
- scoped_ptr<BrowserProxy> browser(automation()->GetLastActiveBrowserWindow());
+ BrowserProxy* browser = active_browser();
+ if (browser == NULL) {
+ AddErrorAttribute("browser_window_not_found");
+ return false;
+ }
+
scoped_ptr<WindowProxy> window(
- GetAndActivateWindowForBrowser(browser.get()));
+ GetAndActivateWindowForBrowser(browser));
if (window.get() == NULL) {
AddErrorAttribute("active_window_not_found");
return false;
}
bool is_timeout;
- if (browser.get() == NULL) {
- AddErrorAttribute("browser_window_not_found");
- return false;
- }
int tab_count;
browser->GetTabCountWithTimeout(&tab_count,
action_max_timeout_ms(),
« no previous file with comments | « chrome/test/automated_ui_tests/automated_ui_test_base.cc ('k') | chrome/test/automation/automation_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698