OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 // Browser test for basic Chrome OS file manager functionality: | 5 // Browser test for basic Chrome OS file manager functionality: |
6 // - The file list is updated when a file is added externally to the Downloads | 6 // - The file list is updated when a file is added externally to the Downloads |
7 // folder. | 7 // folder. |
8 // - Selecting a file and copy-pasting it with the keyboard copies the file. | 8 // - Selecting a file and copy-pasting it with the keyboard copies the file. |
9 // - Selecting a file and pressing delete deletes it. | 9 // - Selecting a file and pressing delete deletes it. |
10 | 10 |
(...skipping 29 matching lines...) Expand all Loading... | |
40 enum EntryType { | 40 enum EntryType { |
41 FILE, | 41 FILE, |
42 DIRECTORY, | 42 DIRECTORY, |
43 }; | 43 }; |
44 | 44 |
45 enum SharedOption { | 45 enum SharedOption { |
46 NONE, | 46 NONE, |
47 SHARED, | 47 SHARED, |
48 }; | 48 }; |
49 | 49 |
50 enum GuestMode { | |
51 NOT_IN_GUEST_MODE, | |
52 IN_GUEST_MODE | |
53 }; | |
54 | |
55 // This global operator is used from Google Test to format error messages. | |
56 std::ostream& operator<<(std::ostream& os, const GuestMode& guest_mode) { | |
57 return os << (guest_mode == IN_GUEST_MODE ? | |
58 "IN_GUEST_MODE" : "NOT_IN_GUEST_MODE"); | |
59 } | |
60 | |
50 struct TestEntryInfo { | 61 struct TestEntryInfo { |
51 EntryType type; | 62 EntryType type; |
52 const char* source_file_name; // Source file name to be used as a prototype. | 63 const char* source_file_name; // Source file name to be used as a prototype. |
53 const char* target_name; // Target file or directory name. | 64 const char* target_name; // Target file or directory name. |
54 const char* mime_type; | 65 const char* mime_type; |
55 SharedOption shared_option; | 66 SharedOption shared_option; |
56 const char* last_modified_time_as_string; | 67 const char* last_modified_time_as_string; |
57 }; | 68 }; |
58 | 69 |
59 TestEntryInfo kTestEntrySetCommon[] = { | 70 TestEntryInfo kTestEntrySetCommon[] = { |
(...skipping 19 matching lines...) Expand all Loading... | |
79 // Sub-classes of this class are used by test cases and provide operations such | 90 // Sub-classes of this class are used by test cases and provide operations such |
80 // as creating files for each type of test volume. | 91 // as creating files for each type of test volume. |
81 class TestVolume { | 92 class TestVolume { |
82 public: | 93 public: |
83 virtual ~TestVolume() {} | 94 virtual ~TestVolume() {} |
84 | 95 |
85 // Creates an entry with given information. | 96 // Creates an entry with given information. |
86 virtual void CreateEntry(const TestEntryInfo& entry) = 0; | 97 virtual void CreateEntry(const TestEntryInfo& entry) = 0; |
87 | 98 |
88 // Returns the name of volume such as "Downloads" or "Drive". | 99 // Returns the name of volume such as "Downloads" or "Drive". |
89 virtual std::string GetName() const = 0; | 100 virtual std::string GetName() const = 0; |
hashimoto
2013/06/03 10:28:07
nit: It seems we no longer need to maintain this m
hirono
2013/06/03 10:52:57
Done.
| |
90 }; | 101 }; |
91 | 102 |
92 // The local volume class for test. | 103 // The local volume class for test. |
93 // This class provides the operations for a test volume that simulates local | 104 // This class provides the operations for a test volume that simulates local |
94 // drive. | 105 // drive. |
95 class LocalTestVolume : public TestVolume { | 106 class LocalTestVolume : public TestVolume { |
96 public: | 107 public: |
97 explicit LocalTestVolume(const std::string& mount_name) | 108 explicit LocalTestVolume(const std::string& mount_name) |
98 : mount_name_(mount_name) { | 109 : mount_name_(mount_name) { |
99 } | 110 } |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
228 time, | 239 time, |
229 google_apis::test_util::CreateCopyResultCallback(&error, | 240 google_apis::test_util::CreateCopyResultCallback(&error, |
230 &resource_entry)); | 241 &resource_entry)); |
231 base::MessageLoop::current()->RunUntilIdle(); | 242 base::MessageLoop::current()->RunUntilIdle(); |
232 ASSERT_TRUE(error == google_apis::HTTP_SUCCESS); | 243 ASSERT_TRUE(error == google_apis::HTTP_SUCCESS); |
233 ASSERT_TRUE(resource_entry); | 244 ASSERT_TRUE(resource_entry); |
234 CheckForUpdates(); | 245 CheckForUpdates(); |
235 } | 246 } |
236 | 247 |
237 virtual std::string GetName() const OVERRIDE { | 248 virtual std::string GetName() const OVERRIDE { |
238 return "Drive"; | 249 return kDriveVolume; |
239 } | 250 } |
240 | 251 |
241 // Creates a test file with the given spec. | 252 // Creates a test file with the given spec. |
242 // Serves |test_file_name| file. Pass an empty string for an empty file. | 253 // Serves |test_file_name| file. Pass an empty string for an empty file. |
243 void CreateFile(const std::string& source_file_name, | 254 void CreateFile(const std::string& source_file_name, |
244 const std::string& target_file_name, | 255 const std::string& target_file_name, |
245 const std::string& mime_type, | 256 const std::string& mime_type, |
246 bool shared_with_me, | 257 bool shared_with_me, |
247 const std::string& modification_time) { | 258 const std::string& modification_time) { |
248 google_apis::GDataErrorCode error = google_apis::GDATA_OTHER_ERROR; | 259 google_apis::GDataErrorCode error = google_apis::GDATA_OTHER_ERROR; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
305 NULL); | 316 NULL); |
306 return integration_service_; | 317 return integration_service_; |
307 } | 318 } |
308 | 319 |
309 private: | 320 private: |
310 base::ScopedTempDir test_cache_root_; | 321 base::ScopedTempDir test_cache_root_; |
311 google_apis::FakeDriveService* fake_drive_service_; | 322 google_apis::FakeDriveService* fake_drive_service_; |
312 drive::DriveIntegrationService* integration_service_; | 323 drive::DriveIntegrationService* integration_service_; |
313 }; | 324 }; |
314 | 325 |
315 // The base test class. Used by FileManagerBrowserLocalTest, | 326 // Parameter of FileManagerBrowserTestBase. |
316 // FileManagerBrowserDriveTest, and FileManagerBrowserTransferTest. | 327 // The second value is the case name of javascript. |
317 // The boolean parameter, retrieved by GetParam(), is true if testing in the | 328 typedef std::tr1::tuple<GuestMode, const char*> TestParameter; |
318 // guest mode. See SetUpCommandLine() below for details. | 329 |
319 class FileManagerBrowserTestBase : public ExtensionApiTest, | 330 // The base test class. |
320 public ::testing::WithParamInterface<bool> { | 331 class FileManagerBrowserTestBase : |
332 public ExtensionApiTest, | |
333 public ::testing::WithParamInterface<TestParameter> { | |
321 protected: | 334 protected: |
335 explicit FileManagerBrowserTestBase() : | |
hashimoto
2013/06/03 10:28:07
nit: No need to have 'explicit'
hirono
2013/06/03 10:52:57
Done.
| |
336 local_volume_(new LocalTestVolume(kDownloadsVolume)), | |
337 drive_volume_(std::tr1::get<0>(GetParam()) != IN_GUEST_MODE ? | |
338 new DriveTestVolume() : NULL), | |
339 guest_mode_(std::tr1::get<0>(GetParam())) {} | |
340 | |
341 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE; | |
342 | |
343 virtual void SetUpOnMainThread() OVERRIDE; | |
344 | |
322 // Adds an incognito and guest-mode flags for tests in the guest mode. | 345 // Adds an incognito and guest-mode flags for tests in the guest mode. |
323 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; | 346 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; |
324 | 347 |
325 // Loads our testing extension and sends it a string identifying the current | 348 // Loads our testing extension and sends it a string identifying the current |
326 // test. | 349 // test. |
327 void StartTest(const std::string& test_name); | 350 void StartTest(); |
328 | 351 |
329 // Creates test files and directories. | 352 // Creates test files and directories. |
330 void CreateTestEntries(TestVolume* volume, const TestEntryInfo* entries, | 353 void CreateTestEntries(TestVolume* volume, |
354 const TestEntryInfo* entries, | |
331 size_t num_entries); | 355 size_t num_entries); |
332 | 356 |
333 // Runs the file display test on the passed |volume|, shared by subclasses. | 357 protected: |
334 void DoTestFileDisplay(TestVolume* volume); | 358 const scoped_ptr<LocalTestVolume> local_volume_; |
359 const scoped_ptr<DriveTestVolume> drive_volume_; | |
360 | |
361 private: | |
362 GuestMode guest_mode_; | |
335 }; | 363 }; |
336 | 364 |
365 void FileManagerBrowserTestBase::SetUpInProcessBrowserTestFixture() { | |
366 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); | |
367 extensions::ComponentLoader::EnableBackgroundExtensionsForTesting(); | |
368 if (drive_volume_) | |
369 ASSERT_TRUE(drive_volume_->SetUp()); | |
370 } | |
371 | |
372 void FileManagerBrowserTestBase::SetUpOnMainThread() { | |
373 ExtensionApiTest::SetUpOnMainThread(); | |
374 if (local_volume_) { | |
hashimoto
2013/06/03 10:28:07
nit: Now local_volume_ never gets NULL.
hirono
2013/06/03 10:52:57
Done.
| |
375 ASSERT_TRUE(local_volume_->Mount(browser()->profile())); | |
376 CreateTestEntries(local_volume_.get(), | |
377 kTestEntrySetCommon, | |
378 arraysize(kTestEntrySetCommon)); | |
379 } | |
380 if (drive_volume_) { | |
381 CreateTestEntries(drive_volume_.get(), | |
382 kTestEntrySetCommon, | |
383 arraysize(kTestEntrySetCommon)); | |
384 // For testing Drive, create more entries with Drive specific attributes. | |
385 // TODO(haruki): Add a case for an entry cached by DriveCache. | |
386 CreateTestEntries(drive_volume_.get(), | |
387 kTestEntrySetDriveOnly, | |
388 arraysize(kTestEntrySetDriveOnly)); | |
389 drive_test_util::WaitUntilDriveMountPointIsAdded(browser()->profile()); | |
390 } | |
391 } | |
392 | |
337 void FileManagerBrowserTestBase::SetUpCommandLine(CommandLine* command_line) { | 393 void FileManagerBrowserTestBase::SetUpCommandLine(CommandLine* command_line) { |
338 bool in_guest_mode = GetParam(); | 394 if (guest_mode_ == IN_GUEST_MODE) { |
339 if (in_guest_mode) { | |
340 command_line->AppendSwitch(chromeos::switches::kGuestSession); | 395 command_line->AppendSwitch(chromeos::switches::kGuestSession); |
341 command_line->AppendSwitchNative(chromeos::switches::kLoginUser, ""); | 396 command_line->AppendSwitchNative(chromeos::switches::kLoginUser, ""); |
342 command_line->AppendSwitch(switches::kIncognito); | 397 command_line->AppendSwitch(switches::kIncognito); |
343 } | 398 } |
344 ExtensionApiTest::SetUpCommandLine(command_line); | 399 ExtensionApiTest::SetUpCommandLine(command_line); |
345 } | 400 } |
346 | 401 |
347 void FileManagerBrowserTestBase::StartTest(const std::string& test_name) { | 402 void FileManagerBrowserTestBase::StartTest() { |
348 base::FilePath path = test_data_dir_.AppendASCII("file_manager_browsertest"); | 403 base::FilePath path = test_data_dir_.AppendASCII("file_manager_browsertest"); |
349 const extensions::Extension* extension = LoadExtensionAsComponent(path); | 404 const extensions::Extension* extension = LoadExtensionAsComponent(path); |
350 ASSERT_TRUE(extension); | 405 ASSERT_TRUE(extension); |
351 | 406 |
352 bool in_guest_mode = GetParam(); | 407 bool in_guest_mode = guest_mode_ == IN_GUEST_MODE; |
353 ExtensionTestMessageListener listener( | 408 ExtensionTestMessageListener listener( |
354 in_guest_mode ? "which test guest" : "which test non-guest", true); | 409 in_guest_mode ? "which test guest" : "which test non-guest", true); |
355 ASSERT_TRUE(listener.WaitUntilSatisfied()); | 410 ASSERT_TRUE(listener.WaitUntilSatisfied()); |
356 listener.Reply(test_name); | 411 listener.Reply(std::tr1::get<1>(GetParam())); |
357 } | 412 } |
358 | 413 |
359 void FileManagerBrowserTestBase::CreateTestEntries( | 414 void FileManagerBrowserTestBase::CreateTestEntries( |
360 TestVolume* volume, const TestEntryInfo* entries, size_t num_entries) { | 415 TestVolume* volume, const TestEntryInfo* entries, size_t num_entries) { |
361 for (size_t i = 0; i < num_entries; ++i) { | 416 for (size_t i = 0; i < num_entries; ++i) { |
362 volume->CreateEntry(entries[i]); | 417 volume->CreateEntry(entries[i]); |
363 } | 418 } |
364 } | 419 } |
365 | 420 |
366 void FileManagerBrowserTestBase::DoTestFileDisplay(TestVolume* volume) { | 421 class FileManagerBrowserFileDisplayTest : public FileManagerBrowserTestBase {}; |
422 | |
423 IN_PROC_BROWSER_TEST_P(FileManagerBrowserFileDisplayTest, Test) { | |
367 ResultCatcher catcher; | 424 ResultCatcher catcher; |
368 ASSERT_NO_FATAL_FAILURE(StartTest("fileDisplay" + volume->GetName())); | 425 ASSERT_NO_FATAL_FAILURE(StartTest()); |
369 | 426 |
370 ExtensionTestMessageListener listener("initial check done", true); | 427 ExtensionTestMessageListener listener("initial check done", true); |
371 ASSERT_TRUE(listener.WaitUntilSatisfied()); | 428 ASSERT_TRUE(listener.WaitUntilSatisfied()); |
372 const TestEntryInfo entry = { | 429 const TestEntryInfo entry = { |
373 FILE, | 430 FILE, |
374 "music.ogg", // Prototype file name. | 431 "music.ogg", // Prototype file name. |
375 "newly added file.ogg", // Target file name. | 432 "newly added file.ogg", // Target file name. |
376 "audio/ogg", | 433 "audio/ogg", |
377 NONE, | 434 NONE, |
378 "4 Sep 1998 00:00:00" | 435 "4 Sep 1998 00:00:00" |
379 }; | 436 }; |
380 volume->CreateEntry(entry); | 437 if (drive_volume_) |
438 drive_volume_->CreateEntry(entry); | |
439 local_volume_->CreateEntry(entry); | |
381 listener.Reply("file added"); | 440 listener.Reply("file added"); |
382 | 441 |
383 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 442 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); |
384 } | 443 } |
385 | 444 |
386 // A class to test local volumes. | 445 INSTANTIATE_TEST_CASE_P( |
387 class FileManagerBrowserLocalTest : public FileManagerBrowserTestBase { | 446 AllTests, |
388 public: | 447 FileManagerBrowserFileDisplayTest, |
389 FileManagerBrowserLocalTest() : volume_("Downloads") {} | 448 ::testing::Values(TestParameter(NOT_IN_GUEST_MODE, "fileDisplayDownloads"), |
449 TestParameter(IN_GUEST_MODE, "fileDisplayDownloads"), | |
450 TestParameter(NOT_IN_GUEST_MODE, "fileDisplayDrive"))); | |
390 | 451 |
391 protected: | 452 // A test class that just executes JavaScript unit test. |
392 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 453 class FileManagerBrowserSimpleTest : public FileManagerBrowserTestBase {}; |
393 FileManagerBrowserTestBase::SetUpInProcessBrowserTestFixture(); | |
394 extensions::ComponentLoader::EnableBackgroundExtensionsForTesting(); | |
395 } | |
396 | 454 |
397 virtual void SetUpOnMainThread() OVERRIDE { | 455 IN_PROC_BROWSER_TEST_P(FileManagerBrowserSimpleTest, Test) { |
398 FileManagerBrowserTestBase::SetUpOnMainThread(); | |
399 ASSERT_TRUE(volume_.Mount(browser()->profile())); | |
400 CreateTestEntries(&volume_, kTestEntrySetCommon, | |
401 arraysize(kTestEntrySetCommon)); | |
402 } | |
403 | |
404 LocalTestVolume volume_; | |
405 }; | |
406 | |
407 INSTANTIATE_TEST_CASE_P(InGuestMode, | |
408 FileManagerBrowserLocalTest, | |
409 ::testing::Values(true)); | |
410 | |
411 INSTANTIATE_TEST_CASE_P(InNonGuestMode, | |
412 FileManagerBrowserLocalTest, | |
413 ::testing::Values(false)); | |
414 | |
415 // A class to test Drive's volumes | |
416 class FileManagerBrowserDriveTest : public FileManagerBrowserTestBase { | |
417 protected: | |
418 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | |
419 FileManagerBrowserTestBase::SetUpInProcessBrowserTestFixture(); | |
420 extensions::ComponentLoader::EnableBackgroundExtensionsForTesting(); | |
421 ASSERT_TRUE(volume_.SetUp()); | |
422 } | |
423 | |
424 virtual void SetUpOnMainThread() OVERRIDE { | |
425 FileManagerBrowserTestBase::SetUpOnMainThread(); | |
426 CreateTestEntries(&volume_, kTestEntrySetCommon, | |
427 arraysize(kTestEntrySetCommon)); | |
428 // For testing Drive, create more entries with Drive specific attributes. | |
429 // TODO(haruki): Add a case for an entry cached by DriveCache. | |
430 CreateTestEntries(&volume_, kTestEntrySetDriveOnly, | |
431 arraysize(kTestEntrySetDriveOnly)); | |
432 drive_test_util::WaitUntilDriveMountPointIsAdded(browser()->profile()); | |
433 } | |
434 | |
435 DriveTestVolume volume_; | |
436 }; | |
437 | |
438 // Don't test Drive in the guest mode as it's not supported. | |
439 INSTANTIATE_TEST_CASE_P(InNonGuestMode, | |
440 FileManagerBrowserDriveTest, | |
441 ::testing::Values(false)); | |
442 | |
443 // A class to test both local and Drive's volumes. | |
444 class FileManagerBrowserTransferTest : public FileManagerBrowserTestBase { | |
445 public: | |
446 FileManagerBrowserTransferTest() : local_volume_("Downloads") {} | |
447 | |
448 protected: | |
449 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | |
450 FileManagerBrowserTestBase::SetUpInProcessBrowserTestFixture(); | |
451 extensions::ComponentLoader::EnableBackgroundExtensionsForTesting(); | |
452 ASSERT_TRUE(drive_volume_.SetUp()); | |
453 } | |
454 | |
455 virtual void SetUpOnMainThread() OVERRIDE { | |
456 FileManagerBrowserTestBase::SetUpOnMainThread(); | |
457 ASSERT_TRUE(local_volume_.Mount(browser()->profile())); | |
458 CreateTestEntries(&local_volume_, kTestEntrySetCommon, | |
459 arraysize(kTestEntrySetCommon)); | |
460 CreateTestEntries(&drive_volume_, kTestEntrySetCommon, | |
461 arraysize(kTestEntrySetCommon)); | |
462 CreateTestEntries(&drive_volume_, kTestEntrySetDriveOnly, | |
463 arraysize(kTestEntrySetDriveOnly)); | |
464 drive_test_util::WaitUntilDriveMountPointIsAdded(browser()->profile()); | |
465 } | |
466 | |
467 LocalTestVolume local_volume_; | |
468 DriveTestVolume drive_volume_; | |
469 }; | |
470 | |
471 // FileManagerBrowserTransferTest depends on Drive and Drive is not supported in | |
472 // the guest mode. | |
473 INSTANTIATE_TEST_CASE_P(InNonGuestMode, | |
474 FileManagerBrowserTransferTest, | |
475 ::testing::Values(false)); | |
476 | |
477 IN_PROC_BROWSER_TEST_P(FileManagerBrowserLocalTest, TestFileDisplay) { | |
478 DoTestFileDisplay(&volume_); | |
479 } | |
480 | |
481 IN_PROC_BROWSER_TEST_P(FileManagerBrowserLocalTest, TestGalleryOpen) { | |
482 ResultCatcher catcher; | 456 ResultCatcher catcher; |
483 ASSERT_NO_FATAL_FAILURE(StartTest("galleryOpenDownloads")); | 457 ASSERT_NO_FATAL_FAILURE(StartTest()); |
484 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 458 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); |
485 } | 459 } |
486 | 460 |
487 IN_PROC_BROWSER_TEST_P(FileManagerBrowserLocalTest, TestKeyboardDelete) { | 461 INSTANTIATE_TEST_CASE_P( |
488 ResultCatcher catcher; | 462 OpenSpecialTypes, |
489 ASSERT_NO_FATAL_FAILURE(StartTest("keyboardDeleteDownloads")); | 463 FileManagerBrowserSimpleTest, |
490 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 464 ::testing::Values(TestParameter(IN_GUEST_MODE, "videoOpenDownloads"), |
491 } | 465 TestParameter(NOT_IN_GUEST_MODE, "videoOpenDownloads"), |
466 TestParameter(NOT_IN_GUEST_MODE, "videoOpenDrive"), | |
467 TestParameter(IN_GUEST_MODE, "audioOpenDownloads"), | |
468 TestParameter(NOT_IN_GUEST_MODE, "audioOpenDownloads"), | |
469 TestParameter(NOT_IN_GUEST_MODE, "audioOpenDrive"), | |
470 TestParameter(IN_GUEST_MODE, "galleryOpenDownloads"), | |
471 TestParameter(NOT_IN_GUEST_MODE, | |
472 "galleryOpenDownloads"))); | |
473 // Disabled temporarily since fails on Linux Chromium OS | |
474 // ASAN Tests (2). TODO(mtomasz): crbug.com/243611. | |
475 // TestParameter(NOT_IN_GUEST_MODE, "galleryOpenDrive"))); | |
492 | 476 |
493 // Disabled temporarily since fails on Linux Chromium OS ASAN Tests (2). | 477 INSTANTIATE_TEST_CASE_P( |
494 // TODO(mtomasz): crbug.com/243611. | 478 KeyboardOpeartions, |
495 IN_PROC_BROWSER_TEST_P(FileManagerBrowserDriveTest, DISABLED_TestGalleryOpen) { | 479 FileManagerBrowserSimpleTest, |
496 ResultCatcher catcher; | 480 ::testing::Values(TestParameter(IN_GUEST_MODE, "keyboardDeleteDownloads"), |
497 ASSERT_NO_FATAL_FAILURE(StartTest("galleryOpenDrive")); | 481 TestParameter(NOT_IN_GUEST_MODE, |
498 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 482 "keyboardDeleteDownloads"), |
499 } | 483 TestParameter(NOT_IN_GUEST_MODE, "keyboardDeleteDrive"), |
484 TestParameter(IN_GUEST_MODE, "keyboardCopyDownloads"), | |
485 TestParameter(NOT_IN_GUEST_MODE, "keyboardCopyDownloads"), | |
486 TestParameter(NOT_IN_GUEST_MODE, "keyboardCopyDrive"))); | |
500 | 487 |
501 IN_PROC_BROWSER_TEST_P(FileManagerBrowserLocalTest, TestAudioOpen) { | 488 INSTANTIATE_TEST_CASE_P( |
502 ResultCatcher catcher; | 489 DriveSpecific, |
503 ASSERT_NO_FATAL_FAILURE(StartTest("galleryOpenDownloads")); | 490 FileManagerBrowserSimpleTest, |
504 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message();} | 491 ::testing::Values(TestParameter(NOT_IN_GUEST_MODE, "openSidebarRecent"), |
492 TestParameter(NOT_IN_GUEST_MODE, "openSidebarOffline"), | |
493 TestParameter(NOT_IN_GUEST_MODE, | |
494 "openSidebarSharedWithMe"), | |
495 TestParameter(NOT_IN_GUEST_MODE, "autocomplete"))); | |
505 | 496 |
506 IN_PROC_BROWSER_TEST_P(FileManagerBrowserDriveTest, TestAudioOpen) { | 497 INSTANTIATE_TEST_CASE_P( |
507 ResultCatcher catcher; | 498 Transfer, |
508 ASSERT_NO_FATAL_FAILURE(StartTest("galleryOpenDrive")); | 499 FileManagerBrowserSimpleTest, |
509 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 500 ::testing::Values(TestParameter(NOT_IN_GUEST_MODE, |
510 } | 501 "transferFromDriveToDownloads"), |
511 | 502 TestParameter(NOT_IN_GUEST_MODE, |
512 IN_PROC_BROWSER_TEST_P(FileManagerBrowserLocalTest, TestVideoOpen) { | 503 "transferFromDownloadsToDrive"), |
513 ResultCatcher catcher; | 504 TestParameter(NOT_IN_GUEST_MODE, |
514 ASSERT_NO_FATAL_FAILURE(StartTest("galleryOpenDownloads")); | 505 "transferFromSharedToDownloads"), |
515 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 506 TestParameter(NOT_IN_GUEST_MODE, |
516 } | 507 "transferFromSharedToDrive"), |
517 | 508 TestParameter(NOT_IN_GUEST_MODE, |
518 IN_PROC_BROWSER_TEST_P(FileManagerBrowserDriveTest, TestVideoOpen) { | 509 "transferFromRecentToDownloads"), |
519 ResultCatcher catcher; | 510 TestParameter(NOT_IN_GUEST_MODE, |
520 ASSERT_NO_FATAL_FAILURE(StartTest("galleryOpenDrive")); | 511 "transferFromRecentToDrive"), |
521 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 512 TestParameter(NOT_IN_GUEST_MODE, |
522 } | 513 "transferFromOfflineToDownloads"), |
523 | 514 TestParameter(NOT_IN_GUEST_MODE, |
524 IN_PROC_BROWSER_TEST_P(FileManagerBrowserDriveTest, TestKeyboardCopy) { | 515 "transferFromOfflineToDrive"))); |
525 ResultCatcher catcher; | |
526 ASSERT_NO_FATAL_FAILURE(StartTest("keyboardCopyDrive")); | |
527 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | |
528 } | |
529 | |
530 IN_PROC_BROWSER_TEST_P(FileManagerBrowserDriveTest, TestKeyboardDelete) { | |
531 ResultCatcher catcher; | |
532 ASSERT_NO_FATAL_FAILURE(StartTest("keyboardDeleteDrive")); | |
533 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | |
534 } | |
535 | |
536 IN_PROC_BROWSER_TEST_P(FileManagerBrowserDriveTest, TestOpenRecent) { | |
537 ResultCatcher catcher; | |
538 ASSERT_NO_FATAL_FAILURE(StartTest("openSidebarRecent")); | |
539 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | |
540 } | |
541 | |
542 IN_PROC_BROWSER_TEST_P(FileManagerBrowserDriveTest, TestOpenOffline) { | |
543 ResultCatcher catcher; | |
544 ASSERT_NO_FATAL_FAILURE(StartTest("openSidebarOffline")); | |
545 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | |
546 } | |
547 | |
548 IN_PROC_BROWSER_TEST_P(FileManagerBrowserDriveTest, TestOpenSharedWithMe) { | |
549 ResultCatcher catcher; | |
550 ASSERT_NO_FATAL_FAILURE(StartTest("openSidebarSharedWithMe")); | |
551 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | |
552 } | |
553 | |
554 IN_PROC_BROWSER_TEST_P(FileManagerBrowserDriveTest, TestAutocomplete) { | |
555 ResultCatcher catcher; | |
556 ASSERT_NO_FATAL_FAILURE(StartTest("autocomplete")); | |
557 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | |
558 } | |
559 | |
560 IN_PROC_BROWSER_TEST_P(FileManagerBrowserTransferTest, | |
561 TransferFromDriveToDownloads) { | |
562 ResultCatcher catcher; | |
563 ASSERT_NO_FATAL_FAILURE(StartTest("transferFromDriveToDownloads")); | |
564 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | |
565 } | |
566 | |
567 IN_PROC_BROWSER_TEST_P(FileManagerBrowserTransferTest, | |
568 TransferFromDownloadsToDrive) { | |
569 ResultCatcher catcher; | |
570 ASSERT_NO_FATAL_FAILURE(StartTest("transferFromDownloadsToDrive")); | |
571 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | |
572 } | |
573 | |
574 IN_PROC_BROWSER_TEST_P(FileManagerBrowserTransferTest, | |
575 TransferFromSharedToDownloads) { | |
576 ResultCatcher catcher; | |
577 ASSERT_NO_FATAL_FAILURE(StartTest("transferFromSharedToDownloads")); | |
578 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | |
579 } | |
580 | |
581 IN_PROC_BROWSER_TEST_P(FileManagerBrowserTransferTest, | |
582 TransferFromSharedToDrive) { | |
583 ResultCatcher catcher; | |
584 ASSERT_NO_FATAL_FAILURE(StartTest("transferFromSharedToDrive")); | |
585 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | |
586 } | |
587 | |
588 IN_PROC_BROWSER_TEST_P(FileManagerBrowserTransferTest, | |
589 TransferFromRecentToDownloads) { | |
590 ResultCatcher catcher; | |
591 ASSERT_NO_FATAL_FAILURE(StartTest("transferFromRecentToDownloads")); | |
592 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | |
593 } | |
594 | |
595 IN_PROC_BROWSER_TEST_P(FileManagerBrowserTransferTest, | |
596 TransferFromRecentToDrive) { | |
597 ResultCatcher catcher; | |
598 ASSERT_NO_FATAL_FAILURE(StartTest("transferFromRecentToDrive")); | |
599 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | |
600 } | |
601 | |
602 IN_PROC_BROWSER_TEST_P(FileManagerBrowserTransferTest, | |
603 TransferFromOfflineToDownloads) { | |
604 ResultCatcher catcher; | |
605 ASSERT_NO_FATAL_FAILURE(StartTest("transferFromOfflineToDownloads")); | |
606 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | |
607 } | |
608 | |
609 IN_PROC_BROWSER_TEST_P(FileManagerBrowserTransferTest, | |
610 TransferFromOfflineToDrive) { | |
611 ResultCatcher catcher; | |
612 ASSERT_NO_FATAL_FAILURE(StartTest("transferFromOfflineToDrive")); | |
613 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | |
614 } | |
615 | 516 |
616 } // namespace | 517 } // namespace |
OLD | NEW |