| Index: chrome/browser/cocoa/simple_content_exceptions_window_controller_unittest.mm
|
| diff --git a/chrome/browser/cocoa/geolocation_exceptions_window_controller_unittest.mm b/chrome/browser/cocoa/simple_content_exceptions_window_controller_unittest.mm
|
| similarity index 51%
|
| rename from chrome/browser/cocoa/geolocation_exceptions_window_controller_unittest.mm
|
| rename to chrome/browser/cocoa/simple_content_exceptions_window_controller_unittest.mm
|
| index ae2036db7e97d7360700ea19a03a8ab994d43bc9..34e96a54fe72b223ecf32f07a94431bc20a74f07 100644
|
| --- a/chrome/browser/cocoa/geolocation_exceptions_window_controller_unittest.mm
|
| +++ b/chrome/browser/cocoa/simple_content_exceptions_window_controller_unittest.mm
|
| @@ -2,7 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#import "chrome/browser/cocoa/geolocation_exceptions_window_controller.h"
|
| +#import "chrome/browser/cocoa/simple_content_exceptions_window_controller.h"
|
|
|
| #import <Cocoa/Cocoa.h>
|
|
|
| @@ -10,12 +10,13 @@
|
| #include "base/ref_counted.h"
|
| #include "chrome/browser/cocoa/browser_test_helper.h"
|
| #include "chrome/browser/cocoa/cocoa_test_helper.h"
|
| +#include "chrome/browser/geolocation/geolocation_exceptions_table_model.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| #include "testing/platform_test.h"
|
|
|
| namespace {
|
|
|
| -class GeolocationExceptionsWindowControllerTest : public CocoaTest {
|
| +class SimpleContentExceptionsWindowControllerTest : public CocoaTest {
|
| public:
|
| virtual void SetUp() {
|
| CocoaTest::SetUp();
|
| @@ -23,14 +24,16 @@ class GeolocationExceptionsWindowControllerTest : public CocoaTest {
|
| settingsMap_ = new GeolocationContentSettingsMap(profile);
|
| }
|
|
|
| - GeolocationExceptionsWindowController* GetController() {
|
| - id controller = [GeolocationExceptionsWindowController
|
| - controllerWithSettingsMap:settingsMap_.get()];
|
| + SimpleContentExceptionsWindowController* GetController() {
|
| + GeolocationExceptionsTableModel* model = // Freed by window controller.
|
| + new GeolocationExceptionsTableModel(settingsMap_.get());
|
| + id controller = [SimpleContentExceptionsWindowController
|
| + controllerWithTableModel:model];
|
| [controller showWindow:nil];
|
| return controller;
|
| }
|
|
|
| - void ClickRemoveAll(GeolocationExceptionsWindowController* controller) {
|
| + void ClickRemoveAll(SimpleContentExceptionsWindowController* controller) {
|
| [controller removeAll:nil];
|
| }
|
|
|
| @@ -39,19 +42,20 @@ class GeolocationExceptionsWindowControllerTest : public CocoaTest {
|
| scoped_refptr<GeolocationContentSettingsMap> settingsMap_;
|
| };
|
|
|
| -TEST_F(GeolocationExceptionsWindowControllerTest, Construction) {
|
| - GeolocationExceptionsWindowController* controller =
|
| - [GeolocationExceptionsWindowController
|
| - controllerWithSettingsMap:settingsMap_.get()];
|
| +TEST_F(SimpleContentExceptionsWindowControllerTest, Construction) {
|
| + GeolocationExceptionsTableModel* model = // Freed by window controller.
|
| + new GeolocationExceptionsTableModel(settingsMap_.get());
|
| + SimpleContentExceptionsWindowController* controller =
|
| + [SimpleContentExceptionsWindowController controllerWithTableModel:model];
|
| [controller showWindow:nil];
|
| [controller close]; // Should autorelease.
|
| }
|
|
|
| -TEST_F(GeolocationExceptionsWindowControllerTest, AddExistingEditAdd) {
|
| +TEST_F(SimpleContentExceptionsWindowControllerTest, AddExistingEditAdd) {
|
| settingsMap_->SetContentSetting(
|
| GURL("http://myhost"), GURL(), CONTENT_SETTING_BLOCK);
|
|
|
| - GeolocationExceptionsWindowController* controller = GetController();
|
| + SimpleContentExceptionsWindowController* controller = GetController();
|
| ClickRemoveAll(controller);
|
|
|
| [controller close];
|
|
|