| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 ContentSettingBubbleControllerTest::~ContentSettingBubbleControllerTest() { | 54 ContentSettingBubbleControllerTest::~ContentSettingBubbleControllerTest() { |
| 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 // These types have no bubble. | 66 // These types have no bubble. |
| 66 continue; | 67 continue; |
| 67 } | 68 } |
| 68 | 69 |
| 69 ContentSettingsType settingsType = static_cast<ContentSettingsType>(i); | 70 ContentSettingsType settingsType = static_cast<ContentSettingsType>(i); |
| 70 | 71 |
| 71 scoped_nsobject<NSWindow> parent([[NSWindow alloc] | 72 scoped_nsobject<NSWindow> parent([[NSWindow alloc] |
| 72 initWithContentRect:NSMakeRect(0, 0, 800, 600) | 73 initWithContentRect:NSMakeRect(0, 0, 800, 600) |
| 73 styleMask:NSBorderlessWindowMask | 74 styleMask:NSBorderlessWindowMask |
| 74 backing:NSBackingStoreBuffered | 75 backing:NSBackingStoreBuffered |
| (...skipping 10 matching lines...) Expand all Loading... |
| 85 settingsType) | 86 settingsType) |
| 86 parentWindow:parent | 87 parentWindow:parent |
| 87 anchoredAt:NSMakePoint(50, 20)]; | 88 anchoredAt:NSMakePoint(50, 20)]; |
| 88 EXPECT_TRUE(controller != nil); | 89 EXPECT_TRUE(controller != nil); |
| 89 EXPECT_TRUE([[controller window] isVisible]); | 90 EXPECT_TRUE([[controller window] isVisible]); |
| 90 [parent.get() close]; | 91 [parent.get() close]; |
| 91 } | 92 } |
| 92 } | 93 } |
| 93 | 94 |
| 94 } // namespace | 95 } // namespace |
| OLD | NEW |