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 #include "chrome/browser/ui/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
6 #include "chrome/browser/ui/browser_window.h" | 6 #include "chrome/browser/ui/browser_window.h" |
7 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 7 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
8 #include "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" | 8 #include "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" |
9 #import "chrome/browser/ui/cocoa/website_settings/permission_bubble_cocoa.h" | 9 #import "chrome/browser/ui/cocoa/website_settings/permission_bubble_cocoa.h" |
10 #include "chrome/browser/ui/website_settings/permission_bubble_browser_test_util
.h" | 10 #include "chrome/browser/ui/website_settings/permission_bubble_browser_test_util
.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 [[FullscreenWindowManager alloc] initWithWindow:window | 43 [[FullscreenWindowManager alloc] initWithWindow:window |
44 desiredScreen:[NSScreen mainScreen]]); | 44 desiredScreen:[NSScreen mainScreen]]); |
45 EXPECT_TRUE(bubble.HasLocationBar()); | 45 EXPECT_TRUE(bubble.HasLocationBar()); |
46 [manager enterFullscreenMode]; | 46 [manager enterFullscreenMode]; |
47 EXPECT_TRUE(bubble.HasLocationBar()); | 47 EXPECT_TRUE(bubble.HasLocationBar()); |
48 [manager exitFullscreenMode]; | 48 [manager exitFullscreenMode]; |
49 EXPECT_TRUE(bubble.HasLocationBar()); | 49 EXPECT_TRUE(bubble.HasLocationBar()); |
50 bubble.Hide(); | 50 bubble.Hide(); |
51 } | 51 } |
52 | 52 |
53 IN_PROC_BROWSER_TEST_F(PermissionBubbleAppBrowserTest, AppHasNoLocationBar) { | 53 IN_PROC_BROWSER_TEST_F(PermissionBubbleBrowserTest, AppHasNoLocationBar) { |
54 PermissionBubbleCocoa bubble(app_browser()); | 54 Browser* app_browser = OpenExtensionAppWindow(); |
| 55 PermissionBubbleCocoa bubble(app_browser); |
55 bubble.SetDelegate(test_delegate()); | 56 bubble.SetDelegate(test_delegate()); |
56 bubble.Show(requests(), accept_states()); | 57 bubble.Show(requests(), accept_states()); |
57 EXPECT_FALSE(bubble.HasLocationBar()); | 58 EXPECT_FALSE(bubble.HasLocationBar()); |
58 bubble.Hide(); | 59 bubble.Hide(); |
59 } | 60 } |
60 | 61 |
61 // http://crbug.com/470724 | 62 // http://crbug.com/470724 |
62 // Kiosk mode on Mac has a location bar but it shouldn't. | 63 // Kiosk mode on Mac has a location bar but it shouldn't. |
63 IN_PROC_BROWSER_TEST_F(PermissionBubbleKioskBrowserTest, | 64 IN_PROC_BROWSER_TEST_F(PermissionBubbleKioskBrowserTest, |
64 DISABLED_KioskHasNoLocationBar) { | 65 DISABLED_KioskHasNoLocationBar) { |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 NSPoint withLocationBar = bubble.GetAnchorPoint(); | 118 NSPoint withLocationBar = bubble.GetAnchorPoint(); |
118 | 119 |
119 ON_CALL(bubble, HasLocationBar()).WillByDefault(testing::Return(false)); | 120 ON_CALL(bubble, HasLocationBar()).WillByDefault(testing::Return(false)); |
120 NSPoint withoutLocationBar = bubble.GetAnchorPoint(); | 121 NSPoint withoutLocationBar = bubble.GetAnchorPoint(); |
121 | 122 |
122 // The bubble should be in different places depending if the location bar is | 123 // The bubble should be in different places depending if the location bar is |
123 // available or not. | 124 // available or not. |
124 EXPECT_NSNE(withLocationBar, withoutLocationBar); | 125 EXPECT_NSNE(withLocationBar, withoutLocationBar); |
125 bubble.Hide(); | 126 bubble.Hide(); |
126 } | 127 } |
OLD | NEW |