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

Side by Side Diff: webkit/plugins/ppapi/ppb_file_chooser_impl_unittest.cc

Issue 10544089: Implement the file chooser as a new resource "host" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698