summaryrefslogtreecommitdiffstats
path: root/chrome/test/automation/tab_proxy.cc
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-03 16:44:57 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-03 16:44:57 +0000
commit415ad48ad827f0a88645069f2bb731d497f5f23e (patch)
treea9efe67f99ae4625badca6c19848487e27bc5dad /chrome/test/automation/tab_proxy.cc
parentbd745438c31d1646cfb1e99a419e7b17dc2b90d2 (diff)
downloadchromium_src-415ad48ad827f0a88645069f2bb731d497f5f23e.zip
chromium_src-415ad48ad827f0a88645069f2bb731d497f5f23e.tar.gz
chromium_src-415ad48ad827f0a88645069f2bb731d497f5f23e.tar.bz2
This is the first of probably several patches trying to clean up the BlockedPopupContainer into something that can be cross-platform.
- BlokedPopupContainers are no longer ConstrainedWindows. - There is now a cross platform base class that contains most of the model/controller logic. The view now inherits from it. This is an improvement. Review URL: http://codereview.chromium.org/119006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17483 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/automation/tab_proxy.cc')
-rw-r--r--chrome/test/automation/tab_proxy.cc27
1 files changed, 27 insertions, 0 deletions
diff --git a/chrome/test/automation/tab_proxy.cc b/chrome/test/automation/tab_proxy.cc
index 207efac..55d0dc4 100644
--- a/chrome/test/automation/tab_proxy.cc
+++ b/chrome/test/automation/tab_proxy.cc
@@ -377,6 +377,33 @@ bool TabProxy::WaitForChildWindowCountToChange(int count, int* new_count,
return false;
}
+bool TabProxy::GetBlockedPopupCount(int* count) const {
+ if (!is_valid())
+ return false;
+
+ if (!count) {
+ NOTREACHED();
+ return false;
+ }
+
+ return sender_->Send(new AutomationMsg_BlockedPopupCount(
+ 0, handle_, count));
+}
+
+bool TabProxy::WaitForBlockedPopupCountToChangeTo(int target_count,
+ int wait_timeout) {
+ int intervals = std::min(wait_timeout/automation::kSleepTime, 1);
+ for (int i = 0; i < intervals; ++i) {
+ PlatformThread::Sleep(automation::kSleepTime);
+ int new_count = -1;
+ bool succeeded = GetBlockedPopupCount(&new_count);
+ if (!succeeded) return false;
+ if (target_count == new_count) return true;
+ }
+ // Constrained Window count did not change, return false.
+ return false;
+}
+
bool TabProxy::GetCookies(const GURL& url, std::string* cookies) {
if (!is_valid())
return false;