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

Unified Diff: chrome/browser/ui/cocoa/permission_bubble/permission_bubble_controller_unittest.mm

Issue 2752623003: [Mac] Fix for the security chip (Closed)
Patch Set: Rebased Created 3 years, 9 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
« no previous file with comments | « chrome/browser/ui/cocoa/permission_bubble/permission_bubble_controller.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/permission_bubble/permission_bubble_controller_unittest.mm
diff --git a/chrome/browser/ui/cocoa/permission_bubble/permission_bubble_controller_unittest.mm b/chrome/browser/ui/cocoa/permission_bubble/permission_bubble_controller_unittest.mm
index 4ff4a76b08891bb9ef6e0e7eb8ffc4c6e928d8b3..cf89bbcfb00e9748c6457e2153ebd380d88538b0 100644
--- a/chrome/browser/ui/cocoa/permission_bubble/permission_bubble_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/permission_bubble/permission_bubble_controller_unittest.mm
@@ -17,6 +17,7 @@
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/cocoa/browser_window_controller.h"
#include "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h"
+#import "chrome/browser/ui/cocoa/location_bar/location_icon_decoration.h"
#import "chrome/browser/ui/cocoa/page_info/split_block_button.h"
#import "chrome/browser/ui/cocoa/permission_bubble/permission_bubble_cocoa.h"
#import "chrome/browser/ui/cocoa/test/cocoa_profile_test.h"
@@ -171,6 +172,26 @@ TEST_F(PermissionBubbleControllerTest, ShowAndClose) {
EXPECT_TRUE([[controller_ window] isVisible]);
}
+// Tests the page icon decoration's active state.
+TEST_F(PermissionBubbleControllerTest, PageIconDecorationActiveState) {
+ base::mac::ScopedObjCClassSwizzler locationSwizzle(
+ [PermissionBubbleController class], [MockBubbleYesLocationBar class],
+ @selector(hasVisibleLocationBarForBrowser:));
+
+ NSWindow* window = browser()->window()->GetNativeWindow();
+ BrowserWindowController* controller =
+ [BrowserWindowController browserWindowControllerForWindow:window];
+ LocationBarDecoration* decoration =
+ [controller locationBarBridge]->GetPageInfoDecoration();
+
+ [controller_ showWindow:nil];
+ EXPECT_TRUE([[controller_ window] isVisible]);
+ EXPECT_TRUE(decoration->active());
+
+ [controller_ close];
+ EXPECT_FALSE(decoration->active());
+}
+
TEST_F(PermissionBubbleControllerTest, ShowSinglePermission) {
[controller_ showWithDelegate:this
forRequests:requests_
« no previous file with comments | « chrome/browser/ui/cocoa/permission_bubble/permission_bubble_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698