| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/cocoa/content_settings_dialog_controller.h" | 5 #import "chrome/browser/cocoa/content_settings_dialog_controller.h" |
| 6 | 6 |
| 7 #include "base/scoped_nsautorelease_pool.h" | |
| 8 #include "chrome/browser/cocoa/browser_test_helper.h" | 7 #include "chrome/browser/cocoa/browser_test_helper.h" |
| 9 #include "chrome/browser/cocoa/cocoa_test_helper.h" | 8 #include "chrome/browser/cocoa/cocoa_test_helper.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 11 #include "testing/platform_test.h" | 10 #include "testing/platform_test.h" |
| 12 | 11 |
| 13 namespace { | 12 namespace { |
| 14 | 13 |
| 15 class ContentSettingsDialogControllerTest : public CocoaTest { | 14 class ContentSettingsDialogControllerTest : public CocoaTest { |
| 16 public: | 15 public: |
| 17 BrowserTestHelper browser_helper_; | 16 BrowserTestHelper browser_helper_; |
| 18 }; | 17 }; |
| 19 | 18 |
| 20 // Test that +showContentSettingsDialogForProfile brings up the existing editor | 19 // Test that +showContentSettingsDialogForProfile brings up the existing editor |
| 21 // and doesn't leak or crash. | 20 // and doesn't leak or crash. |
| 22 TEST_F(ContentSettingsDialogControllerTest, CreateDialog) { | 21 TEST_F(ContentSettingsDialogControllerTest, CreateDialog) { |
| 23 Profile* profile(browser_helper_.profile()); | 22 Profile* profile(browser_helper_.profile()); |
| 24 ContentSettingsDialogController* sharedInstance = | 23 ContentSettingsDialogController* sharedInstance = |
| 25 [ContentSettingsDialogController | 24 [ContentSettingsDialogController |
| 26 showContentSettingsForType:CONTENT_SETTINGS_TYPE_DEFAULT | 25 showContentSettingsForType:CONTENT_SETTINGS_TYPE_DEFAULT |
| 27 profile:profile]; | 26 profile:profile]; |
| 28 EXPECT_TRUE(sharedInstance); | 27 EXPECT_TRUE(sharedInstance); |
| 29 [sharedInstance close]; | 28 [sharedInstance close]; |
| 30 } | 29 } |
| 31 | 30 |
| 32 } // namespace | 31 } // namespace |
| OLD | NEW |