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

Side by Side Diff: chrome/browser/ui/cocoa/table_model_array_controller_unittest.mm

Issue 5998002: Revert "Move the NPAPI files from webkit/glue/plugins to webkit/plugins/npapi" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years 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/tab_contents/tab_contents.cc ('k') | chrome/common/chrome_plugin_lib.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 #import "chrome/browser/ui/cocoa/table_model_array_controller.h" 5 #import "chrome/browser/ui/cocoa/table_model_array_controller.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/mock_plugin_exceptions_table_model.h" 10 #include "chrome/browser/mock_plugin_exceptions_table_model.h"
11 #include "chrome/browser/ui/cocoa/browser_test_helper.h" 11 #include "chrome/browser/ui/cocoa/browser_test_helper.h"
12 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" 12 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h"
13 #include "chrome/common/chrome_switches.h" 13 #include "chrome/common/chrome_switches.h"
14 #include "chrome/test/testing_profile.h" 14 #include "chrome/test/testing_profile.h"
15 #include "grit/generated_resources.h" 15 #include "grit/generated_resources.h"
16 #include "testing/gtest/include/gtest/gtest.h" 16 #include "testing/gtest/include/gtest/gtest.h"
17 #include "testing/gtest_mac.h" 17 #include "testing/gtest_mac.h"
18 #include "webkit/plugins/npapi/plugin_list.h" 18 #include "webkit/glue/plugins/plugin_list.h"
19 #include "webkit/plugins/npapi/webplugininfo.h" 19 #include "webkit/glue/plugins/webplugininfo.h"
20 20
21 class TableModelArrayControllerTest : public CocoaTest { 21 class TableModelArrayControllerTest : public CocoaTest {
22 public: 22 public:
23 TableModelArrayControllerTest() 23 TableModelArrayControllerTest()
24 : command_line_(CommandLine::ForCurrentProcess(), 24 : command_line_(CommandLine::ForCurrentProcess(),
25 *CommandLine::ForCurrentProcess()) {} 25 *CommandLine::ForCurrentProcess()) {}
26 26
27 virtual void SetUp() { 27 virtual void SetUp() {
28 CocoaTest::SetUp(); 28 CocoaTest::SetUp();
29 29
(...skipping 13 matching lines...) Expand all
43 CONTENT_SETTINGS_TYPE_PLUGINS, 43 CONTENT_SETTINGS_TYPE_PLUGINS,
44 "b-bar", 44 "b-bar",
45 CONTENT_SETTING_BLOCK); 45 CONTENT_SETTING_BLOCK);
46 map->SetContentSetting(example_com, 46 map->SetContentSetting(example_com,
47 CONTENT_SETTINGS_TYPE_PLUGINS, 47 CONTENT_SETTINGS_TYPE_PLUGINS,
48 "b-bar", 48 "b-bar",
49 CONTENT_SETTING_ALLOW); 49 CONTENT_SETTING_ALLOW);
50 50
51 model_.reset(new MockPluginExceptionsTableModel(map, NULL)); 51 model_.reset(new MockPluginExceptionsTableModel(map, NULL));
52 52
53 std::vector<webkit::npapi::PluginGroup> plugins; 53 std::vector<PluginGroup> plugins;
54 webkit::npapi::WebPluginInfo foo_plugin; 54 WebPluginInfo foo_plugin;
55 foo_plugin.path = FilePath(FILE_PATH_LITERAL("a-foo")); 55 foo_plugin.path = FilePath(FILE_PATH_LITERAL("a-foo"));
56 foo_plugin.name = ASCIIToUTF16("FooPlugin"); 56 foo_plugin.name = ASCIIToUTF16("FooPlugin");
57 foo_plugin.enabled = true; 57 foo_plugin.enabled = true;
58 scoped_ptr<webkit::npapi::PluginGroup> foo_group( 58 scoped_ptr<PluginGroup> foo_group(
59 webkit::npapi::PluginGroup::FromWebPluginInfo(foo_plugin)); 59 PluginGroup::FromWebPluginInfo(foo_plugin));
60 plugins.push_back(*foo_group); 60 plugins.push_back(*foo_group);
61 webkit::npapi::WebPluginInfo bar_plugin; 61 WebPluginInfo bar_plugin;
62 bar_plugin.path = FilePath(FILE_PATH_LITERAL("b-bar")); 62 bar_plugin.path = FilePath(FILE_PATH_LITERAL("b-bar"));
63 bar_plugin.name = ASCIIToUTF16("BarPlugin"); 63 bar_plugin.name = ASCIIToUTF16("BarPlugin");
64 bar_plugin.enabled = true; 64 bar_plugin.enabled = true;
65 scoped_ptr<webkit::npapi::PluginGroup> bar_group( 65 scoped_ptr<PluginGroup> bar_group(
66 webkit::npapi::PluginGroup::FromWebPluginInfo(bar_plugin)); 66 PluginGroup::FromWebPluginInfo(bar_plugin));
67 plugins.push_back(*bar_group); 67 plugins.push_back(*bar_group);
68 webkit::npapi::WebPluginInfo blurp_plugin; 68 WebPluginInfo blurp_plugin;
69 blurp_plugin.path = FilePath(FILE_PATH_LITERAL("c-blurp")); 69 blurp_plugin.path = FilePath(FILE_PATH_LITERAL("c-blurp"));
70 blurp_plugin.name = ASCIIToUTF16("BlurpPlugin"); 70 blurp_plugin.name = ASCIIToUTF16("BlurpPlugin");
71 blurp_plugin.enabled = true; 71 blurp_plugin.enabled = true;
72 scoped_ptr<webkit::npapi::PluginGroup> blurp_group( 72 scoped_ptr<PluginGroup> blurp_group(
73 webkit::npapi::PluginGroup::FromWebPluginInfo(blurp_plugin)); 73 PluginGroup::FromWebPluginInfo(blurp_plugin));
74 plugins.push_back(*blurp_group); 74 plugins.push_back(*blurp_group);
75 75
76 model_->set_plugins(plugins); 76 model_->set_plugins(plugins);
77 model_->LoadSettings(); 77 model_->LoadSettings();
78 78
79 id content = [NSMutableArray array]; 79 id content = [NSMutableArray array];
80 controller_.reset( 80 controller_.reset(
81 [[TableModelArrayController alloc] initWithContent:content]); 81 [[TableModelArrayController alloc] initWithContent:content]);
82 NSDictionary* columns = [NSDictionary dictionaryWithObjectsAndKeys: 82 NSDictionary* columns = [NSDictionary dictionaryWithObjectsAndKeys:
83 [NSNumber numberWithInt:IDS_EXCEPTIONS_HOSTNAME_HEADER], @"title", 83 [NSNumber numberWithInt:IDS_EXCEPTIONS_HOSTNAME_HEADER], @"title",
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 [controller setSelectionIndexes:indexes]; 162 [controller setSelectionIndexes:indexes];
163 [controller remove:nil]; 163 [controller remove:nil];
164 titles = [[controller arrangedObjects] valueForKey:@"title"]; 164 titles = [[controller arrangedObjects] valueForKey:@"title"];
165 EXPECT_NSEQ(@"(\n" 165 EXPECT_NSEQ(@"(\n"
166 @" BarPlugin,\n" 166 @" BarPlugin,\n"
167 @" \"[*.]example.com\",\n" 167 @" \"[*.]example.com\",\n"
168 @" \"[*.]moose.org\"\n" 168 @" \"[*.]moose.org\"\n"
169 @")", 169 @")",
170 [titles description]); 170 [titles description]);
171 } 171 }
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/tab_contents.cc ('k') | chrome/common/chrome_plugin_lib.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698