OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
7 #include "chrome/browser/content_settings/content_settings_default_provider.h" | 7 #include "chrome/browser/content_settings/content_settings_default_provider.h" |
8 #include "chrome/browser/content_settings/content_settings_mock_observer.h" | 8 #include "chrome/browser/content_settings/content_settings_mock_observer.h" |
9 #include "chrome/browser/content_settings/content_settings_utils.h" | 9 #include "chrome/browser/content_settings/content_settings_utils.h" |
10 #include "chrome/browser/prefs/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 CONTENT_SETTINGS_TYPE_GEOLOCATION, | 71 CONTENT_SETTINGS_TYPE_GEOLOCATION, |
72 std::string(), | 72 std::string(), |
73 Value::CreateIntegerValue(CONTENT_SETTING_BLOCK)); | 73 Value::CreateIntegerValue(CONTENT_SETTING_BLOCK)); |
74 EXPECT_EQ(CONTENT_SETTING_BLOCK, | 74 EXPECT_EQ(CONTENT_SETTING_BLOCK, |
75 GetContentSetting(&provider_, | 75 GetContentSetting(&provider_, |
76 GURL(), | 76 GURL(), |
77 GURL(), | 77 GURL(), |
78 CONTENT_SETTINGS_TYPE_GEOLOCATION, | 78 CONTENT_SETTINGS_TYPE_GEOLOCATION, |
79 std::string(), | 79 std::string(), |
80 false)); | 80 false)); |
| 81 |
| 82 scoped_ptr<base::Value> value( |
| 83 GetContentSettingValue(&provider_, |
| 84 GURL("http://example.com/"), |
| 85 GURL("http://example.com/"), |
| 86 CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE, |
| 87 std::string(), |
| 88 false)); |
| 89 EXPECT_FALSE(value.get()); |
81 } | 90 } |
82 | 91 |
83 TEST_F(DefaultProviderTest, IgnoreNonDefaultSettings) { | 92 TEST_F(DefaultProviderTest, IgnoreNonDefaultSettings) { |
84 GURL primary_url("http://www.google.com"); | 93 GURL primary_url("http://www.google.com"); |
85 GURL secondary_url("http://www.google.com"); | 94 GURL secondary_url("http://www.google.com"); |
86 | 95 |
87 EXPECT_EQ(CONTENT_SETTING_ALLOW, | 96 EXPECT_EQ(CONTENT_SETTING_ALLOW, |
88 GetContentSetting(&provider_, | 97 GetContentSetting(&provider_, |
89 primary_url, | 98 primary_url, |
90 secondary_url, | 99 secondary_url, |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 | 303 |
295 EXPECT_EQ(CONTENT_SETTING_ALLOW, | 304 EXPECT_EQ(CONTENT_SETTING_ALLOW, |
296 GetContentSetting(&provider, | 305 GetContentSetting(&provider, |
297 GURL(), | 306 GURL(), |
298 GURL(), | 307 GURL(), |
299 CONTENT_SETTINGS_TYPE_GEOLOCATION, | 308 CONTENT_SETTINGS_TYPE_GEOLOCATION, |
300 std::string(), | 309 std::string(), |
301 false)); | 310 false)); |
302 provider.ShutdownOnUIThread(); | 311 provider.ShutdownOnUIThread(); |
303 } | 312 } |
OLD | NEW |