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

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

Issue 9536013: Move |requires_authorization| flag for plug-ins out of webkit/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: copyright Created 8 years, 9 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_finder.cc ('k') | chrome/browser/plugin_installer.h » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_finder.h" 5 #include "chrome/browser/plugin_finder.h"
6 6
7 #include "base/values.h" 7 #include "base/values.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 using base::DictionaryValue; 10 using base::DictionaryValue;
11 using base::ListValue;
12 11
13 TEST(PluginFinderTest, JsonSyntax) { 12 TEST(PluginFinderTest, JsonSyntax) {
14 scoped_ptr<ListValue> plugin_list(PluginFinder::LoadPluginList()); 13 scoped_ptr<DictionaryValue> plugin_list(PluginFinder::LoadPluginList());
15 ASSERT_TRUE(plugin_list.get()); 14 ASSERT_TRUE(plugin_list.get());
16 for (ListValue::const_iterator plugin_it = plugin_list->begin(); 15 for (DictionaryValue::Iterator plugin_it(*plugin_list);
17 plugin_it != plugin_list->end(); ++plugin_it) { 16 plugin_it.HasNext(); plugin_it.Advance()) {
18 const DictionaryValue* plugin = NULL; 17 const DictionaryValue* plugin = NULL;
19 ASSERT_TRUE((*plugin_it)->GetAsDictionary(&plugin)); 18 ASSERT_TRUE(plugin_it.value().GetAsDictionary(&plugin));
20 std::string dummy_str; 19 std::string dummy_str;
20 bool dummy_bool;
21 EXPECT_TRUE(plugin->GetString("lang", &dummy_str)); 21 EXPECT_TRUE(plugin->GetString("lang", &dummy_str));
22 EXPECT_TRUE(plugin->GetString("identifier", &dummy_str));
23 EXPECT_TRUE(plugin->GetString("url", &dummy_str)); 22 EXPECT_TRUE(plugin->GetString("url", &dummy_str));
24 EXPECT_TRUE(plugin->GetString("name", &dummy_str)); 23 EXPECT_TRUE(plugin->GetString("name", &dummy_str));
24 if (plugin->HasKey("help_url"))
25 EXPECT_TRUE(plugin->GetString("help_url", &dummy_str));
26 if (plugin->HasKey("displayurl"))
27 EXPECT_TRUE(plugin->GetBoolean("displayurl", &dummy_bool));
28 if (plugin->HasKey("requires_authorization"))
29 EXPECT_TRUE(plugin->GetBoolean("requires_authorization", &dummy_bool));
25 ListValue* mime_types = NULL; 30 ListValue* mime_types = NULL;
26 ASSERT_TRUE(plugin->GetList("mime_types", &mime_types)); 31 ASSERT_TRUE(plugin->GetList("mime_types", &mime_types));
27 for (ListValue::const_iterator mime_type_it = mime_types->begin(); 32 for (ListValue::const_iterator mime_type_it = mime_types->begin();
28 mime_type_it != mime_types->end(); ++mime_type_it) { 33 mime_type_it != mime_types->end(); ++mime_type_it) {
29 EXPECT_TRUE((*mime_type_it)->GetAsString(&dummy_str)); 34 EXPECT_TRUE((*mime_type_it)->GetAsString(&dummy_str));
30 } 35 }
31 } 36 }
32 } 37 }
OLDNEW
« no previous file with comments | « chrome/browser/plugin_finder.cc ('k') | chrome/browser/plugin_installer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698