| 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 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 const base::DictionaryValue& value, | 667 const base::DictionaryValue& value, |
| 668 std::string* output) { | 668 std::string* output) { |
| 669 if (name == "getTestName") { | 669 if (name == "getTestName") { |
| 670 // Pass the test case name. | 670 // Pass the test case name. |
| 671 *output = GetTestCaseNameParam(); | 671 *output = GetTestCaseNameParam(); |
| 672 return; | 672 return; |
| 673 } | 673 } |
| 674 | 674 |
| 675 if (name == "getRootPaths") { | 675 if (name == "getRootPaths") { |
| 676 // Pass the root paths. | 676 // Pass the root paths. |
| 677 const scoped_ptr<base::DictionaryValue> res(new base::DictionaryValue()); | 677 base::DictionaryValue res; |
| 678 res->SetString("downloads", | 678 res.SetString("downloads", |
| 679 "/" + util::GetDownloadsMountPointName(profile())); | 679 "/" + util::GetDownloadsMountPointName(profile())); |
| 680 res->SetString("drive", | 680 res.SetString("drive", "/" + |
| 681 "/" + drive::util::GetDriveMountPointPath(profile() | 681 drive::util::GetDriveMountPointPath(profile()) |
| 682 ).BaseName().AsUTF8Unsafe() + "/root"); | 682 .BaseName() |
| 683 base::JSONWriter::Write(res.get(), output); | 683 .AsUTF8Unsafe() + |
| 684 "/root"); |
| 685 base::JSONWriter::Write(res, output); |
| 684 return; | 686 return; |
| 685 } | 687 } |
| 686 | 688 |
| 687 if (name == "isInGuestMode") { | 689 if (name == "isInGuestMode") { |
| 688 // Obtain whether the test is in guest mode or not. | 690 // Obtain whether the test is in guest mode or not. |
| 689 *output = GetGuestModeParam() != NOT_IN_GUEST_MODE ? "true" : "false"; | 691 *output = GetGuestModeParam() != NOT_IN_GUEST_MODE ? "true" : "false"; |
| 690 return; | 692 return; |
| 691 } | 693 } |
| 692 | 694 |
| 693 if (name == "getCwsWidgetContainerMockUrl") { | 695 if (name == "getCwsWidgetContainerMockUrl") { |
| 694 // Obtain whether the test is in guest mode or not. | 696 // Obtain whether the test is in guest mode or not. |
| 695 const GURL url = embedded_test_server()->GetURL( | 697 const GURL url = embedded_test_server()->GetURL( |
| 696 "/chromeos/file_manager/cws_container_mock/index.html"); | 698 "/chromeos/file_manager/cws_container_mock/index.html"); |
| 697 std::string origin = url.GetOrigin().spec(); | 699 std::string origin = url.GetOrigin().spec(); |
| 698 | 700 |
| 699 // Removes trailing a slash. | 701 // Removes trailing a slash. |
| 700 if (*origin.rbegin() == '/') | 702 if (*origin.rbegin() == '/') |
| 701 origin.resize(origin.length() - 1); | 703 origin.resize(origin.length() - 1); |
| 702 | 704 |
| 703 const scoped_ptr<base::DictionaryValue> res(new base::DictionaryValue()); | 705 base::DictionaryValue res; |
| 704 res->SetString("url", url.spec()); | 706 res.SetString("url", url.spec()); |
| 705 res->SetString("origin", origin); | 707 res.SetString("origin", origin); |
| 706 base::JSONWriter::Write(res.get(), output); | 708 base::JSONWriter::Write(res, output); |
| 707 return; | 709 return; |
| 708 } | 710 } |
| 709 | 711 |
| 710 if (name == "addEntries") { | 712 if (name == "addEntries") { |
| 711 // Add entries to the specified volume. | 713 // Add entries to the specified volume. |
| 712 base::JSONValueConverter<AddEntriesMessage> add_entries_message_converter; | 714 base::JSONValueConverter<AddEntriesMessage> add_entries_message_converter; |
| 713 AddEntriesMessage message; | 715 AddEntriesMessage message; |
| 714 ASSERT_TRUE(add_entries_message_converter.Convert(value, &message)); | 716 ASSERT_TRUE(add_entries_message_converter.Convert(value, &message)); |
| 715 | 717 |
| 716 for (size_t i = 0; i < message.entries.size(); ++i) { | 718 for (size_t i = 0; i < message.entries.size(); ++i) { |
| (...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1565 StartTest(); | 1567 StartTest(); |
| 1566 } | 1568 } |
| 1567 | 1569 |
| 1568 IN_PROC_BROWSER_TEST_F(VideoPlayerBrowserTest, OpenSingleVideoOnDrive) { | 1570 IN_PROC_BROWSER_TEST_F(VideoPlayerBrowserTest, OpenSingleVideoOnDrive) { |
| 1569 set_test_case_name("openSingleVideoOnDrive"); | 1571 set_test_case_name("openSingleVideoOnDrive"); |
| 1570 StartTest(); | 1572 StartTest(); |
| 1571 } | 1573 } |
| 1572 | 1574 |
| 1573 } // namespace | 1575 } // namespace |
| 1574 } // namespace file_manager | 1576 } // namespace file_manager |
| OLD | NEW |