Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(548)

Side by Side Diff: chrome/browser/plugin_exceptions_table_model_unittest.cc

Issue 5699005: Policy: Re-enabled plugin still disabled (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Whitespace fixes only. Trybot happiness still applies. Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/plugin_data_remover.cc ('k') | chrome/browser/plugin_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/auto_reset.h" 5 #include "base/auto_reset.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/mock_plugin_exceptions_table_model.h" 8 #include "chrome/browser/mock_plugin_exceptions_table_model.h"
9 #include "chrome/common/chrome_switches.h" 9 #include "chrome/common/chrome_switches.h"
10 #include "chrome/test/testing_pref_service.h" 10 #include "chrome/test/testing_pref_service.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 CONTENT_SETTINGS_TYPE_PLUGINS, 81 CONTENT_SETTINGS_TYPE_PLUGINS,
82 "b-bar", 82 "b-bar",
83 CONTENT_SETTING_ALLOW); 83 CONTENT_SETTING_ALLOW);
84 84
85 table_model_.reset(new MockPluginExceptionsTableModel(map, NULL)); 85 table_model_.reset(new MockPluginExceptionsTableModel(map, NULL));
86 86
87 std::vector<webkit::npapi::PluginGroup> plugins; 87 std::vector<webkit::npapi::PluginGroup> plugins;
88 webkit::npapi::WebPluginInfo foo_plugin; 88 webkit::npapi::WebPluginInfo foo_plugin;
89 foo_plugin.path = FilePath(FILE_PATH_LITERAL("a-foo")); 89 foo_plugin.path = FilePath(FILE_PATH_LITERAL("a-foo"));
90 foo_plugin.name = ASCIIToUTF16("FooPlugin"); 90 foo_plugin.name = ASCIIToUTF16("FooPlugin");
91 foo_plugin.enabled = true; 91 foo_plugin.enabled =
92 webkit::npapi::WebPluginInfo::USER_ENABLED_POLICY_UNMANAGED;
92 scoped_ptr<webkit::npapi::PluginGroup> foo_group( 93 scoped_ptr<webkit::npapi::PluginGroup> foo_group(
93 webkit::npapi::PluginGroup::FromWebPluginInfo(foo_plugin)); 94 webkit::npapi::PluginGroup::FromWebPluginInfo(foo_plugin));
94 plugins.push_back(*foo_group); 95 plugins.push_back(*foo_group);
95 96
96 webkit::npapi::WebPluginInfo bar_plugin; 97 webkit::npapi::WebPluginInfo bar_plugin;
97 bar_plugin.path = FilePath(FILE_PATH_LITERAL("b-bar")); 98 bar_plugin.path = FilePath(FILE_PATH_LITERAL("b-bar"));
98 bar_plugin.name = ASCIIToUTF16("BarPlugin"); 99 bar_plugin.name = ASCIIToUTF16("BarPlugin");
99 bar_plugin.enabled = true; 100 bar_plugin.enabled =
101 webkit::npapi::WebPluginInfo::USER_ENABLED_POLICY_UNMANAGED;
100 scoped_ptr<webkit::npapi::PluginGroup> bar_group( 102 scoped_ptr<webkit::npapi::PluginGroup> bar_group(
101 webkit::npapi::PluginGroup::FromWebPluginInfo(bar_plugin)); 103 webkit::npapi::PluginGroup::FromWebPluginInfo(bar_plugin));
102 plugins.push_back(*bar_group); 104 plugins.push_back(*bar_group);
103 105
104 table_model_->set_plugins(plugins); 106 table_model_->set_plugins(plugins);
105 table_model_->ReloadSettings(); 107 table_model_->ReloadSettings();
106 } 108 }
107 109
108 protected: 110 protected:
109 void CheckInvariants() { 111 void CheckInvariants() {
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 plugin_test_internal::MockTableModelObserver observer(table_model_.get()); 209 plugin_test_internal::MockTableModelObserver observer(table_model_.get());
208 table_model_->SetObserver(&observer); 210 table_model_->SetObserver(&observer);
209 211
210 EXPECT_CALL(observer, OnModelChanged()); 212 EXPECT_CALL(observer, OnModelChanged());
211 table_model_->RemoveAll(); 213 table_model_->RemoveAll();
212 EXPECT_EQ(0, table_model_->RowCount()); 214 EXPECT_EQ(0, table_model_->RowCount());
213 EXPECT_EQ(0, static_cast<int>(table_model_->GetGroups().size())); 215 EXPECT_EQ(0, static_cast<int>(table_model_->GetGroups().size()));
214 CheckInvariants(); 216 CheckInvariants();
215 table_model_->SetObserver(NULL); 217 table_model_->SetObserver(NULL);
216 } 218 }
OLDNEW
« no previous file with comments | « chrome/browser/plugin_data_remover.cc ('k') | chrome/browser/plugin_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698