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

Side by Side Diff: chrome/browser/ui/views/toolbar/browser_action_test_util_views.cc

Issue 2908983002: [reland] Bring up BrowserActionInteractiveTest on Mac. (Closed)
Patch Set: respond to comments Created 3 years, 6 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/cocoa/extensions/browser_action_test_util_mac.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 ->GetTooltipText(gfx::Point(), &text); 160 ->GetTooltipText(gfx::Point(), &text);
161 return base::UTF16ToUTF8(text); 161 return base::UTF16ToUTF8(text);
162 } 162 }
163 163
164 gfx::NativeView BrowserActionTestUtil::GetPopupNativeView() { 164 gfx::NativeView BrowserActionTestUtil::GetPopupNativeView() {
165 ToolbarActionViewController* popup_owner = 165 ToolbarActionViewController* popup_owner =
166 GetToolbarActionsBar()->popup_owner(); 166 GetToolbarActionsBar()->popup_owner();
167 return popup_owner ? popup_owner->GetPopupNativeView() : nullptr; 167 return popup_owner ? popup_owner->GetPopupNativeView() : nullptr;
168 } 168 }
169 169
170 bool BrowserActionTestUtil::WaitForPopup() {
171 // TODO(tapted): Implement this for MacViews.
172 NOTIMPLEMENTED();
173 return HasPopup();
174 }
175
170 bool BrowserActionTestUtil::HasPopup() { 176 bool BrowserActionTestUtil::HasPopup() {
171 return GetPopupNativeView() != nullptr; 177 return GetPopupNativeView() != nullptr;
172 } 178 }
173 179
174 gfx::Size BrowserActionTestUtil::GetPopupSize() { 180 gfx::Size BrowserActionTestUtil::GetPopupSize() {
175 gfx::NativeView popup = GetPopupNativeView(); 181 gfx::NativeView popup = GetPopupNativeView();
176 views::Widget* widget = views::Widget::GetWidgetForNativeView(popup); 182 views::Widget* widget = views::Widget::GetWidgetForNativeView(popup);
177 return widget->GetWindowBoundsInScreen().size(); 183 return widget->GetWindowBoundsInScreen().size();
178 } 184 }
179 185
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 return gfx::Size(ExtensionPopup::kMaxWidth, ExtensionPopup::kMaxHeight); 221 return gfx::Size(ExtensionPopup::kMaxWidth, ExtensionPopup::kMaxHeight);
216 } 222 }
217 223
218 BrowserActionTestUtil::BrowserActionTestUtil(Browser* browser, 224 BrowserActionTestUtil::BrowserActionTestUtil(Browser* browser,
219 BrowserActionTestUtil* main_bar) 225 BrowserActionTestUtil* main_bar)
220 : browser_(browser), 226 : browser_(browser),
221 test_helper_(new TestToolbarActionsBarHelperViews( 227 test_helper_(new TestToolbarActionsBarHelperViews(
222 browser_, 228 browser_,
223 GetContainer(browser_, main_bar->test_helper_.get()))) { 229 GetContainer(browser_, main_bar->test_helper_.get()))) {
224 } 230 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/extensions/browser_action_test_util_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698