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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "chrome/browser/chromeos/drive/drive_integration_service.h" | 9 #include "chrome/browser/chromeos/drive/drive_integration_service.h" |
10 #include "chrome/browser/chromeos/extensions/file_manager/drive_test_util.h" | 10 #include "chrome/browser/chromeos/extensions/file_manager/drive_test_util.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 // | | 69 // | |
70 // - test_file.xul.foo | 70 // - test_file.xul.foo |
71 // | | 71 // | |
72 // - test_file.tiff | 72 // - test_file.tiff |
73 // | | 73 // | |
74 // - test_file.tiff.foo | 74 // - test_file.tiff.foo |
75 // | 75 // |
76 // All files except test_dir/empty_file.foo, which is empty, initially contain | 76 // All files except test_dir/empty_file.foo, which is empty, initially contain |
77 // kTestFileContent. | 77 // kTestFileContent. |
78 const char kTestRootFeed[] = | 78 const char kTestRootFeed[] = |
79 "chromeos/gdata/remote_file_system_apitest_root_feed.json"; | 79 "gdata/remote_file_system_apitest_root_feed.json"; |
80 | 80 |
81 // Sets up the initial file system state for native local and restricted native | 81 // Sets up the initial file system state for native local and restricted native |
82 // local file systems. The hierarchy is the same as for the drive file system. | 82 // local file systems. The hierarchy is the same as for the drive file system. |
83 bool InitializeLocalFileSystem(base::ScopedTempDir* tmp_dir, | 83 bool InitializeLocalFileSystem(base::ScopedTempDir* tmp_dir, |
84 base::FilePath* mount_point_dir) { | 84 base::FilePath* mount_point_dir) { |
85 if (!tmp_dir->CreateUniqueTempDir()) | 85 if (!tmp_dir->CreateUniqueTempDir()) |
86 return false; | 86 return false; |
87 | 87 |
88 *mount_point_dir = tmp_dir->path().AppendASCII("mount"); | 88 *mount_point_dir = tmp_dir->path().AppendASCII("mount"); |
89 // Create the mount point. | 89 // Create the mount point. |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 drive_test_util::WaitUntilDriveMountPointIsAdded(browser()->profile()); | 307 drive_test_util::WaitUntilDriveMountPointIsAdded(browser()->profile()); |
308 } | 308 } |
309 | 309 |
310 protected: | 310 protected: |
311 // DriveIntegrationService factory function for this test. | 311 // DriveIntegrationService factory function for this test. |
312 drive::DriveIntegrationService* CreateDriveIntegrationService( | 312 drive::DriveIntegrationService* CreateDriveIntegrationService( |
313 Profile* profile) { | 313 Profile* profile) { |
314 fake_drive_service_ = new drive::FakeDriveService; | 314 fake_drive_service_ = new drive::FakeDriveService; |
315 fake_drive_service_->LoadResourceListForWapi(kTestRootFeed); | 315 fake_drive_service_->LoadResourceListForWapi(kTestRootFeed); |
316 fake_drive_service_->LoadAccountMetadataForWapi( | 316 fake_drive_service_->LoadAccountMetadataForWapi( |
317 "chromeos/gdata/account_metadata.json"); | 317 "gdata/account_metadata.json"); |
318 fake_drive_service_->LoadAppListForDriveApi("chromeos/drive/applist.json"); | 318 fake_drive_service_->LoadAppListForDriveApi("drive/applist.json"); |
319 | 319 |
320 return new drive::DriveIntegrationService(profile, | 320 return new drive::DriveIntegrationService(profile, |
321 fake_drive_service_, | 321 fake_drive_service_, |
322 test_cache_root_.path(), | 322 test_cache_root_.path(), |
323 NULL); | 323 NULL); |
324 } | 324 } |
325 | 325 |
326 base::ScopedTempDir test_cache_root_; | 326 base::ScopedTempDir test_cache_root_; |
327 drive::FakeDriveService* fake_drive_service_; | 327 drive::FakeDriveService* fake_drive_service_; |
328 }; | 328 }; |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 IN_PROC_BROWSER_TEST_F(DriveFileSystemExtensionApiTest, AppFileHandler) { | 425 IN_PROC_BROWSER_TEST_F(DriveFileSystemExtensionApiTest, AppFileHandler) { |
426 fake_drive_service_->set_default_max_results(1); | 426 fake_drive_service_->set_default_max_results(1); |
427 EXPECT_TRUE(RunFileSystemExtensionApiTest( | 427 EXPECT_TRUE(RunFileSystemExtensionApiTest( |
428 "file_browser/handler_test_runner", | 428 "file_browser/handler_test_runner", |
429 FILE_PATH_LITERAL("manifest.json"), | 429 FILE_PATH_LITERAL("manifest.json"), |
430 "file_browser/app_file_handler", | 430 "file_browser/app_file_handler", |
431 FLAGS_USE_FILE_HANDLER)) << message_; | 431 FLAGS_USE_FILE_HANDLER)) << message_; |
432 } | 432 } |
433 | 433 |
434 } // namespace | 434 } // namespace |
OLD | NEW |