OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/content_settings/content_setting_bubble_cocoa.h
" | 5 #import "chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.h
" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 | 8 |
9 #include "base/debug/debugger.h" | 9 #include "base/debug/debugger.h" |
10 #include "base/mac/scoped_nsautorelease_pool.h" | 10 #include "base/mac/scoped_nsautorelease_pool.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 } | 55 } |
56 | 56 |
57 // Check that the bubble doesn't crash or leak for any settings type | 57 // Check that the bubble doesn't crash or leak for any settings type |
58 TEST_F(ContentSettingBubbleControllerTest, Init) { | 58 TEST_F(ContentSettingBubbleControllerTest, Init) { |
59 for (int i = 0; i < CONTENT_SETTINGS_NUM_TYPES; ++i) { | 59 for (int i = 0; i < CONTENT_SETTINGS_NUM_TYPES; ++i) { |
60 if (i == CONTENT_SETTINGS_TYPE_NOTIFICATIONS || | 60 if (i == CONTENT_SETTINGS_TYPE_NOTIFICATIONS || |
61 i == CONTENT_SETTINGS_TYPE_INTENTS || | 61 i == CONTENT_SETTINGS_TYPE_INTENTS || |
62 i == CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE || | 62 i == CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE || |
63 i == CONTENT_SETTINGS_TYPE_FULLSCREEN || | 63 i == CONTENT_SETTINGS_TYPE_FULLSCREEN || |
64 i == CONTENT_SETTINGS_TYPE_MOUSELOCK || | 64 i == CONTENT_SETTINGS_TYPE_MOUSELOCK || |
65 i == CONTENT_SETTINGS_TYPE_MEDIASTREAM) { | 65 i == CONTENT_SETTINGS_TYPE_MEDIASTREAM || |
| 66 i == CONTENT_SETTINGS_TYPE_PPAPI_BROKER) { |
66 // These types have no bubble. | 67 // These types have no bubble. |
67 continue; | 68 continue; |
68 } | 69 } |
69 | 70 |
70 ContentSettingsType settingsType = static_cast<ContentSettingsType>(i); | 71 ContentSettingsType settingsType = static_cast<ContentSettingsType>(i); |
71 | 72 |
72 scoped_nsobject<NSWindow> parent([[NSWindow alloc] | 73 scoped_nsobject<NSWindow> parent([[NSWindow alloc] |
73 initWithContentRect:NSMakeRect(0, 0, 800, 600) | 74 initWithContentRect:NSMakeRect(0, 0, 800, 600) |
74 styleMask:NSBorderlessWindowMask | 75 styleMask:NSBorderlessWindowMask |
75 backing:NSBackingStoreBuffered | 76 backing:NSBackingStoreBuffered |
(...skipping 10 matching lines...) Expand all Loading... |
86 settingsType) | 87 settingsType) |
87 parentWindow:parent | 88 parentWindow:parent |
88 anchoredAt:NSMakePoint(50, 20)]; | 89 anchoredAt:NSMakePoint(50, 20)]; |
89 EXPECT_TRUE(controller != nil); | 90 EXPECT_TRUE(controller != nil); |
90 EXPECT_TRUE([[controller window] isVisible]); | 91 EXPECT_TRUE([[controller window] isVisible]); |
91 [parent.get() close]; | 92 [parent.get() close]; |
92 } | 93 } |
93 } | 94 } |
94 | 95 |
95 } // namespace | 96 } // namespace |
OLD | NEW |