OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/file_util.h" | 5 #include "base/file_util.h" |
6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
7 #include "chrome/browser/extensions/api/file_system/file_system_api.h" | 7 #include "chrome/browser/extensions/api/file_system/file_system_api.h" |
8 #include "chrome/browser/extensions/platform_app_browsertest_util.h" | 8 #include "chrome/browser/extensions/platform_app_browsertest_util.h" |
9 | 9 |
10 using extensions::FileSystemChooseFileFunction; | 10 using extensions::FileSystemChooseFileFunction; |
11 | 11 |
12 class FileSystemApiTest : public PlatformAppBrowserTest { | 12 class FileSystemApiTest : public extensions::PlatformAppBrowserTest { |
13 public: | 13 public: |
14 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 14 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
15 PlatformAppBrowserTest::SetUpCommandLine(command_line); | 15 extensions::PlatformAppBrowserTest::SetUpCommandLine(command_line); |
16 test_root_folder_ = test_data_dir_.AppendASCII("api_test") | 16 test_root_folder_ = test_data_dir_.AppendASCII("api_test") |
17 .AppendASCII("file_system"); | 17 .AppendASCII("file_system"); |
18 } | 18 } |
19 | 19 |
20 virtual void TearDown() OVERRIDE { | 20 virtual void TearDown() OVERRIDE { |
21 FileSystemChooseFileFunction::StopSkippingPickerForTest(); | 21 FileSystemChooseFileFunction::StopSkippingPickerForTest(); |
22 PlatformAppBrowserTest::TearDown(); | 22 extensions::PlatformAppBrowserTest::TearDown(); |
23 }; | 23 }; |
24 | 24 |
25 protected: | 25 protected: |
26 FilePath TempFilePath(const std::string& destination_name, bool copy_gold) { | 26 FilePath TempFilePath(const std::string& destination_name, bool copy_gold) { |
27 if (!temp_dir_.CreateUniqueTempDir()) { | 27 if (!temp_dir_.CreateUniqueTempDir()) { |
28 ADD_FAILURE() << "CreateUniqueTempDir failed"; | 28 ADD_FAILURE() << "CreateUniqueTempDir failed"; |
29 return FilePath(); | 29 return FilePath(); |
30 } | 30 } |
31 FilePath destination = temp_dir_.path().AppendASCII(destination_name); | 31 FilePath destination = temp_dir_.path().AppendASCII(destination_name); |
32 if (copy_gold) { | 32 if (copy_gold) { |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 } | 195 } |
196 | 196 |
197 IN_PROC_BROWSER_TEST_F(FileSystemApiTest, FileSystemApiIsWritableTest) { | 197 IN_PROC_BROWSER_TEST_F(FileSystemApiTest, FileSystemApiIsWritableTest) { |
198 FilePath test_file = TempFilePath("writable.txt", true); | 198 FilePath test_file = TempFilePath("writable.txt", true); |
199 ASSERT_FALSE(test_file.empty()); | 199 ASSERT_FALSE(test_file.empty()); |
200 FileSystemChooseFileFunction::SkipPickerAndAlwaysSelectPathForTest( | 200 FileSystemChooseFileFunction::SkipPickerAndAlwaysSelectPathForTest( |
201 &test_file); | 201 &test_file); |
202 ASSERT_TRUE(RunPlatformAppTest( | 202 ASSERT_TRUE(RunPlatformAppTest( |
203 "api_test/file_system/is_writable_file_entry")) << message_; | 203 "api_test/file_system/is_writable_file_entry")) << message_; |
204 } | 204 } |
OLD | NEW |