OLD | NEW |
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 "webkit/plugins/npapi/plugin_list.h" | 5 #include "webkit/plugins/npapi/plugin_list.h" |
6 | 6 |
7 #include "base/string16.h" | 7 #include "base/string16.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "webkit/plugins/npapi/mock_plugin_list.h" | 10 #include "webkit/plugins/npapi/mock_plugin_list.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 } | 30 } |
31 return false; | 31 return false; |
32 } | 32 } |
33 | 33 |
34 FilePath::CharType kFooPath[] = FILE_PATH_LITERAL("/plugins/foo.plugin"); | 34 FilePath::CharType kFooPath[] = FILE_PATH_LITERAL("/plugins/foo.plugin"); |
35 FilePath::CharType kBarPath[] = FILE_PATH_LITERAL("/plugins/bar.plugin"); | 35 FilePath::CharType kBarPath[] = FILE_PATH_LITERAL("/plugins/bar.plugin"); |
36 const char* kFooIdentifier = "foo"; | 36 const char* kFooIdentifier = "foo"; |
37 const char* kFooGroupName = "Foo"; | 37 const char* kFooGroupName = "Foo"; |
38 const char* kFooName = "Foo Plugin"; | 38 const char* kFooName = "Foo Plugin"; |
39 const PluginGroupDefinition kPluginDefinitions[] = { | 39 const PluginGroupDefinition kPluginDefinitions[] = { |
40 { kFooIdentifier, kFooGroupName, kFooName, NULL, 0 }, | 40 { kFooIdentifier, kFooGroupName, kFooName }, |
41 }; | 41 }; |
42 | 42 |
43 } // namespace | 43 } // namespace |
44 | 44 |
45 class PluginListTest : public testing::Test { | 45 class PluginListTest : public testing::Test { |
46 public: | 46 public: |
47 PluginListTest() | 47 PluginListTest() |
48 : plugin_list_(kPluginDefinitions, arraysize(kPluginDefinitions)), | 48 : plugin_list_(kPluginDefinitions, arraysize(kPluginDefinitions)), |
49 foo_plugin_(ASCIIToUTF16(kFooName), | 49 foo_plugin_(ASCIIToUTF16(kFooName), |
50 FilePath(kFooPath), | 50 FilePath(kFooPath), |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 EXPECT_EQ(1u, groups[0].web_plugin_infos().size()); | 116 EXPECT_EQ(1u, groups[0].web_plugin_infos().size()); |
117 EXPECT_TRUE(groups[0].ContainsPlugin(FilePath(kBarPath))); | 117 EXPECT_TRUE(groups[0].ContainsPlugin(FilePath(kBarPath))); |
118 EXPECT_EQ("bar.plugin", groups[0].identifier()); | 118 EXPECT_EQ("bar.plugin", groups[0].identifier()); |
119 EXPECT_EQ(1u, groups[1].web_plugin_infos().size()); | 119 EXPECT_EQ(1u, groups[1].web_plugin_infos().size()); |
120 EXPECT_TRUE(groups[1].ContainsPlugin(FilePath(kFooPath))); | 120 EXPECT_TRUE(groups[1].ContainsPlugin(FilePath(kFooPath))); |
121 EXPECT_EQ(kFooIdentifier, groups[1].identifier()); | 121 EXPECT_EQ(kFooIdentifier, groups[1].identifier()); |
122 } | 122 } |
123 | 123 |
124 } // namespace npapi | 124 } // namespace npapi |
125 } // namespace webkit | 125 } // namespace webkit |
OLD | NEW |