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

Side by Side Diff: ppapi/tests/test_file_ref.cc

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « ppapi/shared_impl/ppb_audio_shared.cc ('k') | ppapi/tests/test_flash_clipboard.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "ppapi/tests/test_file_ref.h" 5 #include "ppapi/tests/test_file_ref.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ppapi/c/pp_errors.h" 10 #include "ppapi/c/pp_errors.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 RUN_TEST_FORCEASYNC_AND_NOT(QueryAndTouchFile, filter); 78 RUN_TEST_FORCEASYNC_AND_NOT(QueryAndTouchFile, filter);
79 RUN_TEST_FORCEASYNC_AND_NOT(DeleteFileAndDirectory, filter); 79 RUN_TEST_FORCEASYNC_AND_NOT(DeleteFileAndDirectory, filter);
80 RUN_TEST_FORCEASYNC_AND_NOT(RenameFileAndDirectory, filter); 80 RUN_TEST_FORCEASYNC_AND_NOT(RenameFileAndDirectory, filter);
81 RUN_CALLBACK_TEST(TestFileRef, Query, filter); 81 RUN_CALLBACK_TEST(TestFileRef, Query, filter);
82 RUN_TEST_FORCEASYNC_AND_NOT(FileNameEscaping, filter); 82 RUN_TEST_FORCEASYNC_AND_NOT(FileNameEscaping, filter);
83 } 83 }
84 84
85 std::string TestFileRef::TestCreate() { 85 std::string TestFileRef::TestCreate() {
86 std::vector<std::string> invalid_paths; 86 std::vector<std::string> invalid_paths;
87 invalid_paths.push_back("invalid_path"); // no '/' at the first character 87 invalid_paths.push_back("invalid_path"); // no '/' at the first character
88 invalid_paths.push_back(""); // empty path 88 invalid_paths.push_back(std::string()); // empty path
89 // The following are directory traversal checks 89 // The following are directory traversal checks
90 invalid_paths.push_back(".."); 90 invalid_paths.push_back("..");
91 invalid_paths.push_back("/../invalid_path"); 91 invalid_paths.push_back("/../invalid_path");
92 invalid_paths.push_back("/../../invalid_path"); 92 invalid_paths.push_back("/../../invalid_path");
93 invalid_paths.push_back("/invalid/../../path"); 93 invalid_paths.push_back("/invalid/../../path");
94 const size_t num_invalid_paths = invalid_paths.size(); 94 const size_t num_invalid_paths = invalid_paths.size();
95 95
96 pp::FileSystem file_system_pers( 96 pp::FileSystem file_system_pers(
97 instance_, PP_FILESYSTEMTYPE_LOCALPERSISTENT); 97 instance_, PP_FILESYSTEMTYPE_LOCALPERSISTENT);
98 pp::FileSystem file_system_temp( 98 pp::FileSystem file_system_temp(
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 if (entries.empty()) 791 if (entries.empty())
792 return "Entry was not found."; 792 return "Entry was not found.";
793 if (entries.size() != 1) 793 if (entries.size() != 1)
794 return "Directory had too many entries."; 794 return "Directory had too many entries.";
795 if (entries.front().file_ref().GetName().AsString() != kTerribleName) 795 if (entries.front().file_ref().GetName().AsString() != kTerribleName)
796 return "Entry name did not match."; 796 return "Entry name did not match.";
797 } 797 }
798 798
799 PASS(); 799 PASS();
800 } 800 }
OLDNEW
« no previous file with comments | « ppapi/shared_impl/ppb_audio_shared.cc ('k') | ppapi/tests/test_flash_clipboard.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698