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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 const char* target_name; // Target file or directory name. | 59 const char* target_name; // Target file or directory name. |
60 const char* mime_type; | 60 const char* mime_type; |
61 SharedOption shared_option; | 61 SharedOption shared_option; |
62 const char* last_modified_time_as_string; | 62 const char* last_modified_time_as_string; |
63 }; | 63 }; |
64 | 64 |
65 TestEntryInfo kTestEntrySetCommon[] = { | 65 TestEntryInfo kTestEntrySetCommon[] = { |
66 { FILE, "text.txt", "hello.txt", "text/plain", NONE, "4 Sep 1998 12:34:56" }, | 66 { FILE, "text.txt", "hello.txt", "text/plain", NONE, "4 Sep 1998 12:34:56" }, |
67 { FILE, "image.png", "My Desktop Background.png", "text/plain", NONE, | 67 { FILE, "image.png", "My Desktop Background.png", "text/plain", NONE, |
68 "18 Jan 2038 01:02:03" }, | 68 "18 Jan 2038 01:02:03" }, |
| 69 { FILE, "music.ogg", "Beautiful Song.ogg", "text/plain", NONE, |
| 70 "12 Nov 2012 12:00:00" }, |
69 { FILE, "video.ogv", kKeyboardTestFileName, "text/plain", NONE, | 71 { FILE, "video.ogv", kKeyboardTestFileName, "text/plain", NONE, |
70 "4 July 2012 10:35:00" }, | 72 "4 July 2012 10:35:00" }, |
71 { DIRECTORY, "", "photos", NULL, NONE, "1 Jan 1980 23:59:59" }, | 73 { DIRECTORY, "", "photos", NULL, NONE, "1 Jan 1980 23:59:59" }, |
72 { DIRECTORY, "", ".warez", NULL, NONE, "26 Oct 1985 13:39" } | 74 { DIRECTORY, "", ".warez", NULL, NONE, "26 Oct 1985 13:39" } |
73 }; | 75 }; |
74 | 76 |
75 TestEntryInfo kTestEntrySetDriveOnly[] = { | 77 TestEntryInfo kTestEntrySetDriveOnly[] = { |
76 { FILE, "", "Test Document", "application/vnd.google-apps.document", NONE, | 78 { FILE, "", "Test Document", "application/vnd.google-apps.document", NONE, |
77 "10 Apr 2013 16:20:00" }, | 79 "10 Apr 2013 16:20:00" }, |
78 { FILE, "", "Test Shared Document", "application/vnd.google-apps.document", | 80 { FILE, "", "Test Shared Document", "application/vnd.google-apps.document", |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 // Creates test files and directories. | 578 // Creates test files and directories. |
577 void CreateTestEntries(TestVolume* volume, const TestEntryInfo* entries, | 579 void CreateTestEntries(TestVolume* volume, const TestEntryInfo* entries, |
578 size_t num_entries); | 580 size_t num_entries); |
579 | 581 |
580 // Runs the file display test on the passed |volume|, shared by subclasses. | 582 // Runs the file display test on the passed |volume|, shared by subclasses. |
581 void DoTestFileDisplay(TestVolume* volume); | 583 void DoTestFileDisplay(TestVolume* volume); |
582 | 584 |
583 // Runs the gallery open test on the passed |volume|, shared by subclasses. | 585 // Runs the gallery open test on the passed |volume|, shared by subclasses. |
584 void DoTestGalleryOpen(TestVolume* volume); | 586 void DoTestGalleryOpen(TestVolume* volume); |
585 | 587 |
| 588 // Runs the audio open test on the passed |volume|, shared by subclasses. |
| 589 void DoTestAudioOpen(TestVolume* volume); |
| 590 |
586 // Runs the keyboard copy test on the passed |volume|, shared by subclasses. | 591 // Runs the keyboard copy test on the passed |volume|, shared by subclasses. |
587 void DoTestKeyboardCopy(TestVolume* volume); | 592 void DoTestKeyboardCopy(TestVolume* volume); |
588 | 593 |
589 // Runs the keyboard delete test on the passed |volume|, shared by subclasses. | 594 // Runs the keyboard delete test on the passed |volume|, shared by subclasses. |
590 void DoTestKeyboardDelete(TestVolume* volume); | 595 void DoTestKeyboardDelete(TestVolume* volume); |
591 }; | 596 }; |
592 | 597 |
593 void FileManagerBrowserTestBase::SetUpCommandLine(CommandLine* command_line) { | 598 void FileManagerBrowserTestBase::SetUpCommandLine(CommandLine* command_line) { |
594 bool in_guest_mode = GetParam(); | 599 bool in_guest_mode = GetParam(); |
595 if (in_guest_mode) { | 600 if (in_guest_mode) { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
638 | 643 |
639 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 644 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); |
640 } | 645 } |
641 | 646 |
642 void FileManagerBrowserTestBase::DoTestGalleryOpen(TestVolume* volume) { | 647 void FileManagerBrowserTestBase::DoTestGalleryOpen(TestVolume* volume) { |
643 ResultCatcher catcher; | 648 ResultCatcher catcher; |
644 StartTest("galleryOpen" + volume->GetName()); | 649 StartTest("galleryOpen" + volume->GetName()); |
645 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 650 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); |
646 } | 651 } |
647 | 652 |
| 653 void FileManagerBrowserTestBase::DoTestAudioOpen(TestVolume* volume) { |
| 654 ResultCatcher catcher; |
| 655 StartTest("audioOpen" + volume->GetName()); |
| 656 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); |
| 657 } |
| 658 |
648 void FileManagerBrowserTestBase::DoTestKeyboardCopy(TestVolume* volume) { | 659 void FileManagerBrowserTestBase::DoTestKeyboardCopy(TestVolume* volume) { |
649 base::FilePath copy_path = | 660 base::FilePath copy_path = |
650 volume->GetRootPath().AppendASCII(kKeyboardTestFileCopyName); | 661 volume->GetRootPath().AppendASCII(kKeyboardTestFileCopyName); |
651 ASSERT_FALSE(volume->PathExists(copy_path)); | 662 ASSERT_FALSE(volume->PathExists(copy_path)); |
652 | 663 |
653 ResultCatcher catcher; | 664 ResultCatcher catcher; |
654 ASSERT_NO_FATAL_FAILURE(StartTest("keyboardCopy" + volume->GetName())); | 665 ASSERT_NO_FATAL_FAILURE(StartTest("keyboardCopy" + volume->GetName())); |
655 | 666 |
656 const int64 kKeyboardTestFileSize = 59943; | 667 const int64 kKeyboardTestFileSize = 59943; |
657 | 668 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
775 IN_PROC_BROWSER_TEST_P(FileManagerBrowserLocalTest, TestGalleryOpen) { | 786 IN_PROC_BROWSER_TEST_P(FileManagerBrowserLocalTest, TestGalleryOpen) { |
776 DoTestGalleryOpen(&volume_); | 787 DoTestGalleryOpen(&volume_); |
777 } | 788 } |
778 | 789 |
779 // Disabled temporarily since fails on Linux Chromium OS ASAN Tests (2). | 790 // Disabled temporarily since fails on Linux Chromium OS ASAN Tests (2). |
780 // TODO(mtomasz): crbug.com/243611. | 791 // TODO(mtomasz): crbug.com/243611. |
781 IN_PROC_BROWSER_TEST_P(FileManagerBrowserDriveTest, DISABLED_TestGalleryOpen) { | 792 IN_PROC_BROWSER_TEST_P(FileManagerBrowserDriveTest, DISABLED_TestGalleryOpen) { |
782 DoTestGalleryOpen(&volume_); | 793 DoTestGalleryOpen(&volume_); |
783 } | 794 } |
784 | 795 |
| 796 IN_PROC_BROWSER_TEST_P(FileManagerBrowserLocalTest, TestAudioOpen) { |
| 797 DoTestAudioOpen(&volume_); |
| 798 } |
| 799 |
| 800 IN_PROC_BROWSER_TEST_P(FileManagerBrowserDriveTest, TestAudioOpen) { |
| 801 DoTestAudioOpen(&volume_); |
| 802 } |
| 803 |
785 IN_PROC_BROWSER_TEST_P(FileManagerBrowserDriveTest, TestKeyboardCopy) { | 804 IN_PROC_BROWSER_TEST_P(FileManagerBrowserDriveTest, TestKeyboardCopy) { |
786 DoTestKeyboardCopy(&volume_); | 805 DoTestKeyboardCopy(&volume_); |
787 } | 806 } |
788 | 807 |
789 IN_PROC_BROWSER_TEST_P(FileManagerBrowserDriveTest, TestKeyboardDelete) { | 808 IN_PROC_BROWSER_TEST_P(FileManagerBrowserDriveTest, TestKeyboardDelete) { |
790 DoTestKeyboardDelete(&volume_); | 809 DoTestKeyboardDelete(&volume_); |
791 } | 810 } |
792 | 811 |
793 IN_PROC_BROWSER_TEST_P(FileManagerBrowserDriveTest, TestOpenRecent) { | 812 IN_PROC_BROWSER_TEST_P(FileManagerBrowserDriveTest, TestOpenRecent) { |
794 ResultCatcher catcher; | 813 ResultCatcher catcher; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 | 886 |
868 // TODO(hirono): Bring back the offline feature. http://crbug.com/238545 | 887 // TODO(hirono): Bring back the offline feature. http://crbug.com/238545 |
869 IN_PROC_BROWSER_TEST_P(FileManagerBrowserTransferTest, | 888 IN_PROC_BROWSER_TEST_P(FileManagerBrowserTransferTest, |
870 DISABLED_TransferFromOfflineToDrive) { | 889 DISABLED_TransferFromOfflineToDrive) { |
871 ResultCatcher catcher; | 890 ResultCatcher catcher; |
872 ASSERT_NO_FATAL_FAILURE(StartTest("transferFromOfflineToDrive")); | 891 ASSERT_NO_FATAL_FAILURE(StartTest("transferFromOfflineToDrive")); |
873 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 892 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); |
874 } | 893 } |
875 | 894 |
876 } // namespace | 895 } // namespace |
OLD | NEW |