• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3 // found in the LICENSE file.
4 
5 #include "chrome/browser/file_select_helper.h"
6 #include "testing/gtest/include/gtest/gtest.h"
7 
TEST(FileSelectHelperTest,IsAcceptTypeValid)8 TEST(FileSelectHelperTest, IsAcceptTypeValid) {
9   EXPECT_TRUE(FileSelectHelper::IsAcceptTypeValid("a/b"));
10   EXPECT_TRUE(FileSelectHelper::IsAcceptTypeValid("abc/def"));
11   EXPECT_TRUE(FileSelectHelper::IsAcceptTypeValid("abc/*"));
12   EXPECT_TRUE(FileSelectHelper::IsAcceptTypeValid(".a"));
13   EXPECT_TRUE(FileSelectHelper::IsAcceptTypeValid(".abc"));
14 
15   EXPECT_FALSE(FileSelectHelper::IsAcceptTypeValid("."));
16   EXPECT_FALSE(FileSelectHelper::IsAcceptTypeValid("/"));
17   EXPECT_FALSE(FileSelectHelper::IsAcceptTypeValid("ABC/*"));
18   EXPECT_FALSE(FileSelectHelper::IsAcceptTypeValid("abc/def "));
19 }
20