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

Side by Side Diff: components/nacl/browser/nacl_file_host_unittest.cc

Issue 2318033002: c/browser, c/common, components M-N: Change ScopedTempDir::path() to GetPath() (Closed)
Patch Set: Fix ItunesFileUtilTest Created 4 years, 3 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) 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 "components/nacl/browser/nacl_file_host.h" 5 #include "components/nacl/browser/nacl_file_host.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/files/scoped_temp_dir.h" 8 #include "base/files/scoped_temp_dir.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/test/scoped_path_override.h" 10 #include "base/test/scoped_path_override.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 NaClFileHostTest::NaClFileHostTest() : nacl_browser_delegate_(NULL) {} 60 NaClFileHostTest::NaClFileHostTest() : nacl_browser_delegate_(NULL) {}
61 61
62 NaClFileHostTest::~NaClFileHostTest() { 62 NaClFileHostTest::~NaClFileHostTest() {
63 } 63 }
64 64
65 // Try to pass a few funny filenames with a dummy PNaCl directory set. 65 // Try to pass a few funny filenames with a dummy PNaCl directory set.
66 TEST_F(NaClFileHostTest, TestFilenamesWithPnaclPath) { 66 TEST_F(NaClFileHostTest, TestFilenamesWithPnaclPath) {
67 base::ScopedTempDir scoped_tmp_dir; 67 base::ScopedTempDir scoped_tmp_dir;
68 ASSERT_TRUE(scoped_tmp_dir.CreateUniqueTempDir()); 68 ASSERT_TRUE(scoped_tmp_dir.CreateUniqueTempDir());
69 69
70 base::FilePath kTestPnaclPath = scoped_tmp_dir.path(); 70 base::FilePath kTestPnaclPath = scoped_tmp_dir.GetPath();
71 71
72 nacl_browser_delegate()->SetPnaclDirectory(kTestPnaclPath); 72 nacl_browser_delegate()->SetPnaclDirectory(kTestPnaclPath);
73 ASSERT_TRUE(nacl::NaClBrowser::GetDelegate()->GetPnaclDirectory( 73 ASSERT_TRUE(nacl::NaClBrowser::GetDelegate()->GetPnaclDirectory(
74 &kTestPnaclPath)); 74 &kTestPnaclPath));
75 75
76 // Check allowed strings, and check that the expected prefix is added. 76 // Check allowed strings, and check that the expected prefix is added.
77 base::FilePath out_path; 77 base::FilePath out_path;
78 EXPECT_TRUE(PnaclCanOpenFile("pnacl_json", &out_path)); 78 EXPECT_TRUE(PnaclCanOpenFile("pnacl_json", &out_path));
79 base::FilePath expected_path = kTestPnaclPath.Append( 79 base::FilePath expected_path = kTestPnaclPath.Append(
80 FILE_PATH_LITERAL("pnacl_public_pnacl_json")); 80 FILE_PATH_LITERAL("pnacl_public_pnacl_json"));
(...skipping 30 matching lines...) Expand all
111 EXPECT_FALSE(PnaclCanOpenFile("..\\llc", &out_path)); 111 EXPECT_FALSE(PnaclCanOpenFile("..\\llc", &out_path));
112 EXPECT_FALSE(PnaclCanOpenFile("%SystemRoot%", &out_path)); 112 EXPECT_FALSE(PnaclCanOpenFile("%SystemRoot%", &out_path));
113 EXPECT_FALSE(PnaclCanOpenFile("%SystemRoot%\\explorer.exe", &out_path)); 113 EXPECT_FALSE(PnaclCanOpenFile("%SystemRoot%\\explorer.exe", &out_path));
114 #else 114 #else
115 EXPECT_FALSE(PnaclCanOpenFile("../llc", &out_path)); 115 EXPECT_FALSE(PnaclCanOpenFile("../llc", &out_path));
116 EXPECT_FALSE(PnaclCanOpenFile("/bin/sh", &out_path)); 116 EXPECT_FALSE(PnaclCanOpenFile("/bin/sh", &out_path));
117 EXPECT_FALSE(PnaclCanOpenFile("$HOME", &out_path)); 117 EXPECT_FALSE(PnaclCanOpenFile("$HOME", &out_path));
118 EXPECT_FALSE(PnaclCanOpenFile("$HOME/.bashrc", &out_path)); 118 EXPECT_FALSE(PnaclCanOpenFile("$HOME/.bashrc", &out_path));
119 #endif 119 #endif
120 } 120 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698