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; |
(...skipping 30 matching lines...) Expand all Loading... |
41 }; | 41 }; |
42 | 42 |
43 IN_PROC_BROWSER_TEST_F(FileSystemApiTest, FileSystemApiGetDisplayPath) { | 43 IN_PROC_BROWSER_TEST_F(FileSystemApiTest, FileSystemApiGetDisplayPath) { |
44 FilePath test_file = test_root_folder_.AppendASCII("gold.txt"); | 44 FilePath test_file = test_root_folder_.AppendASCII("gold.txt"); |
45 FileSystemChooseFileFunction::SkipPickerAndAlwaysSelectPathForTest( | 45 FileSystemChooseFileFunction::SkipPickerAndAlwaysSelectPathForTest( |
46 &test_file); | 46 &test_file); |
47 ASSERT_TRUE(RunPlatformAppTest("api_test/file_system/get_display_path")) | 47 ASSERT_TRUE(RunPlatformAppTest("api_test/file_system/get_display_path")) |
48 << message_; | 48 << message_; |
49 } | 49 } |
50 | 50 |
| 51 #if defined(OS_WIN) || defined(OS_POSIX) |
| 52 IN_PROC_BROWSER_TEST_F(FileSystemApiTest, FileSystemApiGetDisplayPathPrettify) { |
51 #if defined(OS_WIN) | 53 #if defined(OS_WIN) |
52 IN_PROC_BROWSER_TEST_F(FileSystemApiTest, FileSystemApiGetDisplayPathPrettify) { | 54 int override = base::DIR_PROFILE; |
53 ASSERT_TRUE(PathService::OverrideAndCreateIfNeeded(base::DIR_PROFILE, | 55 #elif defined(OS_POSIX) |
| 56 int override = base::DIR_HOME; |
| 57 #endif |
| 58 ASSERT_TRUE(PathService::OverrideAndCreateIfNeeded(override, |
54 test_root_folder_, false)); | 59 test_root_folder_, false)); |
55 | 60 |
56 FilePath test_file = test_root_folder_.AppendASCII("gold.txt"); | 61 FilePath test_file = test_root_folder_.AppendASCII("gold.txt"); |
57 FileSystemChooseFileFunction::SkipPickerAndAlwaysSelectPathForTest( | 62 FileSystemChooseFileFunction::SkipPickerAndAlwaysSelectPathForTest( |
58 &test_file); | 63 &test_file); |
59 ASSERT_TRUE(RunPlatformAppTest( | 64 ASSERT_TRUE(RunPlatformAppTest( |
60 "api_test/file_system/get_display_path_prettify")) << message_; | 65 "api_test/file_system/get_display_path_prettify")) << message_; |
61 } | 66 } |
62 #endif | 67 #endif |
63 | 68 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 } | 195 } |
191 | 196 |
192 IN_PROC_BROWSER_TEST_F(FileSystemApiTest, FileSystemApiIsWritableTest) { | 197 IN_PROC_BROWSER_TEST_F(FileSystemApiTest, FileSystemApiIsWritableTest) { |
193 FilePath test_file = TempFilePath("writable.txt", true); | 198 FilePath test_file = TempFilePath("writable.txt", true); |
194 ASSERT_FALSE(test_file.empty()); | 199 ASSERT_FALSE(test_file.empty()); |
195 FileSystemChooseFileFunction::SkipPickerAndAlwaysSelectPathForTest( | 200 FileSystemChooseFileFunction::SkipPickerAndAlwaysSelectPathForTest( |
196 &test_file); | 201 &test_file); |
197 ASSERT_TRUE(RunPlatformAppTest( | 202 ASSERT_TRUE(RunPlatformAppTest( |
198 "api_test/file_system/is_writable_file_entry")) << message_; | 203 "api_test/file_system/is_writable_file_entry")) << message_; |
199 } | 204 } |
OLD | NEW |