diff options
author | kkania@chromium.org <kkania@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-19 01:27:51 +0000 |
---|---|---|
committer | kkania@chromium.org <kkania@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-19 01:27:51 +0000 |
commit | 73333786fdb1f3b9fb5b4a8d2afda653b0e648c2 (patch) | |
tree | aaede316d84f6264dc705b1577031895fa065941 /chrome/browser/extensions/browser_action_test_util_mac.mm | |
parent | 098267f02562f5636c4e7dd6fc4c52175862cf94 (diff) | |
download | chromium_src-73333786fdb1f3b9fb5b4a8d2afda653b0e648c2.zip chromium_src-73333786fdb1f3b9fb5b4a8d2afda653b0e648c2.tar.gz chromium_src-73333786fdb1f3b9fb5b4a8d2afda653b0e648c2.tar.bz2 |
[Mac] Port browser action popup test to mac.
BUG=29710
TEST=none
Review URL: http://codereview.chromium.org/506069
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35020 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/browser_action_test_util_mac.mm')
-rw-r--r-- | chrome/browser/extensions/browser_action_test_util_mac.mm | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/chrome/browser/extensions/browser_action_test_util_mac.mm b/chrome/browser/extensions/browser_action_test_util_mac.mm index de17e8e..1ce7011 100644 --- a/chrome/browser/extensions/browser_action_test_util_mac.mm +++ b/chrome/browser/extensions/browser_action_test_util_mac.mm @@ -4,11 +4,14 @@ #include "browser_action_test_util.h" +#include "base/gfx/rect.h" +#include "base/gfx/size.h" #include "base/sys_string_conversions.h" #include "chrome/browser/browser.h" #import "chrome/browser/cocoa/browser_window_cocoa.h" #import "chrome/browser/cocoa/browser_window_controller.h" #import "chrome/browser/cocoa/extensions/browser_actions_controller.h" +#import "chrome/browser/cocoa/extensions/extension_popup_controller.h" #import "chrome/browser/cocoa/toolbar_controller.h" namespace { @@ -44,3 +47,25 @@ std::string BrowserActionTestUtil::GetTooltip(int index) { NSString* tooltip = [GetButton(browser_, index) toolTip]; return base::SysNSStringToUTF8(tooltip); } + +bool BrowserActionTestUtil::HasPopup() { + return [GetController(browser_) popup] != nil; +} + +gfx::Rect BrowserActionTestUtil::GetPopupBounds() { + NSRect bounds = [[[GetController(browser_) popup] view] bounds]; + return gfx::Rect(NSRectToCGRect(bounds)); +} + +bool BrowserActionTestUtil::HidePopup() { + [GetController(browser_) hidePopup]; + return !HasPopup(); +} + +gfx::Size BrowserActionTestUtil::GetMinPopupSize() { + return gfx::Size(NSSizeToCGSize([ExtensionPopupController minPopupSize])); +} + +gfx::Size BrowserActionTestUtil::GetMaxPopupSize() { + return gfx::Size(NSSizeToCGSize([ExtensionPopupController maxPopupSize])); +} |