OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "components/content_settings/core/browser/content_settings_pref_provide
r.h" | 5 #include "components/content_settings/core/browser/content_settings_pref_provide
r.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 CONTENT_SETTINGS_TYPE_COOKIES, std::string(), false)); | 412 CONTENT_SETTINGS_TYPE_COOKIES, std::string(), false)); |
413 EXPECT_TRUE(it->HasNext()); | 413 EXPECT_TRUE(it->HasNext()); |
414 EXPECT_EQ(pattern_1, it->Next().primary_pattern); | 414 EXPECT_EQ(pattern_1, it->Next().primary_pattern); |
415 EXPECT_FALSE(it->HasNext()); | 415 EXPECT_FALSE(it->HasNext()); |
416 } | 416 } |
417 | 417 |
418 // Non-OTR provider, OTR iterator has no settings. | 418 // Non-OTR provider, OTR iterator has no settings. |
419 { | 419 { |
420 std::unique_ptr<RuleIterator> it(normal_provider.GetRuleIterator( | 420 std::unique_ptr<RuleIterator> it(normal_provider.GetRuleIterator( |
421 CONTENT_SETTINGS_TYPE_COOKIES, std::string(), true)); | 421 CONTENT_SETTINGS_TYPE_COOKIES, std::string(), true)); |
422 EXPECT_FALSE(it->HasNext()); | 422 EXPECT_FALSE(it); |
423 } | 423 } |
424 | 424 |
425 // Create an incognito provider and set a setting. | 425 // Create an incognito provider and set a setting. |
426 PrefProvider incognito_provider(&prefs, true); | 426 PrefProvider incognito_provider(&prefs, true); |
427 incognito_provider.SetWebsiteSetting(pattern_2, wildcard, | 427 incognito_provider.SetWebsiteSetting(pattern_2, wildcard, |
428 CONTENT_SETTINGS_TYPE_COOKIES, | 428 CONTENT_SETTINGS_TYPE_COOKIES, |
429 std::string(), value->DeepCopy()); | 429 std::string(), value->DeepCopy()); |
430 | 430 |
431 // OTR provider, non-OTR iterator has one setting (pattern 1). | 431 // OTR provider, non-OTR iterator has one setting (pattern 1). |
432 { | 432 { |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 for (const char* pref : nonempty_prefs) { | 522 for (const char* pref : nonempty_prefs) { |
523 DictionaryPrefUpdate update(&prefs, pref); | 523 DictionaryPrefUpdate update(&prefs, pref); |
524 const base::DictionaryValue* dictionary = update.Get(); | 524 const base::DictionaryValue* dictionary = update.Get(); |
525 EXPECT_EQ(1u, dictionary->size()); | 525 EXPECT_EQ(1u, dictionary->size()); |
526 } | 526 } |
527 | 527 |
528 provider.ShutdownOnUIThread(); | 528 provider.ShutdownOnUIThread(); |
529 } | 529 } |
530 | 530 |
531 } // namespace content_settings | 531 } // namespace content_settings |
OLD | NEW |