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

Unified Diff: chrome/browser/file_select_helper_unittest.cc

Issue 10414085: Modified the pepper file chooser API to support filtering files by extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/file_select_helper.cc ('k') | chrome/browser/ui/gtk/select_file_dialog_impl_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/file_select_helper_unittest.cc
diff --git a/chrome/browser/file_select_helper_unittest.cc b/chrome/browser/file_select_helper_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..5eb0436957f75448ef797d6bd58d9ea11dfbcdee
--- /dev/null
+++ b/chrome/browser/file_select_helper_unittest.cc
@@ -0,0 +1,19 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/file_select_helper.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+TEST(FileSelectHelperTest, IsAcceptTypeValid) {
+ EXPECT_TRUE(FileSelectHelper::IsAcceptTypeValid("a/b"));
+ EXPECT_TRUE(FileSelectHelper::IsAcceptTypeValid("abc/def"));
+ EXPECT_TRUE(FileSelectHelper::IsAcceptTypeValid("abc/*"));
+ EXPECT_TRUE(FileSelectHelper::IsAcceptTypeValid(".a"));
+ EXPECT_TRUE(FileSelectHelper::IsAcceptTypeValid(".abc"));
+
+ EXPECT_FALSE(FileSelectHelper::IsAcceptTypeValid("."));
+ EXPECT_FALSE(FileSelectHelper::IsAcceptTypeValid("/"));
+ EXPECT_FALSE(FileSelectHelper::IsAcceptTypeValid("ABC/*"));
+ EXPECT_FALSE(FileSelectHelper::IsAcceptTypeValid("abc/def "));
+}
« no previous file with comments | « chrome/browser/file_select_helper.cc ('k') | chrome/browser/ui/gtk/select_file_dialog_impl_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698