Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Side by Side Diff: chrome/browser/chromeos/file_manager/file_manager_browsertest.cc

Issue 1131113004: Convert JsonWriter::Write to taking a const ref for the in-param (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another rebase Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 663 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 const base::DictionaryValue& value, 674 const base::DictionaryValue& value,
675 std::string* output) { 675 std::string* output) {
676 if (name == "getTestName") { 676 if (name == "getTestName") {
677 // Pass the test case name. 677 // Pass the test case name.
678 *output = GetTestCaseNameParam(); 678 *output = GetTestCaseNameParam();
679 return; 679 return;
680 } 680 }
681 681
682 if (name == "getRootPaths") { 682 if (name == "getRootPaths") {
683 // Pass the root paths. 683 // Pass the root paths.
684 const scoped_ptr<base::DictionaryValue> res(new base::DictionaryValue()); 684 base::DictionaryValue res;
685 res->SetString("downloads", 685 res.SetString("downloads",
686 "/" + util::GetDownloadsMountPointName(profile())); 686 "/" + util::GetDownloadsMountPointName(profile()));
687 res->SetString("drive", 687 res.SetString("drive", "/" +
688 "/" + drive::util::GetDriveMountPointPath(profile() 688 drive::util::GetDriveMountPointPath(profile())
689 ).BaseName().AsUTF8Unsafe() + "/root"); 689 .BaseName()
690 base::JSONWriter::Write(res.get(), output); 690 .AsUTF8Unsafe() +
691 "/root");
692 base::JSONWriter::Write(res, output);
691 return; 693 return;
692 } 694 }
693 695
694 if (name == "isInGuestMode") { 696 if (name == "isInGuestMode") {
695 // Obtain whether the test is in guest mode or not. 697 // Obtain whether the test is in guest mode or not.
696 *output = GetGuestModeParam() != NOT_IN_GUEST_MODE ? "true" : "false"; 698 *output = GetGuestModeParam() != NOT_IN_GUEST_MODE ? "true" : "false";
697 return; 699 return;
698 } 700 }
699 701
700 if (name == "getCwsWidgetContainerMockUrl") { 702 if (name == "getCwsWidgetContainerMockUrl") {
701 // Obtain whether the test is in guest mode or not. 703 // Obtain whether the test is in guest mode or not.
702 const GURL url = embedded_test_server()->GetURL( 704 const GURL url = embedded_test_server()->GetURL(
703 "/chromeos/file_manager/cws_container_mock/index.html"); 705 "/chromeos/file_manager/cws_container_mock/index.html");
704 std::string origin = url.GetOrigin().spec(); 706 std::string origin = url.GetOrigin().spec();
705 707
706 // Removes trailing a slash. 708 // Removes trailing a slash.
707 if (*origin.rbegin() == '/') 709 if (*origin.rbegin() == '/')
708 origin.resize(origin.length() - 1); 710 origin.resize(origin.length() - 1);
709 711
710 const scoped_ptr<base::DictionaryValue> res(new base::DictionaryValue()); 712 base::DictionaryValue res;
711 res->SetString("url", url.spec()); 713 res.SetString("url", url.spec());
712 res->SetString("origin", origin); 714 res.SetString("origin", origin);
713 base::JSONWriter::Write(res.get(), output); 715 base::JSONWriter::Write(res, output);
714 return; 716 return;
715 } 717 }
716 718
717 if (name == "addEntries") { 719 if (name == "addEntries") {
718 // Add entries to the specified volume. 720 // Add entries to the specified volume.
719 base::JSONValueConverter<AddEntriesMessage> add_entries_message_converter; 721 base::JSONValueConverter<AddEntriesMessage> add_entries_message_converter;
720 AddEntriesMessage message; 722 AddEntriesMessage message;
721 ASSERT_TRUE(add_entries_message_converter.Convert(value, &message)); 723 ASSERT_TRUE(add_entries_message_converter.Convert(value, &message));
722 724
723 for (size_t i = 0; i < message.entries.size(); ++i) { 725 for (size_t i = 0; i < message.entries.size(); ++i) {
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after
1538 StartTest(); 1540 StartTest();
1539 } 1541 }
1540 1542
1541 IN_PROC_BROWSER_TEST_F(VideoPlayerBrowserTest, OpenSingleVideoOnDrive) { 1543 IN_PROC_BROWSER_TEST_F(VideoPlayerBrowserTest, OpenSingleVideoOnDrive) {
1542 set_test_case_name("openSingleVideoOnDrive"); 1544 set_test_case_name("openSingleVideoOnDrive");
1543 StartTest(); 1545 StartTest();
1544 } 1546 }
1545 1547
1546 } // namespace 1548 } // namespace
1547 } // namespace file_manager 1549 } // namespace file_manager
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/extensions/accessibility_features_apitest.cc ('k') | chrome/browser/chromeos/file_manager/url_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698