summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/metrics/metrics_service_uitest.cc2
-rw-r--r--chrome/test/memory_test/memory_test.cc4
-rw-r--r--chrome/test/reliability/page_load_test.cc2
-rw-r--r--chrome/test/ui/ui_test.cc16
-rw-r--r--chrome/test/ui/ui_test.h6
5 files changed, 13 insertions, 17 deletions
diff --git a/chrome/browser/metrics/metrics_service_uitest.cc b/chrome/browser/metrics/metrics_service_uitest.cc
index a994767..880d648 100644
--- a/chrome/browser/metrics/metrics_service_uitest.cc
+++ b/chrome/browser/metrics/metrics_service_uitest.cc
@@ -49,7 +49,7 @@ class MetricsServiceTest : public UITest {
// that was saved by the app as it closed. The caller takes ownership of the
// returned PrefService object.
PrefService* GetLocalState() {
- FilePath local_state_path = FilePath::FromWStringHack(user_data_dir())
+ FilePath local_state_path = user_data_dir()
.Append(chrome::kLocalStateFilename);
PrefService* local_state(new PrefService(local_state_path));
diff --git a/chrome/test/memory_test/memory_test.cc b/chrome/test/memory_test/memory_test.cc
index 51be538..b1c213a 100644
--- a/chrome/test/memory_test/memory_test.cc
+++ b/chrome/test/memory_test/memory_test.cc
@@ -270,7 +270,7 @@ class MemoryTest : public UITest {
void PrintIOPerfInfo(const char* test_name) {
printf("\n");
- FilePath data_dir(FilePath::FromWStringHack(user_data_dir()));
+ FilePath data_dir(user_data_dir());
int browser_process_pid = ChromeBrowserProcessId(data_dir);
ChromeProcessList chrome_processes(GetRunningChromeProcesses(data_dir));
@@ -318,7 +318,7 @@ class MemoryTest : public UITest {
void PrintMemoryUsageInfo(const char* test_name) {
printf("\n");
- FilePath data_dir(FilePath::FromWStringHack(user_data_dir()));
+ FilePath data_dir(user_data_dir());
int browser_process_pid = ChromeBrowserProcessId(data_dir);
ChromeProcessList chrome_processes(GetRunningChromeProcesses(data_dir));
diff --git a/chrome/test/reliability/page_load_test.cc b/chrome/test/reliability/page_load_test.cc
index fc44ea4..97f31e2 100644
--- a/chrome/test/reliability/page_load_test.cc
+++ b/chrome/test/reliability/page_load_test.cc
@@ -522,7 +522,7 @@ class PageLoadTest : public UITest {
// that was saved by the app as it closed. The caller takes ownership of the
// returned PrefService object.
PrefService* GetLocalState() {
- FilePath local_state_path = FilePath::FromWStringHack(user_data_dir())
+ FilePath local_state_path = user_data_dir()
.Append(chrome::kLocalStateFilename);
PrefService* local_state(new PrefService(local_state_path));
diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc
index f0f29aa..a5f2566 100644
--- a/chrome/test/ui/ui_test.cc
+++ b/chrome/test/ui/ui_test.cc
@@ -95,9 +95,6 @@ bool UITest::DieFileDie(const FilePath& file, bool recurse) {
}
return false;
}
-bool UITest::DieFileDie(const std::wstring& file, bool recurse) {
- return DieFileDie(FilePath::FromWStringHack(file), recurse);
-}
UITest::UITest()
: testing::Test(),
@@ -302,7 +299,7 @@ void UITest::LaunchBrowser(const CommandLine& arguments, bool clear_profile) {
PathService::Get(chrome::DIR_USER_DATA, &user_data_dir_);
if (!user_data_dir_.empty())
command_line.AppendSwitchWithValue(switches::kUserDataDir,
- user_data_dir_);
+ user_data_dir_.ToWStringHack());
if (!js_flags_.empty())
command_line.AppendSwitchWithValue(switches::kJavaScriptFlags,
js_flags_);
@@ -332,7 +329,7 @@ void UITest::LaunchBrowser(const CommandLine& arguments, bool clear_profile) {
// Clear user data directory to make sure test environment is consistent
// We balk on really short (absolute) user_data_dir directory names, because
// we're worried that they'd accidentally be root or something.
- ASSERT_LT(10, static_cast<int>(user_data_dir_.size())) <<
+ ASSERT_LT(10, static_cast<int>(user_data_dir_.value().size())) <<
"The user data directory name passed into this test was too "
"short to delete safely. Please check the user-data-dir "
"argument and try again.";
@@ -341,8 +338,9 @@ void UITest::LaunchBrowser(const CommandLine& arguments, bool clear_profile) {
if (!template_user_data_.empty()) {
// Recursively copy the template directory to the user_data_dir.
- ASSERT_TRUE(file_util::CopyRecursiveDirNoCache(template_user_data_,
- user_data_dir_));
+ ASSERT_TRUE(file_util::CopyRecursiveDirNoCache(
+ template_user_data_,
+ user_data_dir_.ToWStringHack()));
}
browser_launch_time_ = TimeTicks::Now();
@@ -378,7 +376,7 @@ void UITest::LaunchBrowser(const CommandLine& arguments, bool clear_profile) {
if (use_existing_browser_) {
DWORD pid = 0;
HWND hwnd = FindWindowEx(HWND_MESSAGE, NULL, chrome::kMessageWindowClass,
- user_data_dir_.c_str());
+ user_data_dir_.value().c_str());
GetWindowThreadProcessId(hwnd, &pid);
// This mode doesn't work if we wound up launching a new browser ourselves.
ASSERT_NE(pid, base::GetProcId(process_));
@@ -451,7 +449,7 @@ void UITest::AssertAppNotRunning(const std::wstring& error_message) {
void UITest::CleanupAppProcesses() {
#if defined(OS_WIN) || defined(OS_LINUX)
- TerminateAllChromeProcesses(FilePath::FromWStringHack(user_data_dir()));
+ TerminateAllChromeProcesses(user_data_dir());
// Suppress spammy failures that seem to be occurring when running
// the UI tests in single-process mode.
diff --git a/chrome/test/ui/ui_test.h b/chrome/test/ui/ui_test.h
index 75ecae2..0fad7a1 100644
--- a/chrome/test/ui/ui_test.h
+++ b/chrome/test/ui/ui_test.h
@@ -70,8 +70,6 @@ class UITest : public testing::Test {
// and shouldn't be necessary on POSIX, but it can't hurt.)
// Returns true on success.
bool DieFileDie(const FilePath& file, bool recurse);
- // Deprecated backwards-compat version.
- bool DieFileDie(const std::wstring& file, bool recurse);
// Launches the browser and IPC testing server.
void LaunchBrowserAndServer();
@@ -331,7 +329,7 @@ class UITest : public testing::Test {
// Return the user data directory being used by the browser instance in
// UITest::SetUp().
- std::wstring user_data_dir() const { return user_data_dir_; }
+ FilePath user_data_dir() const { return user_data_dir_; }
// Timeout accessors.
int command_execution_timeout_ms() const {
@@ -432,7 +430,7 @@ class UITest : public testing::Test {
// test run the dom automation case.
std::wstring template_user_data_; // See set_template_user_data().
base::ProcessHandle process_; // Handle to the first Chrome process.
- std::wstring user_data_dir_; // User data directory used for the test
+ FilePath user_data_dir_; // User data directory used for the test
static bool in_process_renderer_; // true if we're in single process mode
bool show_window_; // Determines if the window is shown or
// hidden. Defaults to hidden.