Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(632)

Side by Side Diff: chrome/browser/cocoa/content_settings_dialog_controller_unittest.mm

Issue 3299020: Remove vestigial cookie/web app permissions prompting UI now that the async U... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #import "base/scoped_nsobject.h" 7 #import "base/scoped_nsobject.h"
8 #include "base/ref_counted.h" 8 #include "base/ref_counted.h"
9 #include "chrome/browser/cocoa/browser_test_helper.h" 9 #include "chrome/browser/cocoa/browser_test_helper.h"
10 #include "chrome/browser/cocoa/cocoa_test_helper.h" 10 #include "chrome/browser/cocoa/cocoa_test_helper.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 } 51 }
52 52
53 TEST_F(ContentSettingsDialogControllerTest, CookieSetting) { 53 TEST_F(ContentSettingsDialogControllerTest, CookieSetting) {
54 // Change setting, check dialog property. 54 // Change setting, check dialog property.
55 settingsMap_->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_COOKIES, 55 settingsMap_->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_COOKIES,
56 CONTENT_SETTING_ALLOW); 56 CONTENT_SETTING_ALLOW);
57 EXPECT_EQ([controller_ cookieSettingIndex], kCookieEnabledIndex); 57 EXPECT_EQ([controller_ cookieSettingIndex], kCookieEnabledIndex);
58 58
59 settingsMap_->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_COOKIES, 59 settingsMap_->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_COOKIES,
60 CONTENT_SETTING_BLOCK); 60 CONTENT_SETTING_BLOCK);
61 // Since the cookie prompt is disabled per default, the index of the block 61 EXPECT_EQ([controller_ cookieSettingIndex], kCookieDisabledIndex);
62 // radio is actually 1 == kCookieAskIndex.
63 EXPECT_EQ([controller_ cookieSettingIndex], kCookieAskIndex);
64 62
65 // Change dialog property, check setting. 63 // Change dialog property, check setting.
66 NSInteger setting; 64 NSInteger setting;
67 [controller_ setCookieSettingIndex:kCookieEnabledIndex]; 65 [controller_ setCookieSettingIndex:kCookieEnabledIndex];
68 setting = 66 setting =
69 settingsMap_->GetDefaultContentSetting(CONTENT_SETTINGS_TYPE_COOKIES); 67 settingsMap_->GetDefaultContentSetting(CONTENT_SETTINGS_TYPE_COOKIES);
70 EXPECT_EQ(setting, CONTENT_SETTING_ALLOW); 68 EXPECT_EQ(setting, CONTENT_SETTING_ALLOW);
71 69
72 // Since the cookie prompt is disabled per default, the index of the block 70 [controller_ setCookieSettingIndex:kCookieDisabledIndex];
73 // radio is actually 1 == kCookieAskIndex.
74 [controller_ setCookieSettingIndex:kCookieAskIndex];
75 setting = 71 setting =
76 settingsMap_->GetDefaultContentSetting(CONTENT_SETTINGS_TYPE_COOKIES); 72 settingsMap_->GetDefaultContentSetting(CONTENT_SETTINGS_TYPE_COOKIES);
77 EXPECT_EQ(setting, CONTENT_SETTING_BLOCK); 73 EXPECT_EQ(setting, CONTENT_SETTING_BLOCK);
78 } 74 }
79 75
80 TEST_F(ContentSettingsDialogControllerTest, BlockThirdPartyCookiesSetting) { 76 TEST_F(ContentSettingsDialogControllerTest, BlockThirdPartyCookiesSetting) {
81 // Change setting, check dialog property. 77 // Change setting, check dialog property.
82 settingsMap_->SetBlockThirdPartyCookies(YES); 78 settingsMap_->SetBlockThirdPartyCookies(YES);
83 EXPECT_TRUE([controller_ blockThirdPartyCookies]); 79 EXPECT_TRUE([controller_ blockThirdPartyCookies]);
84 80
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 EXPECT_EQ(setting, CONTENT_SETTING_ASK); 267 EXPECT_EQ(setting, CONTENT_SETTING_ASK);
272 268
273 [controller_ setNotificationsSettingIndex:kNotificationsDisabledIndex]; 269 [controller_ setNotificationsSettingIndex:kNotificationsDisabledIndex];
274 setting = 270 setting =
275 notificationsService_->GetDefaultContentSetting(); 271 notificationsService_->GetDefaultContentSetting();
276 EXPECT_EQ(setting, CONTENT_SETTING_BLOCK); 272 EXPECT_EQ(setting, CONTENT_SETTING_BLOCK);
277 } 273 }
278 274
279 } // namespace 275 } // namespace
280 276
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698