| 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_selector_button.h" | 5 #import "chrome/browser/ui/cocoa/website_settings/permission_selector_button.h" |
| 6 | 6 |
| 7 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" | |
| 8 #include "base/mac/scoped_nsobject.h" | 7 #include "base/mac/scoped_nsobject.h" |
| 8 #import "chrome/browser/ui/cocoa/test/cocoa_test_helper.h" |
| 9 #include "chrome/browser/ui/website_settings/website_settings_ui.h" | 9 #include "chrome/browser/ui/website_settings/website_settings_ui.h" |
| 10 #include "chrome/test/base/testing_profile.h" | 10 #include "chrome/test/base/testing_profile.h" |
| 11 #include "content/public/test/test_browser_thread_bundle.h" | 11 #include "content/public/test/test_browser_thread_bundle.h" |
| 12 | 12 |
| 13 @interface PermissionSelectorButton (Testing) | 13 @interface PermissionSelectorButton (Testing) |
| 14 - (NSMenu*)permissionMenu; | 14 - (NSMenu*)permissionMenu; |
| 15 @end | 15 @end |
| 16 | 16 |
| 17 namespace { | 17 namespace { |
| 18 | 18 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 TEST_VIEW(PermissionSelectorButtonTest, view_); | 54 TEST_VIEW(PermissionSelectorButtonTest, view_); |
| 55 | 55 |
| 56 TEST_F(PermissionSelectorButtonTest, Callback) { | 56 TEST_F(PermissionSelectorButtonTest, Callback) { |
| 57 NSMenu* menu = [view_ permissionMenu]; | 57 NSMenu* menu = [view_ permissionMenu]; |
| 58 NSMenuItem* item = [menu itemAtIndex:0]; | 58 NSMenuItem* item = [menu itemAtIndex:0]; |
| 59 [[item target] performSelector:[item action] withObject:item]; | 59 [[item target] performSelector:[item action] withObject:item]; |
| 60 EXPECT_TRUE(got_callback_); | 60 EXPECT_TRUE(got_callback_); |
| 61 } | 61 } |
| 62 | 62 |
| 63 } // namespace | 63 } // namespace |
| OLD | NEW |