| 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 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 }; | 532 }; |
| 533 | 533 |
| 534 // The base test class. | 534 // The base test class. |
| 535 class FileManagerBrowserTestBase : public ExtensionApiTest { | 535 class FileManagerBrowserTestBase : public ExtensionApiTest { |
| 536 protected: | 536 protected: |
| 537 virtual void SetUpInProcessBrowserTestFixture() override; | 537 virtual void SetUpInProcessBrowserTestFixture() override; |
| 538 | 538 |
| 539 virtual void SetUpOnMainThread() override; | 539 virtual void SetUpOnMainThread() override; |
| 540 | 540 |
| 541 // Adds an incognito and guest-mode flags for tests in the guest mode. | 541 // Adds an incognito and guest-mode flags for tests in the guest mode. |
| 542 virtual void SetUpCommandLine(CommandLine* command_line) override; | 542 virtual void SetUpCommandLine(base::CommandLine* command_line) override; |
| 543 | 543 |
| 544 // Loads our testing extension and sends it a string identifying the current | 544 // Loads our testing extension and sends it a string identifying the current |
| 545 // test. | 545 // test. |
| 546 virtual void StartTest(); | 546 virtual void StartTest(); |
| 547 void RunTestMessageLoop(); | 547 void RunTestMessageLoop(); |
| 548 | 548 |
| 549 // Overriding point for test configurations. | 549 // Overriding point for test configurations. |
| 550 virtual const char* GetTestManifestName() const { | 550 virtual const char* GetTestManifestName() const { |
| 551 return "file_manager_test_manifest.json"; | 551 return "file_manager_test_manifest.json"; |
| 552 } | 552 } |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 const GURL share_url_base(embedded_test_server()->GetURL( | 596 const GURL share_url_base(embedded_test_server()->GetURL( |
| 597 "/chromeos/file_manager/share_dialog_mock/index.html")); | 597 "/chromeos/file_manager/share_dialog_mock/index.html")); |
| 598 drive_volume_ = drive_volumes_[profile()->GetOriginalProfile()]; | 598 drive_volume_ = drive_volumes_[profile()->GetOriginalProfile()]; |
| 599 drive_volume_->ConfigureShareUrlBase(share_url_base); | 599 drive_volume_->ConfigureShareUrlBase(share_url_base); |
| 600 test_util::WaitUntilDriveMountPointIsAdded(profile()); | 600 test_util::WaitUntilDriveMountPointIsAdded(profile()); |
| 601 } | 601 } |
| 602 | 602 |
| 603 net::NetworkChangeNotifier::SetTestNotificationsOnly(true); | 603 net::NetworkChangeNotifier::SetTestNotificationsOnly(true); |
| 604 } | 604 } |
| 605 | 605 |
| 606 void FileManagerBrowserTestBase::SetUpCommandLine(CommandLine* command_line) { | 606 void FileManagerBrowserTestBase::SetUpCommandLine( |
| 607 base::CommandLine* command_line) { |
| 607 if (GetGuestModeParam() == IN_GUEST_MODE) { | 608 if (GetGuestModeParam() == IN_GUEST_MODE) { |
| 608 command_line->AppendSwitch(chromeos::switches::kGuestSession); | 609 command_line->AppendSwitch(chromeos::switches::kGuestSession); |
| 609 command_line->AppendSwitchNative(chromeos::switches::kLoginUser, ""); | 610 command_line->AppendSwitchNative(chromeos::switches::kLoginUser, ""); |
| 610 command_line->AppendSwitch(switches::kIncognito); | 611 command_line->AppendSwitch(switches::kIncognito); |
| 611 } | 612 } |
| 612 if (GetGuestModeParam() == IN_INCOGNITO) { | 613 if (GetGuestModeParam() == IN_INCOGNITO) { |
| 613 command_line->AppendSwitch(switches::kIncognito); | 614 command_line->AppendSwitch(switches::kIncognito); |
| 614 } | 615 } |
| 615 ExtensionApiTest::SetUpCommandLine(command_line); | 616 ExtensionApiTest::SetUpCommandLine(command_line); |
| 616 } | 617 } |
| (...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1163 {"__dummy__@invalid.domain", "hashdummy", "Dummy Account"}, | 1164 {"__dummy__@invalid.domain", "hashdummy", "Dummy Account"}, |
| 1164 {"alice@invalid.domain", "hashalice", "Alice"}, | 1165 {"alice@invalid.domain", "hashalice", "Alice"}, |
| 1165 {"bob@invalid.domain", "hashbob", "Bob"}, | 1166 {"bob@invalid.domain", "hashbob", "Bob"}, |
| 1166 {"charlie@invalid.domain", "hashcharlie", "Charlie"}, | 1167 {"charlie@invalid.domain", "hashcharlie", "Charlie"}, |
| 1167 }; | 1168 }; |
| 1168 | 1169 |
| 1169 // Test fixture class for testing multi-profile features. | 1170 // Test fixture class for testing multi-profile features. |
| 1170 class MultiProfileFileManagerBrowserTest : public FileManagerBrowserTestBase { | 1171 class MultiProfileFileManagerBrowserTest : public FileManagerBrowserTestBase { |
| 1171 protected: | 1172 protected: |
| 1172 // Enables multi-profiles. | 1173 // Enables multi-profiles. |
| 1173 virtual void SetUpCommandLine(CommandLine* command_line) override { | 1174 virtual void SetUpCommandLine(base::CommandLine* command_line) override { |
| 1174 FileManagerBrowserTestBase::SetUpCommandLine(command_line); | 1175 FileManagerBrowserTestBase::SetUpCommandLine(command_line); |
| 1175 // Logs in to a dummy profile (For making MultiProfileWindowManager happy; | 1176 // Logs in to a dummy profile (For making MultiProfileWindowManager happy; |
| 1176 // browser test creates a default window and the manager tries to assign a | 1177 // browser test creates a default window and the manager tries to assign a |
| 1177 // user for it, and we need a profile connected to a user.) | 1178 // user for it, and we need a profile connected to a user.) |
| 1178 command_line->AppendSwitchASCII(chromeos::switches::kLoginUser, | 1179 command_line->AppendSwitchASCII(chromeos::switches::kLoginUser, |
| 1179 kTestAccounts[DUMMY_ACCOUNT_INDEX].email); | 1180 kTestAccounts[DUMMY_ACCOUNT_INDEX].email); |
| 1180 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, | 1181 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, |
| 1181 kTestAccounts[DUMMY_ACCOUNT_INDEX].hash); | 1182 kTestAccounts[DUMMY_ACCOUNT_INDEX].hash); |
| 1182 } | 1183 } |
| 1183 | 1184 |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1493 return test_case_name_.c_str(); | 1494 return test_case_name_.c_str(); |
| 1494 } | 1495 } |
| 1495 | 1496 |
| 1496 protected: | 1497 protected: |
| 1497 virtual void SetUp() override { | 1498 virtual void SetUp() override { |
| 1498 AddScript("common/test_util_common.js"); | 1499 AddScript("common/test_util_common.js"); |
| 1499 AddScript("video_player/test_util.js"); | 1500 AddScript("video_player/test_util.js"); |
| 1500 FileManagerBrowserTestBase::SetUp(); | 1501 FileManagerBrowserTestBase::SetUp(); |
| 1501 } | 1502 } |
| 1502 | 1503 |
| 1503 virtual void SetUpCommandLine(CommandLine* command_line) override { | 1504 virtual void SetUpCommandLine(base::CommandLine* command_line) override { |
| 1504 command_line->AppendSwitch( | 1505 command_line->AppendSwitch( |
| 1505 chromeos::switches::kEnableVideoPlayerChromecastSupport); | 1506 chromeos::switches::kEnableVideoPlayerChromecastSupport); |
| 1506 FileManagerBrowserTestBase::SetUpCommandLine(command_line); | 1507 FileManagerBrowserTestBase::SetUpCommandLine(command_line); |
| 1507 } | 1508 } |
| 1508 | 1509 |
| 1509 virtual void OnMessage(const std::string& name, | 1510 virtual void OnMessage(const std::string& name, |
| 1510 const base::DictionaryValue& value, | 1511 const base::DictionaryValue& value, |
| 1511 std::string* output) override; | 1512 std::string* output) override; |
| 1512 | 1513 |
| 1513 virtual const char* GetTestManifestName() const override { | 1514 virtual const char* GetTestManifestName() const override { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1553 } | 1554 } |
| 1554 | 1555 |
| 1555 IN_PROC_BROWSER_TEST_F(VideoPlayerBrowserTest, OpenSingleVideoOnDrive) { | 1556 IN_PROC_BROWSER_TEST_F(VideoPlayerBrowserTest, OpenSingleVideoOnDrive) { |
| 1556 AddScript("video_player/open_video_files.js"); | 1557 AddScript("video_player/open_video_files.js"); |
| 1557 set_test_case_name("openSingleVideoOnDrive"); | 1558 set_test_case_name("openSingleVideoOnDrive"); |
| 1558 StartTest(); | 1559 StartTest(); |
| 1559 } | 1560 } |
| 1560 | 1561 |
| 1561 } // namespace | 1562 } // namespace |
| 1562 } // namespace file_manager | 1563 } // namespace file_manager |
| OLD | NEW |