OLD | NEW |
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 "chrome/common/plugin_group.h" | 5 #include "chrome/common/plugin_group.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
| 12 #include "base/utf_string_conversions.h" |
12 #include "base/values.h" | 13 #include "base/values.h" |
13 #include "base/version.h" | 14 #include "base/version.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
15 #include "webkit/glue/plugins/webplugininfo.h" | 16 #include "webkit/glue/plugins/webplugininfo.h" |
16 | 17 |
17 static const PluginGroupDefinition kPluginDef = { | 18 static const PluginGroupDefinition kPluginDef = { |
18 "MyPlugin", "MyPlugin", "", "", "3.0.44", "http://latest/" }; | 19 "MyPlugin", "MyPlugin", "", "", "3.0.44", "http://latest/" }; |
19 static const PluginGroupDefinition kPluginDef3 = { | 20 static const PluginGroupDefinition kPluginDef3 = { |
20 "MyPlugin 3", "MyPlugin", "0", "4", "3.0.44", "http://latest" }; | 21 "MyPlugin 3", "MyPlugin", "0", "4", "3.0.44", "http://latest" }; |
21 static const PluginGroupDefinition kPluginDef4 = { | 22 static const PluginGroupDefinition kPluginDef4 = { |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 string16(),std::vector<WebPluginMimeType>(), true }; | 105 string16(),std::vector<WebPluginMimeType>(), true }; |
105 scoped_ptr<PluginGroup> group(PluginGroup::FromWebPluginInfo(plugin)); | 106 scoped_ptr<PluginGroup> group(PluginGroup::FromWebPluginInfo(plugin)); |
106 EXPECT_TRUE(group->Match(plugin)); | 107 EXPECT_TRUE(group->Match(plugin)); |
107 group->AddPlugin(plugin, 0); | 108 group->AddPlugin(plugin, 0); |
108 scoped_ptr<DictionaryValue> data(group->GetDataForUI()); | 109 scoped_ptr<DictionaryValue> data(group->GetDataForUI()); |
109 std::string version; | 110 std::string version; |
110 data->GetString(L"version", &version); | 111 data->GetString(L"version", &version); |
111 EXPECT_EQ(versions[i][1], version); | 112 EXPECT_EQ(versions[i][1], version); |
112 } | 113 } |
113 } | 114 } |
OLD | NEW |