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 "base/mac/foundation_util.h" | 7 #include "base/mac/foundation_util.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 public PermissionBubbleView::Delegate { | 43 public PermissionBubbleView::Delegate { |
44 public: | 44 public: |
45 | 45 |
46 MOCK_METHOD2(ToggleAccept, void(int, bool)); | 46 MOCK_METHOD2(ToggleAccept, void(int, bool)); |
47 MOCK_METHOD0(SetCustomizationMode, void()); | 47 MOCK_METHOD0(SetCustomizationMode, void()); |
48 MOCK_METHOD0(Accept, void()); | 48 MOCK_METHOD0(Accept, void()); |
49 MOCK_METHOD0(Deny, void()); | 49 MOCK_METHOD0(Deny, void()); |
50 MOCK_METHOD0(Closing, void()); | 50 MOCK_METHOD0(Closing, void()); |
51 MOCK_METHOD1(SetView, void(PermissionBubbleView*)); | 51 MOCK_METHOD1(SetView, void(PermissionBubbleView*)); |
52 | 52 |
53 virtual void SetUp() OVERRIDE { | 53 virtual void SetUp() override { |
54 CocoaTest::SetUp(); | 54 CocoaTest::SetUp(); |
55 bridge_.reset(new PermissionBubbleCocoa(nil)); | 55 bridge_.reset(new PermissionBubbleCocoa(nil)); |
56 AddRequest(kPermissionA); | 56 AddRequest(kPermissionA); |
57 controller_ = [[PermissionBubbleController alloc] | 57 controller_ = [[PermissionBubbleController alloc] |
58 initWithParentWindow:test_window() | 58 initWithParentWindow:test_window() |
59 bridge:bridge_.get()]; | 59 bridge:bridge_.get()]; |
60 } | 60 } |
61 | 61 |
62 virtual void TearDown() OVERRIDE { | 62 virtual void TearDown() override { |
63 [controller_ close]; | 63 [controller_ close]; |
64 chrome::testing::NSRunLoopRunAllPending(); | 64 chrome::testing::NSRunLoopRunAllPending(); |
65 STLDeleteElements(&requests_); | 65 STLDeleteElements(&requests_); |
66 CocoaTest::TearDown(); | 66 CocoaTest::TearDown(); |
67 } | 67 } |
68 | 68 |
69 void AddRequest(const std::string& title) { | 69 void AddRequest(const std::string& title) { |
70 MockPermissionBubbleRequest* request = new MockPermissionBubbleRequest( | 70 MockPermissionBubbleRequest* request = new MockPermissionBubbleRequest( |
71 title, | 71 title, |
72 l10n_util::GetStringUTF8(IDS_PERMISSION_ALLOW), | 72 l10n_util::GetStringUTF8(IDS_PERMISSION_ALLOW), |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 forRequests:requests_ | 287 forRequests:requests_ |
288 acceptStates:accept_states_ | 288 acceptStates:accept_states_ |
289 customizationMode:NO]; | 289 customizationMode:NO]; |
290 | 290 |
291 EXPECT_CALL(*this, SetCustomizationMode()).Times(1); | 291 EXPECT_CALL(*this, SetCustomizationMode()).Times(1); |
292 NSMenuItem* customize_item = FindCustomizeMenuItem(); | 292 NSMenuItem* customize_item = FindCustomizeMenuItem(); |
293 EXPECT_TRUE(customize_item); | 293 EXPECT_TRUE(customize_item); |
294 NSMenu* menu = [customize_item menu]; | 294 NSMenu* menu = [customize_item menu]; |
295 [menu performActionForItemAtIndex:[menu indexOfItem:customize_item]]; | 295 [menu performActionForItemAtIndex:[menu indexOfItem:customize_item]]; |
296 } | 296 } |
OLD | NEW |