diff options
Diffstat (limited to 'chrome/test/automation/browser_proxy.cc')
-rw-r--r-- | chrome/test/automation/browser_proxy.cc | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/chrome/test/automation/browser_proxy.cc b/chrome/test/automation/browser_proxy.cc index 6543b26..ad6c8ff 100644 --- a/chrome/test/automation/browser_proxy.cc +++ b/chrome/test/automation/browser_proxy.cc @@ -175,6 +175,39 @@ bool BrowserProxy::GetTabCountWithTimeout(int* num_tabs, uint32 timeout_ms, return succeeded; } +bool BrowserProxy::GetType(Type* type) const { + if (!is_valid()) + return false; + + if (!type) { + NOTREACHED(); + return false; + } + + int type_as_int; + bool succeeded = sender_->SendWithTimeout(new AutomationMsg_Type( + 0, handle_, &type_as_int), base::kNoTimeout, NULL); + + switch (type_as_int) { + case 0: + *type = TYPE_NORMAL; + break; + case 1: + *type = TYPE_POPUP; + break; + case 2: + *type = TYPE_APP; + break; + case 3: + *type = TYPE_APP_POPUP; + break; + default: + return false; + } + + return succeeded; +} + bool BrowserProxy::ApplyAccelerator(int id) { return RunCommandAsync(id); } |