1// Copyright 2013 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/extensions/extension_apitest.h"
6
7namespace extensions {
8
9class FileSystemProviderApiTest : public ExtensionApiTest {
10 public:
11  FileSystemProviderApiTest()
12      : current_channel_(chrome::VersionInfo::CHANNEL_DEV) {}
13
14  // Loads a helper testing extension.
15  virtual void SetUpOnMainThread() OVERRIDE {
16    ExtensionApiTest::SetUpOnMainThread();
17    const extensions::Extension* extension = LoadExtensionWithFlags(
18        test_data_dir_.AppendASCII("file_system_provider/test_util"),
19        kFlagEnableIncognito);
20    ASSERT_TRUE(extension);
21  }
22
23 private:
24  extensions::ScopedCurrentChannel current_channel_;
25};
26
27IN_PROC_BROWSER_TEST_F(FileSystemProviderApiTest, Mount) {
28  ASSERT_TRUE(RunPlatformAppTestWithFlags("file_system_provider/mount",
29                                          kFlagLoadAsComponent))
30      << message_;
31}
32
33IN_PROC_BROWSER_TEST_F(FileSystemProviderApiTest, Unmount) {
34  ASSERT_TRUE(RunPlatformAppTestWithFlags("file_system_provider/unmount",
35                                          kFlagLoadAsComponent))
36      << message_;
37}
38
39IN_PROC_BROWSER_TEST_F(FileSystemProviderApiTest, GetAll) {
40  ASSERT_TRUE(RunPlatformAppTestWithFlags("file_system_provider/get_all",
41                                          kFlagLoadAsComponent))
42      << message_;
43}
44
45IN_PROC_BROWSER_TEST_F(FileSystemProviderApiTest, GetMetadata) {
46  ASSERT_TRUE(RunPlatformAppTestWithFlags("file_system_provider/get_metadata",
47                                          kFlagLoadAsComponent))
48      << message_;
49}
50
51IN_PROC_BROWSER_TEST_F(FileSystemProviderApiTest, ReadDirectory) {
52  ASSERT_TRUE(RunPlatformAppTestWithFlags("file_system_provider/read_directory",
53                                          kFlagLoadAsComponent))
54      << message_;
55}
56
57IN_PROC_BROWSER_TEST_F(FileSystemProviderApiTest, ReadFile) {
58  ASSERT_TRUE(RunPlatformAppTestWithFlags("file_system_provider/read_file",
59                                          kFlagLoadAsComponent))
60      << message_;
61}
62
63IN_PROC_BROWSER_TEST_F(FileSystemProviderApiTest, BigFile) {
64  ASSERT_TRUE(RunPlatformAppTestWithFlags("file_system_provider/big_file",
65                                          kFlagLoadAsComponent))
66      << message_;
67}
68
69IN_PROC_BROWSER_TEST_F(FileSystemProviderApiTest, Evil) {
70  ASSERT_TRUE(RunPlatformAppTestWithFlags("file_system_provider/evil",
71                                          kFlagLoadAsComponent))
72      << message_;
73}
74
75IN_PROC_BROWSER_TEST_F(FileSystemProviderApiTest, MimeType) {
76  ASSERT_TRUE(RunPlatformAppTestWithFlags("file_system_provider/mime_type",
77                                          kFlagLoadAsComponent))
78      << message_;
79}
80
81IN_PROC_BROWSER_TEST_F(FileSystemProviderApiTest, CreateDirectory) {
82  ASSERT_TRUE(RunPlatformAppTestWithFlags(
83      "file_system_provider/create_directory", kFlagLoadAsComponent))
84      << message_;
85}
86
87IN_PROC_BROWSER_TEST_F(FileSystemProviderApiTest, DeleteEntry) {
88  ASSERT_TRUE(RunPlatformAppTestWithFlags("file_system_provider/delete_entry",
89                                          kFlagLoadAsComponent))
90      << message_;
91}
92
93IN_PROC_BROWSER_TEST_F(FileSystemProviderApiTest, CreateFile) {
94  ASSERT_TRUE(RunPlatformAppTestWithFlags("file_system_provider/create_file",
95                                          kFlagLoadAsComponent))
96      << message_;
97}
98
99IN_PROC_BROWSER_TEST_F(FileSystemProviderApiTest, CopyEntry) {
100  ASSERT_TRUE(RunPlatformAppTestWithFlags("file_system_provider/copy_entry",
101                                          kFlagLoadAsComponent))
102      << message_;
103}
104
105IN_PROC_BROWSER_TEST_F(FileSystemProviderApiTest, MoveEntry) {
106  ASSERT_TRUE(RunPlatformAppTestWithFlags("file_system_provider/move_entry",
107                                          kFlagLoadAsComponent))
108      << message_;
109}
110
111IN_PROC_BROWSER_TEST_F(FileSystemProviderApiTest, Truncate) {
112  ASSERT_TRUE(RunPlatformAppTestWithFlags("file_system_provider/truncate",
113                                          kFlagLoadAsComponent))
114      << message_;
115}
116
117IN_PROC_BROWSER_TEST_F(FileSystemProviderApiTest, WriteFile) {
118  ASSERT_TRUE(RunPlatformAppTestWithFlags("file_system_provider/write_file",
119                                          kFlagLoadAsComponent))
120      << message_;
121}
122
123IN_PROC_BROWSER_TEST_F(FileSystemProviderApiTest, Extension) {
124  ASSERT_TRUE(RunComponentExtensionTest("file_system_provider/extension"))
125      << message_;
126}
127
128IN_PROC_BROWSER_TEST_F(FileSystemProviderApiTest, Thumbnail) {
129  ASSERT_TRUE(RunPlatformAppTestWithFlags("file_system_provider/thumbnail",
130                                          kFlagLoadAsComponent))
131      << message_;
132}
133
134}  // namespace extensions
135