OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.h
" | 5 #import "chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.h
" |
6 | 6 |
7 #include <Carbon/Carbon.h> | 7 #include <Carbon/Carbon.h> |
8 | 8 |
9 #include "base/mac/foundation_util.h" | 9 #include "base/mac/foundation_util.h" |
10 #import "base/mac/scoped_objc_class_swizzler.h" | 10 #import "base/mac/scoped_objc_class_swizzler.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 const char* const kPermissionA = "Permission A"; | 63 const char* const kPermissionA = "Permission A"; |
64 const char* const kPermissionB = "Permission B"; | 64 const char* const kPermissionB = "Permission B"; |
65 const char* const kPermissionC = "Permission C"; | 65 const char* const kPermissionC = "Permission C"; |
66 } | 66 } |
67 | 67 |
68 class PermissionBubbleControllerTest : public CocoaProfileTest, | 68 class PermissionBubbleControllerTest : public CocoaProfileTest, |
69 public PermissionPrompt::Delegate { | 69 public PermissionPrompt::Delegate { |
70 public: | 70 public: |
71 | 71 |
72 MOCK_METHOD2(ToggleAccept, void(int, bool)); | 72 MOCK_METHOD2(ToggleAccept, void(int, bool)); |
| 73 MOCK_METHOD1(TogglePersist, void(bool)); |
73 MOCK_METHOD0(SetCustomizationMode, void()); | 74 MOCK_METHOD0(SetCustomizationMode, void()); |
74 MOCK_METHOD0(Accept, void()); | 75 MOCK_METHOD0(Accept, void()); |
75 MOCK_METHOD0(Deny, void()); | 76 MOCK_METHOD0(Deny, void()); |
76 MOCK_METHOD0(Closing, void()); | 77 MOCK_METHOD0(Closing, void()); |
77 MOCK_METHOD1(SetView, void(PermissionPrompt*)); | 78 MOCK_METHOD1(SetView, void(PermissionPrompt*)); |
78 | 79 |
79 void SetUp() override { | 80 void SetUp() override { |
80 CocoaProfileTest::SetUp(); | 81 CocoaProfileTest::SetUp(); |
81 bridge_.reset(new PermissionBubbleCocoa(browser())); | 82 bridge_.reset(new PermissionBubbleCocoa(browser())); |
82 AddRequest(kPermissionA); | 83 AddRequest(kPermissionA); |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 base::mac::ScopedObjCClassSwizzler locationSwizzle( | 401 base::mac::ScopedObjCClassSwizzler locationSwizzle( |
401 [PermissionBubbleController class], [MockBubbleNoLocationBar class], | 402 [PermissionBubbleController class], [MockBubbleNoLocationBar class], |
402 @selector(hasVisibleLocationBarForBrowser:)); | 403 @selector(hasVisibleLocationBarForBrowser:)); |
403 withoutLocationBar = [controller_ getExpectedAnchorPoint]; | 404 withoutLocationBar = [controller_ getExpectedAnchorPoint]; |
404 } | 405 } |
405 | 406 |
406 // The bubble should be in different places depending if the location bar is | 407 // The bubble should be in different places depending if the location bar is |
407 // available or not. | 408 // available or not. |
408 EXPECT_NSNE(withLocationBar, withoutLocationBar); | 409 EXPECT_NSNE(withLocationBar, withoutLocationBar); |
409 } | 410 } |
OLD | NEW |