| Index: chrome/browser/content_settings/content_settings_provider_unittest.cc
|
| diff --git a/chrome/browser/content_settings/content_settings_provider_unittest.cc b/chrome/browser/content_settings/content_settings_provider_unittest.cc
|
| deleted file mode 100644
|
| index b5933baeaabeb3b9a687528a3ec2c5a07dd861c8..0000000000000000000000000000000000000000
|
| --- a/chrome/browser/content_settings/content_settings_provider_unittest.cc
|
| +++ /dev/null
|
| @@ -1,105 +0,0 @@
|
| -// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
| -// Use of this source code is governed by a BSD-style license that can be
|
| -// found in the LICENSE file.
|
| -
|
| -#include "testing/gtest/include/gtest/gtest.h"
|
| -
|
| -#include "base/memory/scoped_ptr.h"
|
| -#include "chrome/browser/content_settings/content_settings_mock_provider.h"
|
| -#include "chrome/browser/content_settings/content_settings_utils.h"
|
| -#include "url/gurl.h"
|
| -
|
| -namespace content_settings {
|
| -
|
| -TEST(ContentSettingsProviderTest, Mock) {
|
| - ContentSettingsPattern pattern =
|
| - ContentSettingsPattern::FromString("[*.]youtube.com");
|
| - GURL url("http://www.youtube.com");
|
| -
|
| - MockProvider mock_provider(false);
|
| - mock_provider.SetWebsiteSetting(
|
| - pattern,
|
| - pattern,
|
| - CONTENT_SETTINGS_TYPE_PLUGINS,
|
| - "java_plugin",
|
| - new base::FundamentalValue(CONTENT_SETTING_BLOCK));
|
| -
|
| - EXPECT_EQ(CONTENT_SETTING_BLOCK,
|
| - GetContentSetting(&mock_provider, url, url,
|
| - CONTENT_SETTINGS_TYPE_PLUGINS, "java_plugin",
|
| - false));
|
| - scoped_ptr<base::Value> value_ptr(
|
| - GetContentSettingValue(&mock_provider, url, url,
|
| - CONTENT_SETTINGS_TYPE_PLUGINS,
|
| - "java_plugin", false));
|
| - int int_value = -1;
|
| - value_ptr->GetAsInteger(&int_value);
|
| - EXPECT_EQ(CONTENT_SETTING_BLOCK, IntToContentSetting(int_value));
|
| -
|
| - EXPECT_EQ(CONTENT_SETTING_DEFAULT,
|
| - GetContentSetting(&mock_provider, url, url,
|
| - CONTENT_SETTINGS_TYPE_PLUGINS, "flash_plugin",
|
| - false));
|
| - EXPECT_EQ(NULL,
|
| - GetContentSettingValue(&mock_provider, url, url,
|
| - CONTENT_SETTINGS_TYPE_PLUGINS,
|
| - "flash_plugin", false));
|
| - EXPECT_EQ(CONTENT_SETTING_DEFAULT,
|
| - GetContentSetting(&mock_provider,
|
| - url,
|
| - url,
|
| - CONTENT_SETTINGS_TYPE_GEOLOCATION,
|
| - std::string(),
|
| - false));
|
| - EXPECT_EQ(NULL,
|
| - GetContentSettingValue(&mock_provider,
|
| - url,
|
| - url,
|
| - CONTENT_SETTINGS_TYPE_GEOLOCATION,
|
| - std::string(),
|
| - false));
|
| -
|
| - bool owned = mock_provider.SetWebsiteSetting(
|
| - pattern,
|
| - pattern,
|
| - CONTENT_SETTINGS_TYPE_PLUGINS,
|
| - "java_plugin",
|
| - new base::FundamentalValue(CONTENT_SETTING_ALLOW));
|
| - EXPECT_TRUE(owned);
|
| - EXPECT_EQ(CONTENT_SETTING_ALLOW,
|
| - GetContentSetting(&mock_provider, url, url,
|
| - CONTENT_SETTINGS_TYPE_PLUGINS, "java_plugin",
|
| - false));
|
| -
|
| - mock_provider.set_read_only(true);
|
| - scoped_ptr<base::Value> value(
|
| - new base::FundamentalValue(CONTENT_SETTING_BLOCK));
|
| - owned = mock_provider.SetWebsiteSetting(
|
| - pattern,
|
| - pattern,
|
| - CONTENT_SETTINGS_TYPE_PLUGINS,
|
| - "java_plugin",
|
| - value.get());
|
| - EXPECT_FALSE(owned);
|
| - EXPECT_EQ(CONTENT_SETTING_ALLOW,
|
| - GetContentSetting(&mock_provider, url, url,
|
| - CONTENT_SETTINGS_TYPE_PLUGINS, "java_plugin",
|
| - false));
|
| -
|
| - EXPECT_TRUE(mock_provider.read_only());
|
| -
|
| - mock_provider.set_read_only(false);
|
| - owned = mock_provider.SetWebsiteSetting(
|
| - pattern,
|
| - pattern,
|
| - CONTENT_SETTINGS_TYPE_PLUGINS,
|
| - "java_plugin",
|
| - new base::FundamentalValue(CONTENT_SETTING_BLOCK));
|
| - EXPECT_TRUE(owned);
|
| - EXPECT_EQ(CONTENT_SETTING_BLOCK,
|
| - GetContentSetting(&mock_provider, url, url,
|
| - CONTENT_SETTINGS_TYPE_PLUGINS, "java_plugin",
|
| - false));
|
| -}
|
| -
|
| -} // namespace content_settings
|
|
|