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

Side by Side Diff: chrome/browser/nacl_host/pnacl_file_host_unittest.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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/nacl_host/pnacl_file_host.h" 5 #include "chrome/browser/nacl_host/pnacl_file_host.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/files/scoped_temp_dir.h" 9 #include "base/files/scoped_temp_dir.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 const char non_ascii[] = "\xff\xfe"; 50 const char non_ascii[] = "\xff\xfe";
51 EXPECT_FALSE(PnaclCanOpenFile(non_ascii, &out_path)); 51 EXPECT_FALSE(PnaclCanOpenFile(non_ascii, &out_path));
52 52
53 // Check file length restriction. 53 // Check file length restriction.
54 EXPECT_FALSE(PnaclCanOpenFile("thisstringisactuallywaaaaaaaaaaaaaaaaaaaaaaaa" 54 EXPECT_FALSE(PnaclCanOpenFile("thisstringisactuallywaaaaaaaaaaaaaaaaaaaaaaaa"
55 "toolongwaytoolongwaaaaayyyyytoooooooooooooooo" 55 "toolongwaytoolongwaaaaayyyyytoooooooooooooooo"
56 "looooooooong", 56 "looooooooong",
57 &out_path)); 57 &out_path));
58 58
59 // Other bad files. 59 // Other bad files.
60 EXPECT_FALSE(PnaclCanOpenFile("", &out_path)); 60 EXPECT_FALSE(PnaclCanOpenFile(std::string(), &out_path));
61 EXPECT_FALSE(PnaclCanOpenFile(".", &out_path)); 61 EXPECT_FALSE(PnaclCanOpenFile(".", &out_path));
62 EXPECT_FALSE(PnaclCanOpenFile("..", &out_path)); 62 EXPECT_FALSE(PnaclCanOpenFile("..", &out_path));
63 #if defined(OS_WIN) 63 #if defined(OS_WIN)
64 EXPECT_FALSE(PnaclCanOpenFile("..\\llc", &out_path)); 64 EXPECT_FALSE(PnaclCanOpenFile("..\\llc", &out_path));
65 EXPECT_FALSE(PnaclCanOpenFile("%SystemRoot%", &out_path)); 65 EXPECT_FALSE(PnaclCanOpenFile("%SystemRoot%", &out_path));
66 EXPECT_FALSE(PnaclCanOpenFile("%SystemRoot%\\explorer.exe", &out_path)); 66 EXPECT_FALSE(PnaclCanOpenFile("%SystemRoot%\\explorer.exe", &out_path));
67 #else 67 #else
68 EXPECT_FALSE(PnaclCanOpenFile("../llc", &out_path)); 68 EXPECT_FALSE(PnaclCanOpenFile("../llc", &out_path));
69 EXPECT_FALSE(PnaclCanOpenFile("/bin/sh", &out_path)); 69 EXPECT_FALSE(PnaclCanOpenFile("/bin/sh", &out_path));
70 EXPECT_FALSE(PnaclCanOpenFile("$HOME", &out_path)); 70 EXPECT_FALSE(PnaclCanOpenFile("$HOME", &out_path));
71 EXPECT_FALSE(PnaclCanOpenFile("$HOME/.bashrc", &out_path)); 71 EXPECT_FALSE(PnaclCanOpenFile("$HOME/.bashrc", &out_path));
72 #endif 72 #endif
73 } 73 }
OLDNEW
« no previous file with comments | « chrome/browser/metrics/metrics_service.cc ('k') | chrome/browser/net/chrome_fraudulent_certificate_reporter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698