| 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::FileSystemChooseEntryFunction; | 10 using extensions::FileSystemChooseEntryFunction; |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 ASSERT_TRUE(RunPlatformAppTest( | 133 ASSERT_TRUE(RunPlatformAppTest( |
| 134 "api_test/file_system/open_writable_existing_with_write")) << message_; | 134 "api_test/file_system/open_writable_existing_with_write")) << message_; |
| 135 } | 135 } |
| 136 | 136 |
| 137 IN_PROC_BROWSER_TEST_F(FileSystemApiTest, FileSystemApiOpenCancelTest) { | 137 IN_PROC_BROWSER_TEST_F(FileSystemApiTest, FileSystemApiOpenCancelTest) { |
| 138 FileSystemChooseEntryFunction::SkipPickerAndAlwaysCancelForTest(); | 138 FileSystemChooseEntryFunction::SkipPickerAndAlwaysCancelForTest(); |
| 139 ASSERT_TRUE(RunPlatformAppTest("api_test/file_system/open_cancel")) | 139 ASSERT_TRUE(RunPlatformAppTest("api_test/file_system/open_cancel")) |
| 140 << message_; | 140 << message_; |
| 141 } | 141 } |
| 142 | 142 |
| 143 #if defined(OS_LINUX) || defined(OS_CHROMEOS) | 143 IN_PROC_BROWSER_TEST_F(FileSystemApiTest, FileSystemApiOpenBackgroundTest) { |
| 144 #define MAYBE_FileSystemApiOpenBackgroundTest DISABLED_FileSystemApiOpenBackgrou
ndTest | |
| 145 #else | |
| 146 #define MAYBE_FileSystemApiOpenBackgroundTest FileSystemApiOpenBackgroundTest | |
| 147 #endif | |
| 148 | |
| 149 IN_PROC_BROWSER_TEST_F(FileSystemApiTest, MAYBE_FileSystemApiOpenBackgroundTest)
{ | |
| 150 ASSERT_TRUE(RunPlatformAppTest("api_test/file_system/open_background")) | 144 ASSERT_TRUE(RunPlatformAppTest("api_test/file_system/open_background")) |
| 151 << message_; | 145 << message_; |
| 152 } | 146 } |
| 153 | 147 |
| 154 IN_PROC_BROWSER_TEST_F(FileSystemApiTest, FileSystemApiSaveNewFileTest) { | 148 IN_PROC_BROWSER_TEST_F(FileSystemApiTest, FileSystemApiSaveNewFileTest) { |
| 155 base::FilePath test_file = TempFilePath("save_new.txt", false); | 149 base::FilePath test_file = TempFilePath("save_new.txt", false); |
| 156 ASSERT_FALSE(test_file.empty()); | 150 ASSERT_FALSE(test_file.empty()); |
| 157 FileSystemChooseEntryFunction::SkipPickerAndAlwaysSelectPathForTest( | 151 FileSystemChooseEntryFunction::SkipPickerAndAlwaysSelectPathForTest( |
| 158 &test_file); | 152 &test_file); |
| 159 ASSERT_TRUE(RunPlatformAppTest("api_test/file_system/save_new")) | 153 ASSERT_TRUE(RunPlatformAppTest("api_test/file_system/save_new")) |
| (...skipping 28 matching lines...) Expand all Loading... |
| 188 ASSERT_TRUE(RunPlatformAppTest( | 182 ASSERT_TRUE(RunPlatformAppTest( |
| 189 "api_test/file_system/save_existing_with_write")) << message_; | 183 "api_test/file_system/save_existing_with_write")) << message_; |
| 190 } | 184 } |
| 191 | 185 |
| 192 IN_PROC_BROWSER_TEST_F(FileSystemApiTest, FileSystemApiSaveCancelTest) { | 186 IN_PROC_BROWSER_TEST_F(FileSystemApiTest, FileSystemApiSaveCancelTest) { |
| 193 FileSystemChooseEntryFunction::SkipPickerAndAlwaysCancelForTest(); | 187 FileSystemChooseEntryFunction::SkipPickerAndAlwaysCancelForTest(); |
| 194 ASSERT_TRUE(RunPlatformAppTest("api_test/file_system/save_cancel")) | 188 ASSERT_TRUE(RunPlatformAppTest("api_test/file_system/save_cancel")) |
| 195 << message_; | 189 << message_; |
| 196 } | 190 } |
| 197 | 191 |
| 198 #if defined(OS_LINUX) || defined(OS_CHROMEOS) | 192 IN_PROC_BROWSER_TEST_F(FileSystemApiTest, FileSystemApiSaveBackgroundTest) { |
| 199 #define MAYBE_FileSystemApiSaveBackgroundTest DISABLED_FileSystemApiSaveBackgrou
ndTest | |
| 200 #else | |
| 201 #define MAYBE_FileSystemApiSaveBackgroundTest FileSystemApiSaveBackgroundTest | |
| 202 #endif | |
| 203 | |
| 204 IN_PROC_BROWSER_TEST_F(FileSystemApiTest, MAYBE_FileSystemApiSaveBackgroundTest)
{ | |
| 205 ASSERT_TRUE(RunPlatformAppTest("api_test/file_system/save_background")) | 193 ASSERT_TRUE(RunPlatformAppTest("api_test/file_system/save_background")) |
| 206 << message_; | 194 << message_; |
| 207 } | 195 } |
| 208 | 196 |
| 209 IN_PROC_BROWSER_TEST_F(FileSystemApiTest, FileSystemApiGetWritableTest) { | 197 IN_PROC_BROWSER_TEST_F(FileSystemApiTest, FileSystemApiGetWritableTest) { |
| 210 base::FilePath test_file = TempFilePath("writable.txt", true); | 198 base::FilePath test_file = TempFilePath("writable.txt", true); |
| 211 ASSERT_FALSE(test_file.empty()); | 199 ASSERT_FALSE(test_file.empty()); |
| 212 FileSystemChooseEntryFunction::SkipPickerAndAlwaysSelectPathForTest( | 200 FileSystemChooseEntryFunction::SkipPickerAndAlwaysSelectPathForTest( |
| 213 &test_file); | 201 &test_file); |
| 214 ASSERT_TRUE(RunPlatformAppTest( | 202 ASSERT_TRUE(RunPlatformAppTest( |
| (...skipping 20 matching lines...) Expand all Loading... |
| 235 } | 223 } |
| 236 | 224 |
| 237 IN_PROC_BROWSER_TEST_F(FileSystemApiTest, FileSystemApiGetEntryId) { | 225 IN_PROC_BROWSER_TEST_F(FileSystemApiTest, FileSystemApiGetEntryId) { |
| 238 base::FilePath test_file = TempFilePath("writable.txt", true); | 226 base::FilePath test_file = TempFilePath("writable.txt", true); |
| 239 ASSERT_FALSE(test_file.empty()); | 227 ASSERT_FALSE(test_file.empty()); |
| 240 FileSystemChooseEntryFunction::SkipPickerAndAlwaysSelectPathForTest( | 228 FileSystemChooseEntryFunction::SkipPickerAndAlwaysSelectPathForTest( |
| 241 &test_file); | 229 &test_file); |
| 242 ASSERT_TRUE(RunPlatformAppTest( | 230 ASSERT_TRUE(RunPlatformAppTest( |
| 243 "api_test/file_system/get_entry_id")) << message_; | 231 "api_test/file_system/get_entry_id")) << message_; |
| 244 } | 232 } |
| OLD | NEW |