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
3 // found in the LICENSE file.
6 #include "base/file_util.h"
7 #include "base/files/file_path.h"
8 #include "base/files/scoped_temp_dir.h"
9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/chrome_notification_types.h"
11 #include "chrome/browser/chromeos/drive/drive_integration_service.h"
12 #include "chrome/browser/chromeos/drive/test_util.h"
13 #include "chrome/browser/chromeos/file_manager/drive_test_util.h"
14 #include "chrome/browser/chromeos/file_manager/volume_manager.h"
15 #include "chrome/browser/drive/fake_drive_service.h"
16 #include "chrome/browser/extensions/extension_apitest.h"
17 #include "chrome/browser/profiles/profile.h"
18 #include "chrome/browser/profiles/profile_manager.h"
19 #include "chrome/browser/ui/browser.h"
20 #include "chrome/common/chrome_constants.h"
21 #include "content/public/browser/browser_context.h"
22 #include "content/public/browser/notification_service.h"
23 #include "content/public/test/test_utils.h"
24 #include "google_apis/drive/test_util.h"
25 #include "google_apis/drive/time_util.h"
26 #include "webkit/browser/fileapi/external_mount_points.h"
28 // Tests for access to external file systems (as defined in
29 // webkit/common/fileapi/file_system_types.h) from extensions with
30 // fileBrowserPrivate and fileBrowserHandler extension permissions.
31 // The tests cover following external file system types:
32 // - local (kFileSystemTypeLocalNative): a local file system on which files are
33 // accessed using native local path.
34 // - restricted (kFileSystemTypeRestrictedLocalNative): a *read-only* local file
35 // system which can only be accessed by extensions that have full access to
36 // external file systems (i.e. extensions with fileBrowserPrivate permission).
37 // - drive (kFileSystemTypeDrive): a file system that provides access to Google
40 // The tests cover following scenarios:
41 // - Performing file system operations on external file systems from an
42 // extension with fileBrowserPrivate permission (i.e. a file browser
44 // - Performing read/write operations from file handler extensions. These
45 // extensions need a file browser extension to give them permissions to access
46 // files. This also includes file handler extensions in filesystem API.
47 // - Observing directory changes from a file browser extension (using
48 // fileBrowserPrivate API).
49 // - Doing searches on drive file system from file browser extension (using
50 // fileBrowserPrivate API).
52 using drive::DriveIntegrationServiceFactory
;
53 using extensions::Extension
;
55 namespace file_manager
{
58 // Root dirs for file systems expected by the test extensions.
59 // NOTE: Root dir for drive file system is set by Chrome's drive implementation,
60 // but the test will have to make sure the mount point is added before
61 // starting a test extension using WaitUntilDriveMountPointIsAdded().
62 const char kLocalMountPointName
[] = "local";
63 const char kRestrictedMountPointName
[] = "restricted";
65 // Default file content for the test files.
66 const char kTestFileContent
[] = "This is some test content.";
68 // Sets up the initial file system state for native local and restricted native
69 // local file systems. The hierarchy is the same as for the drive file system.
70 // The directory is created at unique_temp_dir/|mount_point_name| path.
71 bool InitializeLocalFileSystem(std::string mount_point_name
,
72 base::ScopedTempDir
* tmp_dir
,
73 base::FilePath
* mount_point_dir
) {
74 if (!tmp_dir
->CreateUniqueTempDir())
77 *mount_point_dir
= tmp_dir
->path().AppendASCII(mount_point_name
);
78 // Create the mount point.
79 if (!base::CreateDirectory(*mount_point_dir
))
82 base::FilePath test_dir
= mount_point_dir
->AppendASCII("test_dir");
83 if (!base::CreateDirectory(test_dir
))
86 base::FilePath test_subdir
= test_dir
.AppendASCII("empty_test_dir");
87 if (!base::CreateDirectory(test_subdir
))
90 test_subdir
= test_dir
.AppendASCII("subdir");
91 if (!base::CreateDirectory(test_subdir
))
94 base::FilePath test_file
= test_dir
.AppendASCII("test_file.xul");
95 if (!google_apis::test_util::WriteStringToFile(test_file
, kTestFileContent
))
98 test_file
= test_dir
.AppendASCII("test_file.xul.foo");
99 if (!google_apis::test_util::WriteStringToFile(test_file
, kTestFileContent
))
102 test_file
= test_dir
.AppendASCII("test_file.tiff");
103 if (!google_apis::test_util::WriteStringToFile(test_file
, kTestFileContent
))
106 test_file
= test_dir
.AppendASCII("test_file.tiff.foo");
107 if (!google_apis::test_util::WriteStringToFile(test_file
, kTestFileContent
))
110 test_file
= test_dir
.AppendASCII("empty_test_file.foo");
111 if (!google_apis::test_util::WriteStringToFile(test_file
, ""))
117 scoped_ptr
<google_apis::ResourceEntry
> UpdateDriveEntryTime(
118 drive::FakeDriveService
* fake_drive_service
,
119 const std::string
& resource_id
,
120 const std::string
& last_modified
,
121 const std::string
& last_viewed_by_me
) {
122 base::Time last_modified_time
, last_viewed_by_me_time
;
123 if (!google_apis::util::GetTimeFromString(last_modified
,
124 &last_modified_time
) ||
125 !google_apis::util::GetTimeFromString(last_viewed_by_me
,
126 &last_viewed_by_me_time
))
127 return scoped_ptr
<google_apis::ResourceEntry
>();
129 google_apis::GDataErrorCode error
= google_apis::GDATA_OTHER_ERROR
;
130 scoped_ptr
<google_apis::ResourceEntry
> entry
;
131 fake_drive_service
->UpdateResource(
133 std::string(), // parent_resource_id
134 std::string(), // title
136 last_viewed_by_me_time
,
137 google_apis::test_util::CreateCopyResultCallback(&error
, &entry
));
138 base::RunLoop().RunUntilIdle();
139 if (error
!= google_apis::HTTP_SUCCESS
)
140 return scoped_ptr
<google_apis::ResourceEntry
>();
145 scoped_ptr
<google_apis::ResourceEntry
> AddFileToDriveService(
146 drive::FakeDriveService
* fake_drive_service
,
147 const std::string
& mime_type
,
148 const std::string
& content
,
149 const std::string
& parent_resource_id
,
150 const std::string
& title
,
151 const std::string
& last_modified
,
152 const std::string
& last_viewed_by_me
) {
153 google_apis::GDataErrorCode error
= google_apis::GDATA_OTHER_ERROR
;
154 scoped_ptr
<google_apis::ResourceEntry
> entry
;
155 fake_drive_service
->AddNewFile(
160 false, // shared_with_me
161 google_apis::test_util::CreateCopyResultCallback(&error
, &entry
));
162 base::RunLoop().RunUntilIdle();
163 if (error
!= google_apis::HTTP_CREATED
)
164 return scoped_ptr
<google_apis::ResourceEntry
>();
166 return UpdateDriveEntryTime(fake_drive_service
, entry
->resource_id(),
167 last_modified
, last_viewed_by_me
);
170 scoped_ptr
<google_apis::ResourceEntry
> AddDirectoryToDriveService(
171 drive::FakeDriveService
* fake_drive_service
,
172 const std::string
& parent_resource_id
,
173 const std::string
& title
,
174 const std::string
& last_modified
,
175 const std::string
& last_viewed_by_me
) {
176 google_apis::GDataErrorCode error
= google_apis::GDATA_OTHER_ERROR
;
177 scoped_ptr
<google_apis::ResourceEntry
> entry
;
178 fake_drive_service
->AddNewDirectory(
181 drive::DriveServiceInterface::AddNewDirectoryOptions(),
182 google_apis::test_util::CreateCopyResultCallback(&error
, &entry
));
183 base::RunLoop().RunUntilIdle();
184 if (error
!= google_apis::HTTP_CREATED
)
185 return scoped_ptr
<google_apis::ResourceEntry
>();
187 return UpdateDriveEntryTime(fake_drive_service
, entry
->resource_id(),
188 last_modified
, last_viewed_by_me
);
191 // Sets up the drive service state.
192 // The hierarchy is the same as for the local file system.
193 bool InitializeDriveService(
194 drive::FakeDriveService
* fake_drive_service
,
195 std::map
<std::string
, std::string
>* out_resource_ids
) {
196 scoped_ptr
<google_apis::ResourceEntry
> entry
;
198 entry
= AddDirectoryToDriveService(fake_drive_service
,
199 fake_drive_service
->GetRootResourceId(),
201 "2012-01-02T00:00:00.000Z",
202 "2012-01-02T00:00:01.000Z");
205 (*out_resource_ids
)[entry
->title()] = entry
->resource_id();
207 entry
= AddDirectoryToDriveService(fake_drive_service
,
208 (*out_resource_ids
)["test_dir"],
210 "2011-11-02T04:00:00.000Z",
211 "2011-11-02T04:00:00.000Z");
214 (*out_resource_ids
)[entry
->title()] = entry
->resource_id();
216 entry
= AddDirectoryToDriveService(fake_drive_service
,
217 (*out_resource_ids
)["test_dir"],
219 "2011-04-01T18:34:08.234Z",
220 "2012-01-02T00:00:01.000Z");
223 (*out_resource_ids
)[entry
->title()] = entry
->resource_id();
225 entry
= AddFileToDriveService(fake_drive_service
,
226 "application/vnd.mozilla.xul+xml",
228 (*out_resource_ids
)["test_dir"],
230 "2011-12-14T00:40:47.330Z",
231 "2012-01-02T00:00:00.000Z");
234 (*out_resource_ids
)[entry
->title()] = entry
->resource_id();
236 entry
= AddFileToDriveService(fake_drive_service
,
239 (*out_resource_ids
)["test_dir"],
241 "2012-01-01T10:00:30.000Z",
242 "2012-01-01T00:00:00.000Z");
245 (*out_resource_ids
)[entry
->title()] = entry
->resource_id();
247 entry
= AddFileToDriveService(fake_drive_service
,
250 (*out_resource_ids
)["test_dir"],
252 "2011-04-03T11:11:10.000Z",
253 "2012-01-02T00:00:00.000Z");
256 (*out_resource_ids
)[entry
->title()] = entry
->resource_id();
258 entry
= AddFileToDriveService(fake_drive_service
,
261 (*out_resource_ids
)["test_dir"],
262 "test_file.tiff.foo",
263 "2011-12-14T00:40:47.330Z",
264 "2010-01-02T00:00:00.000Z");
267 (*out_resource_ids
)[entry
->title()] = entry
->resource_id();
269 entry
= AddFileToDriveService(fake_drive_service
,
272 (*out_resource_ids
)["test_dir"],
273 "empty_test_file.foo",
274 "2011-12-14T00:40:47.330Z",
275 "2011-12-14T00:40:47.330Z");
278 (*out_resource_ids
)[entry
->title()] = entry
->resource_id();
283 // Helper class to wait for a background page to load or close again.
284 class BackgroundObserver
{
287 : page_created_(chrome::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY
,
288 content::NotificationService::AllSources()),
289 page_closed_(chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED
,
290 content::NotificationService::AllSources()) {
293 void WaitUntilLoaded() {
294 page_created_
.Wait();
297 void WaitUntilClosed() {
302 content::WindowedNotificationObserver page_created_
;
303 content::WindowedNotificationObserver page_closed_
;
306 // Base class for FileSystemExtensionApi tests.
307 class FileSystemExtensionApiTestBase
: public ExtensionApiTest
{
311 FLAGS_USE_FILE_HANDLER
= 1 << 1,
312 FLAGS_LAZY_FILE_HANDLER
= 1 << 2
315 FileSystemExtensionApiTestBase() {}
316 virtual ~FileSystemExtensionApiTestBase() {}
318 virtual void SetUp() OVERRIDE
{
319 InitTestFileSystem();
320 ExtensionApiTest::SetUp();
323 virtual void SetUpOnMainThread() OVERRIDE
{
325 ExtensionApiTest::SetUpOnMainThread();
328 // Runs a file system extension API test.
329 // It loads test component extension at |filebrowser_path| with manifest
330 // at |filebrowser_manifest|. The |filebrowser_manifest| should be a path
331 // relative to |filebrowser_path|. The method waits until the test extension
332 // sends test succeed or fail message. It returns true if the test succeeds.
333 // If |FLAGS_USE_FILE_HANDLER| flag is set, the file handler extension at path
334 // |filehandler_path| will be loaded before the file browser extension.
335 // If the flag FLAGS_LAZY_FILE_HANDLER is set, the file handler extension must
336 // not have persistent background page. The test will wait until the file
337 // handler's background page is closed after initial load before the file
338 // browser extension is loaded.
339 // If |RunFileSystemExtensionApiTest| fails, |message_| will contain a failure
341 bool RunFileSystemExtensionApiTest(
342 const std::string
& filebrowser_path
,
343 const base::FilePath::CharType
* filebrowser_manifest
,
344 const std::string
& filehandler_path
,
346 if (flags
& FLAGS_USE_FILE_HANDLER
) {
347 if (filehandler_path
.empty()) {
348 message_
= "Missing file handler path.";
352 BackgroundObserver page_complete
;
353 const Extension
* file_handler
=
354 LoadExtension(test_data_dir_
.AppendASCII(filehandler_path
));
358 if (flags
& FLAGS_LAZY_FILE_HANDLER
) {
359 page_complete
.WaitUntilClosed();
361 page_complete
.WaitUntilLoaded();
365 ResultCatcher catcher
;
367 const Extension
* file_browser
= LoadExtensionAsComponentWithManifest(
368 test_data_dir_
.AppendASCII(filebrowser_path
),
369 filebrowser_manifest
);
373 if (!catcher
.GetNextResult()) {
374 message_
= catcher
.message();
382 // Sets up initial test file system hierarchy.
383 virtual void InitTestFileSystem() = 0;
384 // Registers mount point used in the test.
385 virtual void AddTestMountPoint() = 0;
388 // Tests for a native local file system.
389 class LocalFileSystemExtensionApiTest
: public FileSystemExtensionApiTestBase
{
391 LocalFileSystemExtensionApiTest() {}
392 virtual ~LocalFileSystemExtensionApiTest() {}
394 // FileSystemExtensionApiTestBase OVERRIDE.
395 virtual void InitTestFileSystem() OVERRIDE
{
396 ASSERT_TRUE(InitializeLocalFileSystem(
397 kLocalMountPointName
, &tmp_dir_
, &mount_point_dir_
))
398 << "Failed to initialize file system.";
401 // FileSystemExtensionApiTestBase OVERRIDE.
402 virtual void AddTestMountPoint() OVERRIDE
{
403 EXPECT_TRUE(content::BrowserContext::GetMountPoints(browser()->profile())->
404 RegisterFileSystem(kLocalMountPointName
,
405 fileapi::kFileSystemTypeNativeLocal
,
406 fileapi::FileSystemMountOption(),
408 VolumeManager::Get(browser()->profile())->AddVolumeInfoForTesting(
409 mount_point_dir_
, VOLUME_TYPE_TESTING
, chromeos::DEVICE_TYPE_UNKNOWN
);
413 base::ScopedTempDir tmp_dir_
;
414 base::FilePath mount_point_dir_
;
417 // Tests for restricted native local file systems.
418 class RestrictedFileSystemExtensionApiTest
419 : public FileSystemExtensionApiTestBase
{
421 RestrictedFileSystemExtensionApiTest() {}
422 virtual ~RestrictedFileSystemExtensionApiTest() {}
424 // FileSystemExtensionApiTestBase OVERRIDE.
425 virtual void InitTestFileSystem() OVERRIDE
{
426 ASSERT_TRUE(InitializeLocalFileSystem(
427 kRestrictedMountPointName
, &tmp_dir_
, &mount_point_dir_
))
428 << "Failed to initialize file system.";
431 // FileSystemExtensionApiTestBase OVERRIDE.
432 virtual void AddTestMountPoint() OVERRIDE
{
433 EXPECT_TRUE(content::BrowserContext::GetMountPoints(browser()->profile())->
434 RegisterFileSystem(kRestrictedMountPointName
,
435 fileapi::kFileSystemTypeRestrictedNativeLocal
,
436 fileapi::FileSystemMountOption(),
438 VolumeManager::Get(browser()->profile())->AddVolumeInfoForTesting(
439 mount_point_dir_
, VOLUME_TYPE_TESTING
, chromeos::DEVICE_TYPE_UNKNOWN
);
443 base::ScopedTempDir tmp_dir_
;
444 base::FilePath mount_point_dir_
;
447 // Tests for a drive file system.
448 class DriveFileSystemExtensionApiTest
: public FileSystemExtensionApiTestBase
{
450 DriveFileSystemExtensionApiTest() : fake_drive_service_(NULL
) {}
451 virtual ~DriveFileSystemExtensionApiTest() {}
453 // FileSystemExtensionApiTestBase OVERRIDE.
454 virtual void InitTestFileSystem() OVERRIDE
{
455 // Set up cache root to be used by DriveIntegrationService. This has to be
456 // done before the browser is created because the service instance is
457 // initialized by EventRouter.
458 ASSERT_TRUE(test_cache_root_
.CreateUniqueTempDir());
460 // This callback will get called during Profile creation.
461 create_drive_integration_service_
= base::Bind(
462 &DriveFileSystemExtensionApiTest::CreateDriveIntegrationService
,
463 base::Unretained(this));
464 service_factory_for_test_
.reset(
465 new DriveIntegrationServiceFactory::ScopedFactoryForTest(
466 &create_drive_integration_service_
));
469 // FileSystemExtensionApiTestBase OVERRIDE.
470 virtual void AddTestMountPoint() OVERRIDE
{
471 test_util::WaitUntilDriveMountPointIsAdded(browser()->profile());
475 // DriveIntegrationService factory function for this test.
476 drive::DriveIntegrationService
* CreateDriveIntegrationService(
478 fake_drive_service_
= new drive::FakeDriveService
;
479 fake_drive_service_
->LoadAppListForDriveApi("drive/applist.json");
481 std::map
<std::string
, std::string
> resource_ids
;
482 EXPECT_TRUE(InitializeDriveService(fake_drive_service_
, &resource_ids
));
484 return new drive::DriveIntegrationService(
486 fake_drive_service_
, "drive", test_cache_root_
.path(), NULL
);
489 base::ScopedTempDir test_cache_root_
;
490 drive::FakeDriveService
* fake_drive_service_
;
491 DriveIntegrationServiceFactory::FactoryCallback
492 create_drive_integration_service_
;
493 scoped_ptr
<DriveIntegrationServiceFactory::ScopedFactoryForTest
>
494 service_factory_for_test_
;
497 // Tests for Drive file systems in multi-profile setting.
498 class MultiProfileDriveFileSystemExtensionApiTest
:
499 public FileSystemExtensionApiTestBase
{
501 MultiProfileDriveFileSystemExtensionApiTest() : second_profile(NULL
) {}
503 virtual void SetUpOnMainThread() OVERRIDE
{
504 // Set up the secondary profile.
505 base::FilePath profile_dir
;
506 base::CreateNewTempDirectory(base::FilePath::StringType(), &profile_dir
);
507 profile_dir
= profile_dir
.AppendASCII(
508 std::string(chrome::kProfileDirPrefix
) + "fileBrowserApiTestProfile2");
510 g_browser_process
->profile_manager()->GetProfile(profile_dir
);
512 FileSystemExtensionApiTestBase::SetUpOnMainThread();
515 virtual void InitTestFileSystem() OVERRIDE
{
516 // This callback will get called during Profile creation.
517 create_drive_integration_service_
= base::Bind(
518 &MultiProfileDriveFileSystemExtensionApiTest::
519 CreateDriveIntegrationService
,
520 base::Unretained(this));
521 service_factory_for_test_
.reset(
522 new DriveIntegrationServiceFactory::ScopedFactoryForTest(
523 &create_drive_integration_service_
));
526 virtual void AddTestMountPoint() OVERRIDE
{
527 test_util::WaitUntilDriveMountPointIsAdded(browser()->profile());
528 test_util::WaitUntilDriveMountPointIsAdded(second_profile
);
532 // DriveIntegrationService factory function for this test.
533 drive::DriveIntegrationService
* CreateDriveIntegrationService(
535 base::FilePath cache_dir
;
536 base::CreateNewTempDirectory(base::FilePath::StringType(), &cache_dir
);
538 drive::FakeDriveService
* const fake_drive_service
=
539 new drive::FakeDriveService
;
540 fake_drive_service
->LoadAppListForDriveApi("drive/applist.json");
541 EXPECT_TRUE(InitializeDriveService(fake_drive_service
, &resource_ids_
));
543 return new drive::DriveIntegrationService(
544 profile
, NULL
, fake_drive_service
, std::string(), cache_dir
, NULL
);
547 bool AddTestHostedDocuments() {
548 const char kResourceId
[] = "unique-id-for-multiprofile-copy-test";
549 drive::FakeDriveService
* const main_service
=
550 static_cast<drive::FakeDriveService
*>(
551 drive::util::GetDriveServiceByProfile(browser()->profile()));
552 drive::FakeDriveService
* const sub_service
=
553 static_cast<drive::FakeDriveService
*>(
554 drive::util::GetDriveServiceByProfile(second_profile
));
556 google_apis::GDataErrorCode error
= google_apis::GDATA_OTHER_ERROR
;
557 scoped_ptr
<google_apis::ResourceEntry
> entry
;
559 // Place a hosted document under root/test_dir of the sub profile.
560 sub_service
->AddNewFileWithResourceId(
562 "application/vnd.google-apps.document", "",
563 resource_ids_
["test_dir"], "hosted_doc", true,
564 google_apis::test_util::CreateCopyResultCallback(&error
, &entry
));
565 drive::test_util::RunBlockingPoolTask();
566 if (error
!= google_apis::HTTP_CREATED
)
569 // Place the hosted document with no parent in the main profile, for
570 // simulating the situation that the document is shared to the main profile.
571 error
= google_apis::GDATA_OTHER_ERROR
;
572 main_service
->AddNewFileWithResourceId(
574 "application/vnd.google-apps.document", "", "", "hosted_doc", true,
575 google_apis::test_util::CreateCopyResultCallback(&error
, &entry
));
576 drive::test_util::RunBlockingPoolTask();
577 return (error
== google_apis::HTTP_CREATED
);
580 DriveIntegrationServiceFactory::FactoryCallback
581 create_drive_integration_service_
;
582 scoped_ptr
<DriveIntegrationServiceFactory::ScopedFactoryForTest
>
583 service_factory_for_test_
;
584 Profile
* second_profile
;
585 std::map
<std::string
, std::string
> resource_ids_
;
589 // LocalFileSystemExtensionApiTests.
592 IN_PROC_BROWSER_TEST_F(LocalFileSystemExtensionApiTest
, FileSystemOperations
) {
593 EXPECT_TRUE(RunFileSystemExtensionApiTest(
594 "file_browser/filesystem_operations_test",
595 FILE_PATH_LITERAL("manifest.json"),
597 FLAGS_NONE
)) << message_
;
600 IN_PROC_BROWSER_TEST_F(LocalFileSystemExtensionApiTest
, FileWatch
) {
601 EXPECT_TRUE(RunFileSystemExtensionApiTest(
602 "file_browser/file_watcher_test",
603 FILE_PATH_LITERAL("manifest.json"),
605 FLAGS_NONE
)) << message_
;
608 IN_PROC_BROWSER_TEST_F(LocalFileSystemExtensionApiTest
, FileBrowserHandlers
) {
609 EXPECT_TRUE(RunFileSystemExtensionApiTest(
610 "file_browser/handler_test_runner",
611 FILE_PATH_LITERAL("manifest.json"),
612 "file_browser/file_browser_handler",
613 FLAGS_USE_FILE_HANDLER
)) << message_
;
616 IN_PROC_BROWSER_TEST_F(LocalFileSystemExtensionApiTest
,
617 FileBrowserHandlersLazy
) {
618 EXPECT_TRUE(RunFileSystemExtensionApiTest(
619 "file_browser/handler_test_runner",
620 FILE_PATH_LITERAL("manifest.json"),
621 "file_browser/file_browser_handler_lazy",
622 FLAGS_USE_FILE_HANDLER
| FLAGS_LAZY_FILE_HANDLER
)) << message_
;
625 IN_PROC_BROWSER_TEST_F(LocalFileSystemExtensionApiTest
, AppFileHandler
) {
626 EXPECT_TRUE(RunFileSystemExtensionApiTest(
627 "file_browser/handler_test_runner",
628 FILE_PATH_LITERAL("manifest.json"),
629 "file_browser/app_file_handler",
630 FLAGS_USE_FILE_HANDLER
)) << message_
;
634 // RestrictedFileSystemExtensionApiTests.
636 IN_PROC_BROWSER_TEST_F(RestrictedFileSystemExtensionApiTest
,
637 FileSystemOperations
) {
638 EXPECT_TRUE(RunFileSystemExtensionApiTest(
639 "file_browser/filesystem_operations_test",
640 FILE_PATH_LITERAL("manifest.json"),
642 FLAGS_NONE
)) << message_
;
646 // DriveFileSystemExtensionApiTests.
648 IN_PROC_BROWSER_TEST_F(DriveFileSystemExtensionApiTest
, FileSystemOperations
) {
649 EXPECT_TRUE(RunFileSystemExtensionApiTest(
650 "file_browser/filesystem_operations_test",
651 FILE_PATH_LITERAL("manifest.json"),
653 FLAGS_NONE
)) << message_
;
656 IN_PROC_BROWSER_TEST_F(DriveFileSystemExtensionApiTest
, FileWatch
) {
657 EXPECT_TRUE(RunFileSystemExtensionApiTest(
658 "file_browser/file_watcher_test",
659 FILE_PATH_LITERAL("manifest.json"),
661 FLAGS_NONE
)) << message_
;
664 IN_PROC_BROWSER_TEST_F(DriveFileSystemExtensionApiTest
, FileBrowserHandlers
) {
665 EXPECT_TRUE(RunFileSystemExtensionApiTest(
666 "file_browser/handler_test_runner",
667 FILE_PATH_LITERAL("manifest.json"),
668 "file_browser/file_browser_handler",
669 FLAGS_USE_FILE_HANDLER
)) << message_
;
672 IN_PROC_BROWSER_TEST_F(DriveFileSystemExtensionApiTest
, Search
) {
673 // Configure the drive service to return only one search result at a time
674 // to simulate paginated searches.
675 fake_drive_service_
->set_default_max_results(1);
676 EXPECT_TRUE(RunFileSystemExtensionApiTest(
677 "file_browser/drive_search_test",
678 FILE_PATH_LITERAL("manifest.json"),
680 FLAGS_NONE
)) << message_
;
683 IN_PROC_BROWSER_TEST_F(DriveFileSystemExtensionApiTest
, AppFileHandler
) {
684 EXPECT_TRUE(RunFileSystemExtensionApiTest(
685 "file_browser/handler_test_runner",
686 FILE_PATH_LITERAL("manifest.json"),
687 "file_browser/app_file_handler",
688 FLAGS_USE_FILE_HANDLER
)) << message_
;
691 IN_PROC_BROWSER_TEST_F(MultiProfileDriveFileSystemExtensionApiTest
,
693 ASSERT_TRUE(AddTestHostedDocuments());
694 EXPECT_TRUE(RunFileSystemExtensionApiTest(
695 "file_browser/multi_profile_copy",
696 FILE_PATH_LITERAL("manifest.json"),
698 FLAGS_NONE
)) << message_
;
702 } // namespace file_manager