OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "chrome/browser/extensions/extension_action_test_util.h" | 8 #include "chrome/browser/extensions/extension_action_test_util.h" |
9 #include "chrome/browser/extensions/extension_browsertest.h" | 9 #include "chrome/browser/extensions/extension_browsertest.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
11 #include "chrome/browser/extensions/extension_toolbar_model.h" | 11 #include "chrome/browser/extensions/extension_toolbar_model.h" |
| 12 #include "chrome/browser/ui/browser_window.h" |
12 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 13 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
13 #import "chrome/browser/ui/cocoa/extensions/browser_action_button.h" | 14 #import "chrome/browser/ui/cocoa/extensions/browser_action_button.h" |
14 #import "chrome/browser/ui/cocoa/extensions/browser_actions_container_view.h" | 15 #import "chrome/browser/ui/cocoa/extensions/browser_actions_container_view.h" |
15 #import "chrome/browser/ui/cocoa/extensions/browser_actions_controller.h" | 16 #import "chrome/browser/ui/cocoa/extensions/browser_actions_controller.h" |
16 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" | 17 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" |
17 #import "chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.h" | 18 #import "chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.h" |
18 #include "chrome/browser/ui/browser_window.h" | |
19 #include "chrome/browser/ui/toolbar/toolbar_actions_bar.h" | 19 #include "chrome/browser/ui/toolbar/toolbar_actions_bar.h" |
20 #include "chrome/test/base/interactive_test_utils.h" | 20 #include "chrome/test/base/interactive_test_utils.h" |
21 #include "extensions/common/feature_switch.h" | 21 #include "extensions/common/feature_switch.h" |
22 #import "ui/events/test/cocoa_test_event_utils.h" | 22 #import "ui/events/test/cocoa_test_event_utils.h" |
23 | 23 |
24 namespace { | 24 namespace { |
25 | 25 |
26 // Returns the center point for a particular |view|. | 26 // Returns the center point for a particular |view|. |
27 NSPoint GetCenterPoint(NSView* view) { | 27 NSPoint GetCenterPoint(NSView* view) { |
28 NSWindow* window = [view window]; | 28 NSWindow* window = [view window]; |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 base::Bind(&ClickOnOverflowedAction, | 230 base::Bind(&ClickOnOverflowedAction, |
231 base::Unretained(toolbarController), | 231 base::Unretained(toolbarController), |
232 runLoop.QuitClosure())); | 232 runLoop.QuitClosure())); |
233 runLoop.Run(); | 233 runLoop.Run(); |
234 // The menu should have opened. Note that the menu opened on the main bar's | 234 // The menu should have opened. Note that the menu opened on the main bar's |
235 // action button, not the overflow's. Since Cocoa doesn't support running | 235 // action button, not the overflow's. Since Cocoa doesn't support running |
236 // a menu-within-a-menu, this is what has to happen. | 236 // a menu-within-a-menu, this is what has to happen. |
237 EXPECT_TRUE([menuHelper menuOpened]); | 237 EXPECT_TRUE([menuHelper menuOpened]); |
238 } | 238 } |
239 } | 239 } |
OLD | NEW |