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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 // Loads our testing extension and sends it a string identifying the current | 325 // Loads our testing extension and sends it a string identifying the current |
326 // test. | 326 // test. |
327 void StartTest(const std::string& test_name); | 327 void StartTest(const std::string& test_name); |
328 | 328 |
329 // Creates test files and directories. | 329 // Creates test files and directories. |
330 void CreateTestEntries(TestVolume* volume, const TestEntryInfo* entries, | 330 void CreateTestEntries(TestVolume* volume, const TestEntryInfo* entries, |
331 size_t num_entries); | 331 size_t num_entries); |
332 | 332 |
333 // Runs the file display test on the passed |volume|, shared by subclasses. | 333 // Runs the file display test on the passed |volume|, shared by subclasses. |
334 void DoTestFileDisplay(TestVolume* volume); | 334 void DoTestFileDisplay(TestVolume* volume); |
335 | |
336 // Runs the gallery open test on the passed |volume|, shared by subclasses. | |
337 void DoTestGalleryOpen(TestVolume* volume); | |
338 | |
339 // Runs the audio open test on the passed |volume|, shared by subclasses. | |
340 void DoTestAudioOpen(TestVolume* volume); | |
341 | |
342 // Runs the keyboard copy test on the passed |volume|, shared by subclasses. | |
343 void DoTestKeyboardCopy(TestVolume* volume); | |
344 | |
345 // Runs the keyboard delete test on the passed |volume|, shared by subclasses. | |
346 void DoTestKeyboardDelete(TestVolume* volume); | |
347 }; | 335 }; |
348 | 336 |
349 void FileManagerBrowserTestBase::SetUpCommandLine(CommandLine* command_line) { | 337 void FileManagerBrowserTestBase::SetUpCommandLine(CommandLine* command_line) { |
350 bool in_guest_mode = GetParam(); | 338 bool in_guest_mode = GetParam(); |
351 if (in_guest_mode) { | 339 if (in_guest_mode) { |
352 command_line->AppendSwitch(chromeos::switches::kGuestSession); | 340 command_line->AppendSwitch(chromeos::switches::kGuestSession); |
353 command_line->AppendSwitchNative(chromeos::switches::kLoginUser, ""); | 341 command_line->AppendSwitchNative(chromeos::switches::kLoginUser, ""); |
354 command_line->AppendSwitch(switches::kIncognito); | 342 command_line->AppendSwitch(switches::kIncognito); |
355 } | 343 } |
356 ExtensionApiTest::SetUpCommandLine(command_line); | 344 ExtensionApiTest::SetUpCommandLine(command_line); |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 } | 493 } |
506 | 494 |
507 IN_PROC_BROWSER_TEST_P(FileManagerBrowserLocalTest, TestAudioOpen) { | 495 IN_PROC_BROWSER_TEST_P(FileManagerBrowserLocalTest, TestAudioOpen) { |
508 ResultCatcher catcher; | 496 ResultCatcher catcher; |
509 ASSERT_NO_FATAL_FAILURE(StartTest("galleryOpenDownloads")); | 497 ASSERT_NO_FATAL_FAILURE(StartTest("galleryOpenDownloads")); |
510 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message();} | 498 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message();} |
511 | 499 |
512 IN_PROC_BROWSER_TEST_P(FileManagerBrowserDriveTest, TestAudioOpen) { | 500 IN_PROC_BROWSER_TEST_P(FileManagerBrowserDriveTest, TestAudioOpen) { |
513 ResultCatcher catcher; | 501 ResultCatcher catcher; |
514 ASSERT_NO_FATAL_FAILURE(StartTest("galleryOpenDrive")); | 502 ASSERT_NO_FATAL_FAILURE(StartTest("galleryOpenDrive")); |
515 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message();} | 503 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); |
| 504 } |
| 505 |
| 506 IN_PROC_BROWSER_TEST_P(FileManagerBrowserLocalTest, TestVideoOpen) { |
| 507 ResultCatcher catcher; |
| 508 ASSERT_NO_FATAL_FAILURE(StartTest("galleryOpenDownloads")); |
| 509 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); |
| 510 } |
| 511 |
| 512 IN_PROC_BROWSER_TEST_P(FileManagerBrowserDriveTest, TestVideoOpen) { |
| 513 ResultCatcher catcher; |
| 514 ASSERT_NO_FATAL_FAILURE(StartTest("galleryOpenDrive")); |
| 515 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); |
| 516 } |
516 | 517 |
517 IN_PROC_BROWSER_TEST_P(FileManagerBrowserDriveTest, TestKeyboardCopy) { | 518 IN_PROC_BROWSER_TEST_P(FileManagerBrowserDriveTest, TestKeyboardCopy) { |
518 ResultCatcher catcher; | 519 ResultCatcher catcher; |
519 ASSERT_NO_FATAL_FAILURE(StartTest("keyboardCopyDrive")); | 520 ASSERT_NO_FATAL_FAILURE(StartTest("keyboardCopyDrive")); |
520 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 521 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); |
521 } | 522 } |
522 | 523 |
523 IN_PROC_BROWSER_TEST_P(FileManagerBrowserDriveTest, TestKeyboardDelete) { | 524 IN_PROC_BROWSER_TEST_P(FileManagerBrowserDriveTest, TestKeyboardDelete) { |
524 ResultCatcher catcher; | 525 ResultCatcher catcher; |
525 ASSERT_NO_FATAL_FAILURE(StartTest("keyboardDeleteDrive")); | 526 ASSERT_NO_FATAL_FAILURE(StartTest("keyboardDeleteDrive")); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 } | 601 } |
601 | 602 |
602 IN_PROC_BROWSER_TEST_P(FileManagerBrowserTransferTest, | 603 IN_PROC_BROWSER_TEST_P(FileManagerBrowserTransferTest, |
603 TransferFromOfflineToDrive) { | 604 TransferFromOfflineToDrive) { |
604 ResultCatcher catcher; | 605 ResultCatcher catcher; |
605 ASSERT_NO_FATAL_FAILURE(StartTest("transferFromOfflineToDrive")); | 606 ASSERT_NO_FATAL_FAILURE(StartTest("transferFromOfflineToDrive")); |
606 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 607 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); |
607 } | 608 } |
608 | 609 |
609 } // namespace | 610 } // namespace |
OLD | NEW |