| 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/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
| 7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "base/prefs/testing_pref_service.h" | 8 #include "base/prefs/testing_pref_service.h" |
| 9 #include "chrome/browser/content_settings/content_settings_mock_observer.h" | 9 #include "chrome/browser/content_settings/content_settings_mock_observer.h" |
| 10 #include "chrome/common/pref_names.h" | 10 #include "chrome/common/pref_names.h" |
| 11 #include "chrome/test/base/testing_profile.h" | 11 #include "chrome/test/base/testing_profile.h" |
| 12 #include "components/content_settings/core/browser/content_settings_default_prov
ider.h" | 12 #include "components/content_settings/core/browser/content_settings_default_prov
ider.h" |
| 13 #include "components/content_settings/core/browser/content_settings_utils.h" | 13 #include "components/content_settings/core/browser/content_settings_utils.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 15 #include "url/gurl.h" | 15 #include "url/gurl.h" |
| 16 | 16 |
| 17 using ::testing::_; | 17 using ::testing::_; |
| 18 | 18 |
| 19 class DefaultProviderTest : public testing::Test { | 19 class DefaultProviderTest : public testing::Test { |
| 20 public: | 20 public: |
| 21 DefaultProviderTest() | 21 DefaultProviderTest() |
| 22 : provider_(profile_.GetPrefs(), false) { | 22 : provider_(profile_.GetPrefs(), false) { |
| 23 } | 23 } |
| 24 virtual ~DefaultProviderTest() { | 24 ~DefaultProviderTest() override { provider_.ShutdownOnUIThread(); } |
| 25 provider_.ShutdownOnUIThread(); | |
| 26 } | |
| 27 | 25 |
| 28 protected: | 26 protected: |
| 29 TestingProfile profile_; | 27 TestingProfile profile_; |
| 30 content_settings::DefaultProvider provider_; | 28 content_settings::DefaultProvider provider_; |
| 31 }; | 29 }; |
| 32 | 30 |
| 33 TEST_F(DefaultProviderTest, DefaultValues) { | 31 TEST_F(DefaultProviderTest, DefaultValues) { |
| 34 // Check setting defaults. | 32 // Check setting defaults. |
| 35 EXPECT_EQ(CONTENT_SETTING_ALLOW, | 33 EXPECT_EQ(CONTENT_SETTING_ALLOW, |
| 36 GetContentSetting(&provider_, | 34 GetContentSetting(&provider_, |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 | 243 |
| 246 EXPECT_EQ(CONTENT_SETTING_BLOCK, | 244 EXPECT_EQ(CONTENT_SETTING_BLOCK, |
| 247 GetContentSetting(&otr_provider, | 245 GetContentSetting(&otr_provider, |
| 248 GURL(), | 246 GURL(), |
| 249 GURL(), | 247 GURL(), |
| 250 CONTENT_SETTINGS_TYPE_COOKIES, | 248 CONTENT_SETTINGS_TYPE_COOKIES, |
| 251 std::string(), | 249 std::string(), |
| 252 true)); | 250 true)); |
| 253 otr_provider.ShutdownOnUIThread(); | 251 otr_provider.ShutdownOnUIThread(); |
| 254 } | 252 } |
| OLD | NEW |