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

Side by Side Diff: chromeos/chromeos_test_utils.cc

Issue 18286004: Move PathExists to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 | « chrome_frame/test_utils.cc ('k') | chromeos/dbus/cros_disks_client.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) 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 "chromeos/chromeos_test_utils.h" 5 #include "chromeos/chromeos_test_utils.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 10
11 namespace chromeos { 11 namespace chromeos {
12 namespace test_utils { 12 namespace test_utils {
13 13
14 bool GetTestDataPath(const std::string& component, 14 bool GetTestDataPath(const std::string& component,
15 const std::string& filename, 15 const std::string& filename,
16 base::FilePath* data_dir) { 16 base::FilePath* data_dir) {
17 base::FilePath path; 17 base::FilePath path;
18 if (!PathService::Get(base::DIR_SOURCE_ROOT, &path)) 18 if (!PathService::Get(base::DIR_SOURCE_ROOT, &path))
19 return false; 19 return false;
20 path = path.Append(FILE_PATH_LITERAL("chromeos")); 20 path = path.Append(FILE_PATH_LITERAL("chromeos"));
21 path = path.Append(FILE_PATH_LITERAL("test")); 21 path = path.Append(FILE_PATH_LITERAL("test"));
22 path = path.Append(FILE_PATH_LITERAL("data")); 22 path = path.Append(FILE_PATH_LITERAL("data"));
23 if (!file_util::PathExists(path)) // We don't want to create this. 23 if (!base::PathExists(path)) // We don't want to create this.
24 return false; 24 return false;
25 DCHECK(data_dir); 25 DCHECK(data_dir);
26 path = path.Append(component); 26 path = path.Append(component);
27 *data_dir = path.Append(filename); 27 *data_dir = path.Append(filename);
28 return true; 28 return true;
29 } 29 }
30 30
31 } // namespace test_utils 31 } // namespace test_utils
32 } // namespace chromeos 32 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome_frame/test_utils.cc ('k') | chromeos/dbus/cros_disks_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698