diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-11 17:36:07 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-11 17:36:07 +0000 |
commit | 7567484144da059e2c2c2a818b06660a5459052f (patch) | |
tree | a4ceafc7e890051c25dbdd54b170d0f5794dd229 /chrome/test | |
parent | 8a25d54d6eb190a8b82479b5309a892c1080a372 (diff) | |
download | chromium_src-7567484144da059e2c2c2a818b06660a5459052f.zip chromium_src-7567484144da059e2c2c2a818b06660a5459052f.tar.gz chromium_src-7567484144da059e2c2c2a818b06660a5459052f.tar.bz2 |
Move PathExists to base namespace.
BUG=
TBR=jam@chromium.org
Review URL: https://codereview.chromium.org/18286004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211147 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
20 files changed, 35 insertions, 35 deletions
diff --git a/chrome/test/automation/proxy_launcher.cc b/chrome/test/automation/proxy_launcher.cc index 97e9d3c..004e32bd 100644 --- a/chrome/test/automation/proxy_launcher.cc +++ b/chrome/test/automation/proxy_launcher.cc @@ -82,7 +82,7 @@ void UpdateHistoryDates(const base::FilePath& user_data_dir) { base::FilePath history = user_data_dir.AppendASCII("Default").AppendASCII("History"); // Not all test profiles have a history file. - if (!file_util::PathExists(history)) + if (!base::PathExists(history)) return; ASSERT_TRUE(db.Open(history)); diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc index d521860..c08433e 100644 --- a/chrome/test/base/testing_profile.cc +++ b/chrome/test/base/testing_profile.cc @@ -291,7 +291,7 @@ void TestingProfile::Init() { else CreateTestingPrefService(); - if (!file_util::PathExists(profile_path_)) + if (!base::PathExists(profile_path_)) file_util::CreateDirectory(profile_path_); // TODO(joaodasilva): remove this once this PKS isn't created in ProfileImpl diff --git a/chrome/test/base/ui_test_utils.cc b/chrome/test/base/ui_test_utils.cc index 61f8b26..6fe7fec 100644 --- a/chrome/test/base/ui_test_utils.cc +++ b/chrome/test/base/ui_test_utils.cc @@ -109,14 +109,14 @@ base::FilePath GetSnapshotFileName(const base::FilePath& snapshot_directory) { the_time.hour, the_time.minute, the_time.second, kSnapshotExtension)); base::FilePath snapshot_file = snapshot_directory.AppendASCII(filename); - if (file_util::PathExists(snapshot_file)) { + if (base::PathExists(snapshot_file)) { int index = 0; std::string suffix; base::FilePath trial_file; do { suffix = base::StringPrintf(" (%d)", ++index); trial_file = snapshot_file.InsertBeforeExtensionASCII(suffix); - } while (file_util::PathExists(trial_file)); + } while (base::PathExists(trial_file)); snapshot_file = trial_file; } return snapshot_file; diff --git a/chrome/test/base/v8_unit_test.cc b/chrome/test/base/v8_unit_test.cc index 1103a5c..b60502cc 100644 --- a/chrome/test/base/v8_unit_test.cc +++ b/chrome/test/base/v8_unit_test.cc @@ -67,7 +67,7 @@ bool V8UnitTest::ExecuteJavascriptLibraries() { base::FilePath library_file(*user_libraries_iterator); if (!user_libraries_iterator->IsAbsolute()) { base::FilePath gen_file = gen_test_data_directory.Append(library_file); - library_file = file_util::PathExists(gen_file) ? gen_file : + library_file = base::PathExists(gen_file) ? gen_file : test_data_directory.Append(*user_libraries_iterator); } library_file = base::MakeAbsoluteFilePath(library_file); diff --git a/chrome/test/base/web_ui_browsertest.cc b/chrome/test/base/web_ui_browsertest.cc index e523d7c..b4f4690 100644 --- a/chrome/test/base/web_ui_browsertest.cc +++ b/chrome/test/base/web_ui_browsertest.cc @@ -432,7 +432,7 @@ GURL WebUIBrowserTest::WebUITestDataPathToURL( base::FilePath dir_test_data; EXPECT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &dir_test_data)); base::FilePath test_path(dir_test_data.Append(kWebUITestFolder).Append(path)); - EXPECT_TRUE(file_util::PathExists(test_path)); + EXPECT_TRUE(base::PathExists(test_path)); return net::FilePathToFileURL(test_path); } diff --git a/chrome/test/chromedriver/chrome/chrome_finder.cc b/chrome/test/chromedriver/chrome/chrome_finder.cc index 4006174..a6e9426 100644 --- a/chrome/test/chromedriver/chrome/chrome_finder.cc +++ b/chrome/test/chromedriver/chrome/chrome_finder.cc @@ -107,7 +107,7 @@ bool FindChrome(base::FilePath* browser_exe) { locations.push_back(module_dir); GetApplicationDirs(&locations); return internal::FindExe( - base::Bind(&file_util::PathExists), + base::Bind(&base::PathExists), browser_exes, locations, browser_exe); diff --git a/chrome/test/chromedriver/chrome_launcher.cc b/chrome/test/chromedriver/chrome_launcher.cc index f7fb437..f686261 100644 --- a/chrome/test/chromedriver/chrome_launcher.cc +++ b/chrome/test/chromedriver/chrome_launcher.cc @@ -76,7 +76,7 @@ Status PrepareCommandLine(int port, if (!FindChrome(&program)) return Status(kUnknownError, "cannot find Chrome binary"); command.SetProgram(program); - } else if (!file_util::PathExists(program)) { + } else if (!base::PathExists(program)) { return Status(kUnknownError, base::StringPrintf("no chrome binary at %" PRFilePath, program.value().c_str())); diff --git a/chrome/test/chromedriver/chrome_launcher_unittest.cc b/chrome/test/chromedriver/chrome_launcher_unittest.cc index 963d928..369fb9c 100644 --- a/chrome/test/chromedriver/chrome_launcher_unittest.cc +++ b/chrome/test/chromedriver/chrome_launcher_unittest.cc @@ -49,7 +49,7 @@ TEST(ProcessExtensions, SingleExtension) { ASSERT_TRUE(status.IsOk()); ASSERT_TRUE(command.HasSwitch("load-extension")); base::FilePath temp_ext_path = command.GetSwitchValuePath("load-extension"); - ASSERT_TRUE(file_util::PathExists(temp_ext_path)); + ASSERT_TRUE(base::PathExists(temp_ext_path)); } TEST(ProcessExtensions, MultipleExtensions) { @@ -84,8 +84,8 @@ TEST(ProcessExtensions, MultipleExtensions) { std::vector<CommandLine::StringType> ext_path_list; base::SplitString(ext_paths, FILE_PATH_LITERAL(','), &ext_path_list); ASSERT_EQ(2u, ext_path_list.size()); - ASSERT_TRUE(file_util::PathExists(base::FilePath(ext_path_list[0]))); - ASSERT_TRUE(file_util::PathExists(base::FilePath(ext_path_list[1]))); + ASSERT_TRUE(base::PathExists(base::FilePath(ext_path_list[0]))); + ASSERT_TRUE(base::PathExists(base::FilePath(ext_path_list[1]))); } namespace { diff --git a/chrome/test/chromedriver/session_commands_unittest.cc b/chrome/test/chromedriver/session_commands_unittest.cc index 22c9128..33a748b 100644 --- a/chrome/test/chromedriver/session_commands_unittest.cc +++ b/chrome/test/chromedriver/session_commands_unittest.cc @@ -114,7 +114,7 @@ TEST(SessionCommandTest, FileUpload) { ASSERT_EQ(kOk, status.code()) << status.message(); base::FilePath::StringType path; ASSERT_TRUE(value->GetAsString(&path)); - ASSERT_TRUE(file_util::PathExists(base::FilePath(path))); + ASSERT_TRUE(base::PathExists(base::FilePath(path))); std::string data; ASSERT_TRUE(file_util::ReadFileToString(base::FilePath(path), &data)); ASSERT_STREQ("COW\n", data.c_str()); diff --git a/chrome/test/gpu/gpu_feature_browsertest.cc b/chrome/test/gpu/gpu_feature_browsertest.cc index 9223024..f65f799 100644 --- a/chrome/test/gpu/gpu_feature_browsertest.cc +++ b/chrome/test/gpu/gpu_feature_browsertest.cc @@ -91,7 +91,7 @@ class GpuFeatureTest : public InProcessBrowserTest { base::FilePath test_path; test_path = gpu_test_dir_.Append(url); - ASSERT_TRUE(file_util::PathExists(test_path)) + ASSERT_TRUE(base::PathExists(test_path)) << "Missing test file: " << test_path.value(); content::DOMMessageQueue message_queue; @@ -494,7 +494,7 @@ IN_PROC_BROWSER_TEST_F(GpuFeatureTest, IOSurfaceReuse) { const base::FilePath url( FILE_PATH_LITERAL("feature_compositing_static.html")); base::FilePath test_path = gpu_test_dir_.Append(url); - ASSERT_TRUE(file_util::PathExists(test_path)) + ASSERT_TRUE(base::PathExists(test_path)) << "Missing test file: " << test_path.value(); ui_test_utils::NavigateToURL(browser(), net::FilePathToFileURL(test_path)); diff --git a/chrome/test/mini_installer_test/installer_path_provider.cc b/chrome/test/mini_installer_test/installer_path_provider.cc index a4de037..5974661 100644 --- a/chrome/test/mini_installer_test/installer_path_provider.cc +++ b/chrome/test/mini_installer_test/installer_path_provider.cc @@ -110,7 +110,7 @@ bool InstallerPathProvider::GetMiniInstaller(base::FilePath* path) { // Use local copy of installer, else fall back to filer. base::FilePath mini_installer = PathFromExeDir( mini_installer_constants::kChromeMiniInstallerExecutable); - if (file_util::PathExists(mini_installer)) { + if (base::PathExists(mini_installer)) { *path = mini_installer; return true; } @@ -166,7 +166,7 @@ bool InstallerPathProvider::GetStandaloneInstaller(base::FilePath* path) { .Append(mini_installer_constants::kWinFolder) .AppendASCII(standalone_installer_filename); *path = standalone_installer; - return file_util::PathExists(standalone_installer); + return base::PathExists(standalone_installer); } bool InstallerPathProvider::GetSignedStandaloneInstaller(base::FilePath* path) { diff --git a/chrome/test/mini_installer_test/installer_test_util.cc b/chrome/test/mini_installer_test/installer_test_util.cc index 2d8e2d5..8b32f6a 100644 --- a/chrome/test/mini_installer_test/installer_test_util.cc +++ b/chrome/test/mini_installer_test/installer_test_util.cc @@ -59,7 +59,7 @@ bool DeleteInstallDirectory(bool system_level, bool has_install_dir = GetInstallDirectory(system_level, ToBrowserDistributionType(type), &path); - if (!has_install_dir || !file_util::PathExists(path)) + if (!has_install_dir || !base::PathExists(path)) return false; path = path.AppendASCII(version); return base::Delete(path, true); @@ -154,7 +154,7 @@ std::string GetVersion(InstallationValidator::InstallationType product) { } bool Install(const base::FilePath& installer) { - if (!file_util::PathExists(installer)) { + if (!base::PathExists(installer)) { LOG(ERROR) << "Installer does not exist: " << installer.MaybeAsASCII(); return false; } @@ -165,7 +165,7 @@ bool Install(const base::FilePath& installer) { } bool Install(const base::FilePath& installer, const SwitchBuilder& switches) { - if (!file_util::PathExists(installer)) { + if (!base::PathExists(installer)) { LOG(ERROR) << "Installer does not exist: " << installer.MaybeAsASCII(); return false; } @@ -279,7 +279,7 @@ bool Uninstall(bool system_level, bool RunAndWaitForCommandToFinish(CommandLine command) { - if (!file_util::PathExists(command.GetProgram())) { + if (!base::PathExists(command.GetProgram())) { LOG(ERROR) << "Command executable does not exist: " << command.GetProgram().MaybeAsASCII(); return false; diff --git a/chrome/test/mini_installer_test/run_all_unittests.cc b/chrome/test/mini_installer_test/run_all_unittests.cc index 0fd6b81..06a1c1d 100644 --- a/chrome/test/mini_installer_test/run_all_unittests.cc +++ b/chrome/test/mini_installer_test/run_all_unittests.cc @@ -29,10 +29,10 @@ void BackUpProfile(bool chrome_frame) { backup_path = backup_path.Append( mini_installer_constants::kChromeUserDataBackupDir); // Will check if User Data profile is available. - if (file_util::PathExists(path)) { + if (base::PathExists(path)) { // Will check if User Data is already backed up. // If yes, will delete and create new one. - if (file_util::PathExists(backup_path)) + if (base::PathExists(backup_path)) base::Delete(backup_path, true); base::CopyDirectory(path, backup_path, true); } else { diff --git a/chrome/test/nacl/nacl_browsertest_util.cc b/chrome/test/nacl/nacl_browsertest_util.cc index 41cf217..a5b558c 100644 --- a/chrome/test/nacl/nacl_browsertest_util.cc +++ b/chrome/test/nacl/nacl_browsertest_util.cc @@ -202,7 +202,7 @@ void NaClBrowserTestBase::SetUpInProcessBrowserTestFixture() { // Sanity check. base::FilePath plugin_lib; ASSERT_TRUE(PathService::Get(chrome::FILE_NACL_PLUGIN, &plugin_lib)); - ASSERT_TRUE(file_util::PathExists(plugin_lib)) << plugin_lib.value(); + ASSERT_TRUE(base::PathExists(plugin_lib)) << plugin_lib.value(); ASSERT_TRUE(StartTestServer()) << "Cannot start test server."; } diff --git a/chrome/test/perf/rendering/throughput_tests.cc b/chrome/test/perf/rendering/throughput_tests.cc index cbce083..e54c224 100644 --- a/chrome/test/perf/rendering/throughput_tests.cc +++ b/chrome/test/perf/rendering/throughput_tests.cc @@ -271,7 +271,7 @@ class ThroughputTest : public BrowserPerfTest { test_path = test_path.Append(FILE_PATH_LITERAL("throughput")); test_path = test_path.AppendASCII(test_name); test_path = test_path.Append(FILE_PATH_LITERAL("index.html")); - ASSERT_TRUE(file_util::PathExists(test_path)) + ASSERT_TRUE(base::PathExists(test_path)) << "Missing test file: " << test_path.value(); gurl_ = net::FilePathToFileURL(test_path); @@ -286,7 +286,7 @@ class ThroughputTest : public BrowserPerfTest { test_path = test_path.Append(FILE_PATH_LITERAL("perf")); test_path = test_path.Append(FILE_PATH_LITERAL("canvas_bench")); test_path = test_path.AppendASCII(test_name + ".html"); - ASSERT_TRUE(file_util::PathExists(test_path)) + ASSERT_TRUE(base::PathExists(test_path)) << "Missing test file: " << test_path.value(); gurl_ = net::FilePathToFileURL(test_path); diff --git a/chrome/test/perf/shutdown_test.cc b/chrome/test/perf/shutdown_test.cc index a078833..93495a0 100644 --- a/chrome/test/perf/shutdown_test.cc +++ b/chrome/test/perf/shutdown_test.cc @@ -57,7 +57,7 @@ class ShutdownTest : public UIPerfTest { }; for (size_t i = 0; i < arraysize(test_cases); i++) { - ASSERT_TRUE(file_util::PathExists(test_cases[i])); + ASSERT_TRUE(base::PathExists(test_cases[i])); for (size_t j = 0; j < 5; j++) { ASSERT_TRUE(browser_proxy->AppendTab( net::FilePathToFileURL(test_cases[i]))); diff --git a/chrome/test/perf/startup_test.cc b/chrome/test/perf/startup_test.cc index 72b39d2..6b3e62f 100644 --- a/chrome/test/perf/startup_test.cc +++ b/chrome/test/perf/startup_test.cc @@ -60,7 +60,7 @@ class StartupTest : public UIPerfTest { const base::FilePath file_url = ui_test_utils::GetTestFilePath( base::FilePath(base::FilePath::kCurrentDirectory), base::FilePath(FILE_PATH_LITERAL("simple.html"))); - ASSERT_TRUE(file_util::PathExists(file_url)); + ASSERT_TRUE(base::PathExists(file_url)); launch_arguments_.AppendArgPath(file_url); } diff --git a/chrome/test/ppapi/ppapi_test.cc b/chrome/test/ppapi/ppapi_test.cc index daed946..4c88158 100644 --- a/chrome/test/ppapi/ppapi_test.cc +++ b/chrome/test/ppapi/ppapi_test.cc @@ -152,7 +152,7 @@ GURL PPAPITestBase::GetTestFileUrl(const std::string& test_case) { test_path = test_path.Append(FILE_PATH_LITERAL("test_case.html")); // Sanity check the file name. - EXPECT_TRUE(file_util::PathExists(test_path)); + EXPECT_TRUE(base::PathExists(test_path)); GURL test_url = net::FilePathToFileURL(test_path); @@ -294,7 +294,7 @@ void PPAPITest::SetUpCommandLine(CommandLine* command_line) { EXPECT_TRUE(PathService::Get(base::DIR_MODULE, &plugin_dir)); base::FilePath plugin_lib = plugin_dir.Append(library_name); - EXPECT_TRUE(file_util::PathExists(plugin_lib)); + EXPECT_TRUE(base::PathExists(plugin_lib)); base::FilePath::StringType pepper_plugin = plugin_lib.value(); pepper_plugin.append(FILE_PATH_LITERAL(";application/x-ppapi-tests")); command_line->AppendSwitchNative(switches::kRegisterPepperPlugins, @@ -325,7 +325,7 @@ void PPAPINaClTest::SetUpCommandLine(CommandLine* command_line) { base::FilePath plugin_lib; EXPECT_TRUE(PathService::Get(chrome::FILE_NACL_PLUGIN, &plugin_lib)); - EXPECT_TRUE(file_util::PathExists(plugin_lib)); + EXPECT_TRUE(base::PathExists(plugin_lib)); // Enable running NaCl outside of the store. command_line->AppendSwitch(switches::kEnableNaCl); @@ -362,7 +362,7 @@ void PPAPINaClTestDisallowedSockets::SetUpCommandLine( base::FilePath plugin_lib; EXPECT_TRUE(PathService::Get(chrome::FILE_NACL_PLUGIN, &plugin_lib)); - EXPECT_TRUE(file_util::PathExists(plugin_lib)); + EXPECT_TRUE(base::PathExists(plugin_lib)); // Enable running NaCl outside of the store. command_line->AppendSwitch(switches::kEnableNaCl); diff --git a/chrome/test/webdriver/commands/webelement_commands.cc b/chrome/test/webdriver/commands/webelement_commands.cc index 5ecff82..1bea1de 100644 --- a/chrome/test/webdriver/commands/webelement_commands.cc +++ b/chrome/test/webdriver/commands/webelement_commands.cc @@ -561,7 +561,7 @@ Error* ElementValueCommand::DragAndDropFilePaths() const { // Check the files exist. for (size_t i = 0; i < paths.size(); ++i) { - if (!file_util::PathExists(base::FilePath(paths[i]))) { + if (!base::PathExists(base::FilePath(paths[i]))) { return new Error( kBadRequest, base::StringPrintf("'%s' does not exist on the file system", diff --git a/chrome/test/webdriver/webdriver_automation.cc b/chrome/test/webdriver/webdriver_automation.cc index 418e0b2..1fa60ab 100644 --- a/chrome/test/webdriver/webdriver_automation.cc +++ b/chrome/test/webdriver/webdriver_automation.cc @@ -54,7 +54,7 @@ bool CheckForChromeExe(const std::vector<base::FilePath>& browser_exes, for (size_t i = 0; i < browser_exes.size(); ++i) { for (size_t j = 0; j < locations.size(); ++j) { base::FilePath path = locations[j].Append(browser_exes[i]); - if (file_util::PathExists(path)) { + if (base::PathExists(path)) { *browser_exe = path; return true; } @@ -97,7 +97,7 @@ bool GetDefaultChromeExe(base::FilePath* browser_exe) { if (PathService::Get(base::DIR_MODULE, &module_dir)) { for (size_t j = 0; j < browser_exes.size(); ++j) { base::FilePath path = module_dir.Append(browser_exes[j]); - if (file_util::PathExists(path)) { + if (base::PathExists(path)) { *browser_exe = path; return true; } @@ -411,7 +411,7 @@ void Automation::Init( } command.SetProgram(browser_exe); } - if (!file_util::PathExists(command.GetProgram())) { + if (!base::PathExists(command.GetProgram())) { std::string message = base::StringPrintf( "Could not find Chrome binary at: %" PRFilePath, command.GetProgram().value().c_str()); |