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 "chrome/browser/plugin_prefs.h" | 5 #include "chrome/browser/plugin_prefs.h" |
6 | 6 |
7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
11 #include "chrome/test/base/testing_browser_process.h" | 11 #include "chrome/test/base/testing_browser_process.h" |
12 #include "chrome/test/base/testing_profile.h" | 12 #include "chrome/test/base/testing_profile.h" |
13 #include "chrome/test/base/testing_profile_manager.h" | 13 #include "chrome/test/base/testing_profile_manager.h" |
14 #include "content/browser/plugin_service.h" | 14 #include "content/public/browser/plugin_service.h" |
15 #include "content/test/test_browser_thread.h" | 15 #include "content/test/test_browser_thread.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
17 #include "webkit/plugins/npapi/mock_plugin_list.cc" | 17 #include "webkit/plugins/npapi/mock_plugin_list.cc" |
18 #include "webkit/plugins/webplugininfo.h" | 18 #include "webkit/plugins/webplugininfo.h" |
19 | 19 |
20 using content::BrowserThread; | 20 using content::BrowserThread; |
| 21 using content::PluginService; |
21 | 22 |
22 class PluginPrefsTest : public ::testing::Test { | 23 class PluginPrefsTest : public ::testing::Test { |
23 public: | 24 public: |
24 virtual void SetUp() OVERRIDE { | 25 virtual void SetUp() OVERRIDE { |
25 plugin_prefs_ = new PluginPrefs(); | 26 plugin_prefs_ = new PluginPrefs(); |
26 } | 27 } |
27 | 28 |
28 void SetPolicyEnforcedPluginPatterns( | 29 void SetPolicyEnforcedPluginPatterns( |
29 const std::set<string16>& disabled, | 30 const std::set<string16>& disabled, |
30 const std::set<string16>& disabled_exceptions, | 31 const std::set<string16>& disabled_exceptions, |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 TestingProfile* profile_2 = | 174 TestingProfile* profile_2 = |
174 profile_manager.CreateTestingProfile("Profile 2"); | 175 profile_manager.CreateTestingProfile("Profile 2"); |
175 PluginPrefs* plugin_prefs_2 = PluginPrefs::GetForTestingProfile(profile_2); | 176 PluginPrefs* plugin_prefs_2 = PluginPrefs::GetForTestingProfile(profile_2); |
176 ASSERT_TRUE(plugin_prefs); | 177 ASSERT_TRUE(plugin_prefs); |
177 plugin_prefs_2->SetPluginListForTesting(&plugin_list); | 178 plugin_prefs_2->SetPluginListForTesting(&plugin_list); |
178 EXPECT_FALSE(plugin_prefs_2->IsPluginEnabled(plugin)); | 179 EXPECT_FALSE(plugin_prefs_2->IsPluginEnabled(plugin)); |
179 | 180 |
180 profile_manager.DeleteTestingProfile("Profile 1"); | 181 profile_manager.DeleteTestingProfile("Profile 1"); |
181 profile_manager.DeleteTestingProfile("Profile 2"); | 182 profile_manager.DeleteTestingProfile("Profile 2"); |
182 } | 183 } |
OLD | NEW |