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

Side by Side Diff: components/content_settings/core/browser/content_settings_registry_unittest.cc

Issue 1442083002: Stop inheriting push notification permissions from regular to incognito (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review nits Created 5 years 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include <string> 5 #include <string>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/prefs/pref_registry.h" 9 #include "base/prefs/pref_registry.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 26 matching lines...) Expand all
37 const ContentSettingsInfo* info = 37 const ContentSettingsInfo* info =
38 registry()->Get(CONTENT_SETTINGS_TYPE_COOKIES); 38 registry()->Get(CONTENT_SETTINGS_TYPE_COOKIES);
39 ASSERT_TRUE(info); 39 ASSERT_TRUE(info);
40 40
41 // Check that the whitelisted types are correct. 41 // Check that the whitelisted types are correct.
42 std::vector<std::string> expected_whitelist; 42 std::vector<std::string> expected_whitelist;
43 expected_whitelist.push_back("chrome"); 43 expected_whitelist.push_back("chrome");
44 expected_whitelist.push_back("chrome-devtools"); 44 expected_whitelist.push_back("chrome-devtools");
45 EXPECT_EQ(expected_whitelist, info->whitelisted_schemes()); 45 EXPECT_EQ(expected_whitelist, info->whitelisted_schemes());
46 46
47 // Check the other properties are populated correctly.
48 EXPECT_TRUE(info->IsSettingValid(CONTENT_SETTING_SESSION_ONLY));
49 EXPECT_FALSE(info->IsSettingValid(CONTENT_SETTING_ASK));
50 EXPECT_EQ(ContentSettingsInfo::INHERIT_IN_INCOGNITO,
51 info->incognito_behavior());
52
47 // Check the WebsiteSettingsInfo is populated correctly. 53 // Check the WebsiteSettingsInfo is populated correctly.
48 const WebsiteSettingsInfo* website_settings_info = 54 const WebsiteSettingsInfo* website_settings_info =
49 info->website_settings_info(); 55 info->website_settings_info();
50 EXPECT_EQ("cookies", website_settings_info->name()); 56 EXPECT_EQ("cookies", website_settings_info->name());
51 EXPECT_EQ("profile.content_settings.exceptions.cookies", 57 EXPECT_EQ("profile.content_settings.exceptions.cookies",
52 website_settings_info->pref_name()); 58 website_settings_info->pref_name());
53 EXPECT_EQ("profile.default_content_setting_values.cookies", 59 EXPECT_EQ("profile.default_content_setting_values.cookies",
54 website_settings_info->default_value_pref_name()); 60 website_settings_info->default_value_pref_name());
55 int setting; 61 int setting;
56 ASSERT_TRUE( 62 ASSERT_TRUE(
(...skipping 21 matching lines...) Expand all
78 EXPECT_FALSE(cookies_found); 84 EXPECT_FALSE(cookies_found);
79 cookies_found = true; 85 cookies_found = true;
80 } 86 }
81 } 87 }
82 88
83 EXPECT_TRUE(plugins_found); 89 EXPECT_TRUE(plugins_found);
84 EXPECT_TRUE(cookies_found); 90 EXPECT_TRUE(cookies_found);
85 } 91 }
86 92
87 } // namespace content_settings 93 } // namespace content_settings
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698