OLD | NEW |
| (Empty) |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "testing/gtest/include/gtest/gtest.h" | |
6 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" | |
7 #include "webkit/plugins/ppapi/ppb_file_chooser_impl.h" | |
8 | |
9 using WebKit::WebString; | |
10 | |
11 namespace webkit { | |
12 namespace ppapi { | |
13 | |
14 TEST(PPB_FileChooser_ImplTest, ParseAcceptValue) { | |
15 std::vector<WebString> parsed; | |
16 | |
17 parsed = PPB_FileChooser_Impl::ParseAcceptValue(""); | |
18 EXPECT_EQ(0U, parsed.size()); | |
19 | |
20 parsed = PPB_FileChooser_Impl::ParseAcceptValue(" "); | |
21 EXPECT_EQ(0U, parsed.size()); | |
22 | |
23 parsed = PPB_FileChooser_Impl::ParseAcceptValue("a"); | |
24 EXPECT_EQ(0U, parsed.size()); | |
25 | |
26 parsed = PPB_FileChooser_Impl::ParseAcceptValue(",, "); | |
27 EXPECT_EQ(0U, parsed.size()); | |
28 | |
29 parsed = PPB_FileChooser_Impl::ParseAcceptValue( | |
30 "IMAGE/*,,!!,,text/plain, audio /(*) "); | |
31 EXPECT_EQ(3U, parsed.size()); | |
32 EXPECT_EQ("image/*", parsed[0]); | |
33 EXPECT_EQ("text/plain", parsed[1]); | |
34 // We don't need to reject invalid MIME tokens strictly. | |
35 EXPECT_EQ("audio /(*)", parsed[2]); | |
36 } | |
37 | |
38 } // namespace ppapi | |
39 } // namespace webkit | |
OLD | NEW |