| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/extensions/browser_action_test_util.h" | 5 #include "chrome/browser/extensions/browser_action_test_util.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/mac/bundle_locations.h" | 9 #include "base/mac/bundle_locations.h" |
| 10 #include "base/mac/foundation_util.h" | 10 #include "base/mac/foundation_util.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 BrowserActionTestUtil::~BrowserActionTestUtil() {} | 114 BrowserActionTestUtil::~BrowserActionTestUtil() {} |
| 115 | 115 |
| 116 int BrowserActionTestUtil::NumberOfBrowserActions() { | 116 int BrowserActionTestUtil::NumberOfBrowserActions() { |
| 117 return [GetController(browser_, test_helper_.get()) buttonCount]; | 117 return [GetController(browser_, test_helper_.get()) buttonCount]; |
| 118 } | 118 } |
| 119 | 119 |
| 120 int BrowserActionTestUtil::VisibleBrowserActions() { | 120 int BrowserActionTestUtil::VisibleBrowserActions() { |
| 121 return [GetController(browser_, test_helper_.get()) visibleButtonCount]; | 121 return [GetController(browser_, test_helper_.get()) visibleButtonCount]; |
| 122 } | 122 } |
| 123 | 123 |
| 124 bool BrowserActionTestUtil::IsChevronShowing() { | |
| 125 BrowserActionsController* controller = | |
| 126 GetController(browser_, test_helper_.get()); | |
| 127 // The magic "18" comes from kChevronWidth in browser_actions_controller.mm. | |
| 128 return ![controller chevronIsHidden] && | |
| 129 NSWidth([[controller containerView] animationEndFrame]) >= 18; | |
| 130 } | |
| 131 | |
| 132 void BrowserActionTestUtil::InspectPopup(int index) { | 124 void BrowserActionTestUtil::InspectPopup(int index) { |
| 133 NOTREACHED(); | 125 NOTREACHED(); |
| 134 } | 126 } |
| 135 | 127 |
| 136 bool BrowserActionTestUtil::HasIcon(int index) { | 128 bool BrowserActionTestUtil::HasIcon(int index) { |
| 137 return [GetButton(browser_, test_helper_.get(), index) image] != nil; | 129 return [GetButton(browser_, test_helper_.get(), index) image] != nil; |
| 138 } | 130 } |
| 139 | 131 |
| 140 gfx::Image BrowserActionTestUtil::GetIcon(int index) { | 132 gfx::Image BrowserActionTestUtil::GetIcon(int index) { |
| 141 NSImage* ns_image = [GetButton(browser_, test_helper_.get(), index) image]; | 133 NSImage* ns_image = [GetButton(browser_, test_helper_.get(), index) image]; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 gfx::Size BrowserActionTestUtil::GetMaxPopupSize() { | 206 gfx::Size BrowserActionTestUtil::GetMaxPopupSize() { |
| 215 return gfx::Size(NSSizeToCGSize([ExtensionPopupController maxPopupSize])); | 207 return gfx::Size(NSSizeToCGSize([ExtensionPopupController maxPopupSize])); |
| 216 } | 208 } |
| 217 | 209 |
| 218 BrowserActionTestUtil::BrowserActionTestUtil(Browser* browser, | 210 BrowserActionTestUtil::BrowserActionTestUtil(Browser* browser, |
| 219 BrowserActionTestUtil* main_bar) | 211 BrowserActionTestUtil* main_bar) |
| 220 : browser_(browser), | 212 : browser_(browser), |
| 221 test_helper_(new TestToolbarActionsBarHelperCocoa( | 213 test_helper_(new TestToolbarActionsBarHelperCocoa( |
| 222 browser_, GetController(browser_, main_bar->test_helper_.get()))) { | 214 browser_, GetController(browser_, main_bar->test_helper_.get()))) { |
| 223 } | 215 } |
| OLD | NEW |