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

Unified Diff: chrome/browser/ui/cocoa/extensions/browser_action_test_util_mac.mm

Issue 640423003: Create a cross-platform browsertest for the browser actions bar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/browser/ui/cocoa/extensions/browser_action_test_util_mac.mm
diff --git a/chrome/browser/ui/cocoa/extensions/browser_action_test_util_mac.mm b/chrome/browser/ui/cocoa/extensions/browser_action_test_util_mac.mm
index 89bb4ccd9c38cc2655daf710a083bbb679b43493..a2511fd018d180bbc781e72af678bae6b3604624 100644
--- a/chrome/browser/ui/cocoa/extensions/browser_action_test_util_mac.mm
+++ b/chrome/browser/ui/cocoa/extensions/browser_action_test_util_mac.mm
@@ -9,6 +9,7 @@
#include "chrome/browser/ui/browser.h"
#import "chrome/browser/ui/cocoa/browser_window_cocoa.h"
#import "chrome/browser/ui/cocoa/browser_window_controller.h"
+#import "chrome/browser/ui/cocoa/extensions/browser_action_button.h"
#import "chrome/browser/ui/cocoa/extensions/browser_actions_controller.h"
#import "chrome/browser/ui/cocoa/extensions/extension_popup_controller.h"
#import "chrome/browser/ui/cocoa/info_bubble_window.h"
@@ -26,7 +27,7 @@ BrowserActionsController* GetController(Browser* browser) {
browserActionsController];
}
-NSButton* GetButton(Browser* browser, int index) {
+BrowserActionButton* GetButton(Browser* browser, int index) {
return [GetController(browser) buttonWithIndex:index];
}
@@ -36,6 +37,10 @@ int BrowserActionTestUtil::NumberOfBrowserActions() {
return [GetController(browser_) buttonCount];
}
+int BrowserActionTestUtil::VisibleBrowserActions() {
+ return [GetController(browser_) visibleButtonCount];
+}
+
ExtensionAction* BrowserActionTestUtil::GetExtensionAction(int index) {
NOTREACHED();
return NULL;
@@ -63,6 +68,10 @@ void BrowserActionTestUtil::Press(int index) {
[button performClick:nil];
}
+std::string BrowserActionTestUtil::GetExtensionId(int index) {
+ return [GetButton(browser_, index) extension]->id();
+}
+
std::string BrowserActionTestUtil::GetTooltip(int index) {
NSString* tooltip = [GetButton(browser_, index) toolTip];
return base::SysNSStringToUTF8(tooltip);
@@ -90,10 +99,20 @@ bool BrowserActionTestUtil::HidePopup() {
return !HasPopup();
}
+// static
+void BrowserActionTestUtil::DisableAnimations() {
+}
+
+// static
+void BrowserActionTestUtil::EnableAnimations() {
+}
+
+// static
gfx::Size BrowserActionTestUtil::GetMinPopupSize() {
return gfx::Size(NSSizeToCGSize([ExtensionPopupController minPopupSize]));
}
+// static
gfx::Size BrowserActionTestUtil::GetMaxPopupSize() {
return gfx::Size(NSSizeToCGSize([ExtensionPopupController maxPopupSize]));
}

Powered by Google App Engine
This is Rietveld 408576698