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

Unified Diff: chrome/test/automation/automation_proxy.cc

Issue 99268: Making CloseWindow and CloseTab automation API... (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
Index: chrome/test/automation/automation_proxy.cc
===================================================================
--- chrome/test/automation/automation_proxy.cc (revision 14951)
+++ chrome/test/automation/automation_proxy.cc (working copy)
@@ -299,6 +299,24 @@
return succeeded;
}
+bool AutomationProxy::GetNormalBrowserWindowCount(int* num_windows) {
+ if (!num_windows) {
+ NOTREACHED();
+ return false;
+ }
+
+ bool succeeded = SendWithTimeout(
+ new AutomationMsg_NormalBrowserWindowCount(0, num_windows),
+ command_execution_timeout_ms(), NULL);
+
+ if (!succeeded) {
+ DLOG(ERROR) << "GetNormalWindowCount did not complete in a timely fashion";
+ return false;
+ }
+
+ return succeeded;
+}
+
bool AutomationProxy::WaitForWindowCountToBecome(int count,
int wait_timeout) {
const TimeTicks start = TimeTicks::Now();
@@ -438,7 +456,6 @@
return new WindowProxy(this, tracker_.get(), handle);
}
-
BrowserProxy* AutomationProxy::GetBrowserWindow(int window_index) {
int handle = 0;
@@ -456,6 +473,21 @@
return new BrowserProxy(this, tracker_.get(), handle);
}
+BrowserProxy* AutomationProxy::FindNormalBrowserWindow() {
+ int handle = 0;
+
+ if (!SendWithTimeout(new AutomationMsg_FindNormalBrowserWindow(0, &handle),
+ command_execution_timeout_ms(), NULL)) {
+ return NULL;
+ }
+
+ if (handle == 0) {
+ return NULL;
+ }
+
+ return new BrowserProxy(this, tracker_.get(), handle);
+}
+
BrowserProxy* AutomationProxy::GetLastActiveBrowserWindow() {
int handle = 0;

Powered by Google App Engine
This is Rietveld 408576698