summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-02 00:56:57 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-02 00:56:57 +0000
commit4b68e0d50c4a69b91a384b698a96f6a51ca7241f (patch)
treea11dc1b6baf8d2e1d1c3d8b7930fb9ca0cec46eb /chrome
parent82d10b14f9b4150ce1e154629dec9dcddadcf272 (diff)
downloadchromium_src-4b68e0d50c4a69b91a384b698a96f6a51ca7241f.zip
chromium_src-4b68e0d50c4a69b91a384b698a96f6a51ca7241f.tar.gz
chromium_src-4b68e0d50c4a69b91a384b698a96f6a51ca7241f.tar.bz2
Yet more deprecation of the wstring version of PathService::Get() for UI tests.
Review URL: http://codereview.chromium.org/99298 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15127 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/app/chrome_main_uitest.cc10
-rw-r--r--chrome/browser/browser_uitest.cc16
-rw-r--r--chrome/browser/crash_recovery_uitest.cc3
-rw-r--r--chrome/browser/history/redirect_uitest.cc9
-rw-r--r--chrome/browser/iframe_uitest.cc4
-rw-r--r--chrome/browser/images_uitest.cc8
-rw-r--r--chrome/browser/printing/printing_layout_uitest.cc4
-rw-r--r--chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc4
-rw-r--r--chrome/browser/sanity_uitest.cc16
-rw-r--r--chrome/browser/session_history_uitest.cc6
-rw-r--r--chrome/browser/sessions/session_restore_uitest.cc5
-rw-r--r--chrome/browser/tab_restore_uitest.cc3
-rw-r--r--chrome/browser/views/constrained_window_impl_interactive_uitest.cc3
-rw-r--r--chrome/common/l10n_util.cc16
-rw-r--r--chrome/common/l10n_util_unittest.cc46
-rw-r--r--chrome/common/pref_service_uitest.cc3
-rw-r--r--chrome/test/accessibility/accessibility_tests.cc14
-rw-r--r--chrome/test/automation/automation_proxy_uitest.cc46
-rw-r--r--chrome/test/memory_test/memory_test.cc6
-rw-r--r--chrome/test/page_cycler/page_cycler_test.cc11
-rw-r--r--chrome/test/plugin/plugin_test.cpp2
-rw-r--r--chrome/test/startup/startup_test.cc15
-rw-r--r--chrome/test/ui/layout_plugin_uitest.cc4
-rw-r--r--chrome/test/ui/npapi_test_helper.cc6
-rw-r--r--chrome/test/ui/sunspider_uitest.cc3
-rw-r--r--chrome/test/ui/ui_test.cc17
-rw-r--r--chrome/test/ui/ui_test.h7
-rw-r--r--chrome/test/ui/v8_benchmark_uitest.cc2
-rw-r--r--chrome/test/unit/chrome_test_suite.h19
29 files changed, 147 insertions, 161 deletions
diff --git a/chrome/app/chrome_main_uitest.cc b/chrome/app/chrome_main_uitest.cc
index b70e58c..5ce05c2 100644
--- a/chrome/app/chrome_main_uitest.cc
+++ b/chrome/app/chrome_main_uitest.cc
@@ -5,7 +5,6 @@
#include "chrome/test/ui/ui_test.h"
#include "base/command_line.h"
-#include "base/file_path.h"
#include "base/file_util.h"
#include "net/base/net_util.h"
@@ -48,16 +47,13 @@ TEST_F(ChromeMainTest, ReuseBrowserInstanceWhenOpeningFile) {
include_testing_id_ = false;
use_existing_browser_ = true;
- std::wstring test_file = test_data_directory_;
- file_util::AppendToPath(&test_file, L"empty.html");
+ FilePath test_file = test_data_directory_.AppendASCII("empty.html");
CommandLine command_line(L"");
- command_line.AppendLooseValue(test_file);
+ command_line.AppendLooseValue(test_file.ToWStringHack());
LaunchBrowser(command_line, false);
- FilePath test_file_path(FilePath::FromWStringHack(test_file));
-
ASSERT_TRUE(automation()->WaitForURLDisplayed(
- net::FilePathToFileURL(test_file_path), action_timeout_ms()));
+ net::FilePathToFileURL(test_file), action_timeout_ms()));
}
diff --git a/chrome/browser/browser_uitest.cc b/chrome/browser/browser_uitest.cc
index 55ed855..90110fb 100644
--- a/chrome/browser/browser_uitest.cc
+++ b/chrome/browser/browser_uitest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/file_util.h"
+#include "base/file_path.h"
#include "base/gfx/native_widget_types.h"
#include "base/string_util.h"
#include "base/sys_info.h"
@@ -71,7 +71,7 @@ class VisibleBrowserTest : public UITest {
// Launch the app on a page with no title, check that the app title was set
// correctly.
TEST_F(BrowserTest, NoTitle) {
- FilePath test_file(FilePath::FromWStringHack(test_data_directory_));
+ FilePath test_file(test_data_directory_);
test_file = test_file.AppendASCII("title1.html");
NavigateToURL(net::FilePathToFileURL(test_file));
@@ -84,7 +84,7 @@ TEST_F(BrowserTest, NoTitle) {
// Launch the app, navigate to a page with a title, check that the app title
// was set correctly.
TEST_F(BrowserTest, Title) {
- FilePath test_file(FilePath::FromWStringHack(test_data_directory_));
+ FilePath test_file(test_data_directory_);
test_file = test_file.AppendASCII("title2.html");
NavigateToURL(net::FilePathToFileURL(test_file));
@@ -101,7 +101,7 @@ TEST_F(BrowserTest, Title) {
// had a hard limit of 31 processes and this test is mainly directed at
// verifying that we don't crash when we pass this limit.
TEST_F(BrowserTest, ThirtyFourTabs) {
- FilePath test_file(FilePath::FromWStringHack(test_data_directory_));
+ FilePath test_file(test_data_directory_);
test_file = test_file.AppendASCII("title2.html");
GURL url(net::FilePathToFileURL(test_file));
scoped_ptr<BrowserProxy> window(automation()->GetBrowserWindow(0));
@@ -128,7 +128,7 @@ TEST_F(BrowserTest, ThirtyFourTabs) {
#if defined(OS_WIN)
// The browser should quit quickly if it receives a WM_ENDSESSION message.
TEST_F(BrowserTest, WindowsSessionEnd) {
- FilePath test_file(FilePath::FromWStringHack(test_data_directory_));
+ FilePath test_file(test_data_directory_);
test_file = test_file.AppendASCII("title1.html");
NavigateToURL(net::FilePathToFileURL(test_file));
@@ -199,7 +199,7 @@ TEST_F(BrowserTest, NullOpenerRedirectForksProcess) {
scoped_refptr<HTTPTestServer> server =
HTTPTestServer::CreateServer(kDocRoot, NULL);
ASSERT_TRUE(NULL != server.get());
- FilePath test_file(FilePath::FromWStringHack(test_data_directory_));
+ FilePath test_file(test_data_directory_);
scoped_ptr<BrowserProxy> window(automation()->GetBrowserWindow(0));
scoped_ptr<TabProxy> tab(window->GetActiveTab());
@@ -241,7 +241,7 @@ TEST_F(BrowserTest, OtherRedirectsDontForkProcess) {
scoped_refptr<HTTPTestServer> server =
HTTPTestServer::CreateServer(kDocRoot, NULL);
ASSERT_TRUE(NULL != server.get());
- FilePath test_file(FilePath::FromWStringHack(test_data_directory_));
+ FilePath test_file(test_data_directory_);
scoped_ptr<BrowserProxy> window(automation()->GetBrowserWindow(0));
scoped_ptr<TabProxy> tab(window->GetActiveTab());
@@ -281,7 +281,7 @@ TEST_F(BrowserTest, OtherRedirectsDontForkProcess) {
#if defined(OS_WIN)
// TODO(estade): need to port GetActiveTabTitle().
TEST_F(VisibleBrowserTest, WindowOpenClose) {
- FilePath test_file(FilePath::FromWStringHack(test_data_directory_));
+ FilePath test_file(test_data_directory_);
test_file = test_file.AppendASCII("window.close.html");
NavigateToURL(net::FilePathToFileURL(test_file));
diff --git a/chrome/browser/crash_recovery_uitest.cc b/chrome/browser/crash_recovery_uitest.cc
index 994661b..551e323 100644
--- a/chrome/browser/crash_recovery_uitest.cc
+++ b/chrome/browser/crash_recovery_uitest.cc
@@ -3,7 +3,6 @@
// found in the LICENSE file.
#include "base/file_path.h"
-#include "base/file_util.h"
#include "base/platform_thread.h"
#include "chrome/test/automation/browser_proxy.h"
#include "chrome/test/automation/tab_proxy.h"
@@ -53,7 +52,7 @@ TEST_F(CrashRecoveryUITest, LoadInNewTab) {
return;
// The title of the active tab should change each time this URL is loaded.
- FilePath test_file(FilePath::FromWStringHack(test_data_directory_));
+ FilePath test_file(test_data_directory_);
test_file = test_file.AppendASCII("title2.html");
GURL url(net::FilePathToFileURL(test_file));
diff --git a/chrome/browser/history/redirect_uitest.cc b/chrome/browser/history/redirect_uitest.cc
index 929a5e1..e51e992 100644
--- a/chrome/browser/history/redirect_uitest.cc
+++ b/chrome/browser/history/redirect_uitest.cc
@@ -7,7 +7,6 @@
// here might indicate that WebKit changed the calls our glue layer gets in
// the case of redirects. It may also mean problems with the history system.
-#include "base/file_path.h"
#include "base/file_util.h"
#include "base/platform_thread.h"
#include "base/scoped_ptr.h"
@@ -80,7 +79,7 @@ TEST_F(RedirectTest, ClientEmptyReferer) {
ASSERT_TRUE(NULL != server.get());
GURL final_url = server->TestServerPageW(std::wstring());
- FilePath test_file(FilePath::FromWStringHack(test_data_directory_));
+ FilePath test_file(test_data_directory_);
test_file = test_file.AppendASCII("file_client_redirect.html");
GURL first_url = net::FilePathToFileURL(test_file);
@@ -106,7 +105,7 @@ TEST_F(RedirectTest, ClientEmptyReferer) {
// Tests to make sure a location change when a pending redirect exists isn't
// flagged as a redirect.
TEST_F(RedirectTest, ClientCancelled) {
- FilePath first_path(FilePath::FromWStringHack(test_data_directory_));
+ FilePath first_path(test_data_directory_);
first_path = first_path.AppendASCII("cancelled_redirect_test.html");
ASSERT_TRUE(file_util::AbsolutePath(&first_path));
GURL first_url = net::FilePathToFileURL(first_path);
@@ -202,7 +201,7 @@ TEST_F(RedirectTest, NoHttpToFile) {
scoped_refptr<HTTPTestServer> server =
HTTPTestServer::CreateServer(kDocRoot, NULL);
ASSERT_TRUE(NULL != server.get());
- FilePath test_file(FilePath::FromWStringHack(test_data_directory_));
+ FilePath test_file(test_data_directory_);
test_file = test_file.AppendASCII("http_to_file.html");
GURL file_url = net::FilePathToFileURL(test_file);
@@ -226,7 +225,7 @@ TEST_F(RedirectTest, ClientFragments) {
HTTPTestServer::CreateServer(kDocRoot, NULL);
ASSERT_TRUE(NULL != server.get());
- FilePath test_file(FilePath::FromWStringHack(test_data_directory_));
+ FilePath test_file(test_data_directory_);
test_file = test_file.AppendASCII("ref_redirect.html");
GURL first_url = net::FilePathToFileURL(test_file);
std::vector<GURL> redirects;
diff --git a/chrome/browser/iframe_uitest.cc b/chrome/browser/iframe_uitest.cc
index 347610c..845ef08 100644
--- a/chrome/browser/iframe_uitest.cc
+++ b/chrome/browser/iframe_uitest.cc
@@ -4,7 +4,6 @@
#include "base/basictypes.h"
#include "base/file_path.h"
-#include "base/file_util.h"
#include "base/platform_thread.h"
#include "build/build_config.h"
#include "chrome/test/ui/ui_test.h"
@@ -13,7 +12,7 @@
class IFrameTest : public UITest {
protected:
void NavigateAndVerifyTitle(const char* url, const wchar_t* page_title) {
- FilePath test_file(FilePath::FromWStringHack(test_data_directory_));
+ FilePath test_file(test_data_directory_);
test_file = test_file.AppendASCII(url);
NavigateToURL(net::FilePathToFileURL(test_file));
@@ -25,7 +24,6 @@ class IFrameTest : public UITest {
// UITest will check if this crashed.
}
-
};
TEST_F(IFrameTest, Crash) {
diff --git a/chrome/browser/images_uitest.cc b/chrome/browser/images_uitest.cc
index 59dffda..a9f7605 100644
--- a/chrome/browser/images_uitest.cc
+++ b/chrome/browser/images_uitest.cc
@@ -3,17 +3,17 @@
// found in the LICENSE file.
#include "base/basictypes.h"
-#include "base/file_util.h"
+#include "base/file_path.h"
#include "base/platform_thread.h"
#include "chrome/test/ui/ui_test.h"
class ImagesTest : public UITest {
protected:
ImagesTest() : UITest() {
- std::wstring path = test_data_directory_;
- file_util::AppendToPath(&path, L"animated-gifs.html");
+ FilePath path(test_data_directory_);
+ path = path.AppendASCII("animated-gifs.html");
launch_arguments_ = CommandLine(L"");
- launch_arguments_.AppendLooseValue(path);
+ launch_arguments_.AppendLooseValue(path.ToWStringHack());
}
};
diff --git a/chrome/browser/printing/printing_layout_uitest.cc b/chrome/browser/printing/printing_layout_uitest.cc
index 3890df2..fe51136 100644
--- a/chrome/browser/printing/printing_layout_uitest.cc
+++ b/chrome/browser/printing/printing_layout_uitest.cc
@@ -199,7 +199,7 @@ class Image {
class PrintingLayoutTest : public PrintingTest<UITest> {
public:
PrintingLayoutTest() {
- emf_path_ = browser_directory_;
+ emf_path_ = browser_directory_.ToWStringHack();
file_util::AppendToPath(&emf_path_, L"emf_dumps");
launch_arguments_.AppendSwitchWithValue(L"debug-print",
L'"' + emf_path_ + L'"');
@@ -238,7 +238,7 @@ class PrintingLayoutTest : public PrintingTest<UITest> {
return 100.;
}
- std::wstring verification_file(test_data_directory_);
+ std::wstring verification_file(test_data_directory_.ToWStringHack());
file_util::AppendToPath(&verification_file, L"printing");
file_util::AppendToPath(&verification_file, verification_name);
std::wstring emf(verification_file + L".emf");
diff --git a/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc b/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc
index 4454c1f..4c410e3 100644
--- a/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc
+++ b/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc
@@ -6,7 +6,7 @@
#include <string>
#include "base/command_line.h"
-#include "base/file_util.h"
+#include "base/file_path.h"
#include "base/path_service.h"
#include "base/string_util.h"
#include "chrome/browser/automation/url_request_failed_dns_job.h"
@@ -237,7 +237,7 @@ TEST_F(ResourceDispatcherTest, CrossSiteNavigationNonBuffered) {
// Now load a file:// page, which does not use the BufferedEventHandler.
// Make sure that the page loads and displays a title, and doesn't get stuck.
- FilePath test_file(FilePath::FromWStringHack(test_data_directory_));
+ FilePath test_file(test_data_directory_);
test_file = test_file.AppendASCII("title2.html");
bool timed_out = false;
tab->NavigateToURLWithTimeout(net::FilePathToFileURL(test_file),
diff --git a/chrome/browser/sanity_uitest.cc b/chrome/browser/sanity_uitest.cc
index 77cc14d..2eaded0 100644
--- a/chrome/browser/sanity_uitest.cc
+++ b/chrome/browser/sanity_uitest.cc
@@ -8,16 +8,16 @@
#include "chrome/test/ui/ui_test.h"
#include "base/basictypes.h"
-#include "base/file_util.h"
+#include "base/file_path.h"
#include "base/platform_thread.h"
class GoogleTest : public UITest {
protected:
GoogleTest() : UITest() {
- std::wstring test_file = test_data_directory_;
- file_util::AppendToPath(&test_file, L"google");
- file_util::AppendToPath(&test_file, L"google.html");
- homepage_ = test_file;
+ FilePath test_file(test_data_directory_);
+ test_file = test_file.AppendASCII("google");
+ test_file = test_file.AppendASCII("google.html");
+ homepage_ = test_file.ToWStringHack();
}
};
@@ -33,9 +33,9 @@ TEST_F(GoogleTest, Crash) {
class ColumnLayout : public UITest {
protected:
ColumnLayout() : UITest() {
- std::wstring test_file = test_data_directory_;
- file_util::AppendToPath(&test_file, L"columns.html");
- homepage_ = test_file;
+ FilePath test_file(test_data_directory_);
+ test_file = test_file.AppendASCII("columns.html");
+ homepage_ = test_file.ToWStringHack();
}
};
diff --git a/chrome/browser/session_history_uitest.cc b/chrome/browser/session_history_uitest.cc
index fa5cb79..4fd7ba4 100644
--- a/chrome/browser/session_history_uitest.cc
+++ b/chrome/browser/session_history_uitest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/file_util.h"
+#include "base/file_path.h"
#include "base/platform_thread.h"
#include "base/string_util.h"
#include "chrome/common/l10n_util.h"
@@ -22,7 +22,7 @@ const wchar_t kDocRoot[] = L"chrome/test/data";
class SessionHistoryTest : public UITest {
protected:
SessionHistoryTest() : UITest() {
- FilePath path = FilePath::FromWStringHack(test_data_directory_);
+ FilePath path(test_data_directory_);
path = path.AppendASCII("session_history");
url_prefix_ = UTF8ToWide(net::FilePathToFileURL(path).spec());
@@ -317,7 +317,7 @@ TEST_F(SessionHistoryTest, DISABLED_CrossFrameFormBackForward) {
// history is [blank, bot1, *form, post]
- //ClickLink(L"abot2");
+ // ClickLink(L"abot2");
GURL bot2("files/session_history/bot2.html");
ASSERT_TRUE(tab_->NavigateToURL(bot2));
EXPECT_EQ(L"bot2", GetTabTitle());
diff --git a/chrome/browser/sessions/session_restore_uitest.cc b/chrome/browser/sessions/session_restore_uitest.cc
index 0b7315a..8b2a364 100644
--- a/chrome/browser/sessions/session_restore_uitest.cc
+++ b/chrome/browser/sessions/session_restore_uitest.cc
@@ -3,7 +3,7 @@
// found in the LICENSE file.
#include "base/command_line.h"
-#include "base/file_util.h"
+#include "base/file_path.h"
#include "base/scoped_ptr.h"
#include "base/string_util.h"
#include "chrome/app/chrome_dll_resource.h"
@@ -22,8 +22,7 @@ namespace {
class SessionRestoreUITest : public UITest {
protected:
SessionRestoreUITest() : UITest() {
- FilePath path_prefix = FilePath::FromWStringHack(test_data_directory_)
- .AppendASCII("session_history");
+ FilePath path_prefix = test_data_directory_.AppendASCII("session_history");
url1 = net::FilePathToFileURL(path_prefix.AppendASCII("bot1.html"));
url2 = net::FilePathToFileURL(path_prefix.AppendASCII("bot2.html"));
diff --git a/chrome/browser/tab_restore_uitest.cc b/chrome/browser/tab_restore_uitest.cc
index 43d9436..4e01e8d 100644
--- a/chrome/browser/tab_restore_uitest.cc
+++ b/chrome/browser/tab_restore_uitest.cc
@@ -5,7 +5,6 @@
#include "base/basictypes.h"
#include "base/command_line.h"
#include "base/file_path.h"
-#include "base/file_util.h"
#if defined(OS_WIN)
#include "base/win_util.h"
#endif
@@ -24,7 +23,7 @@
class TabRestoreUITest : public UITest {
public:
TabRestoreUITest() : UITest() {
- FilePath path_prefix(FilePath::FromWStringHack(test_data_directory_));
+ FilePath path_prefix(test_data_directory_);
path_prefix = path_prefix.AppendASCII("session_history");
url1_ = net::FilePathToFileURL(path_prefix.AppendASCII("bot1.html"));
url2_ = net::FilePathToFileURL(path_prefix.AppendASCII("bot2.html"));
diff --git a/chrome/browser/views/constrained_window_impl_interactive_uitest.cc b/chrome/browser/views/constrained_window_impl_interactive_uitest.cc
index 9eef16c..40a156a 100644
--- a/chrome/browser/views/constrained_window_impl_interactive_uitest.cc
+++ b/chrome/browser/views/constrained_window_impl_interactive_uitest.cc
@@ -5,7 +5,6 @@
#include <string>
#include "base/file_path.h"
-#include "base/file_util.h"
#include "chrome/browser/view_ids.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/l10n_util.h"
@@ -39,7 +38,7 @@ class InteractiveConstrainedWindowTest : public UITest {
}
void NavigateMainTabTo(const std::wstring& file_name) {
- FilePath filename(FilePath::FromWStringHack(test_data_directory_));
+ FilePath filename(test_data_directory_);
filename = filename.AppendASCII("constrained_files");
filename = filename.Append(FilePath::FromWStringHack(file_name));
ASSERT_TRUE(tab_->NavigateToURL(net::FilePathToFileURL(filename)));
diff --git a/chrome/common/l10n_util.cc b/chrome/common/l10n_util.cc
index 2b47e5f..1039a1d 100644
--- a/chrome/common/l10n_util.cc
+++ b/chrome/common/l10n_util.cc
@@ -7,7 +7,6 @@
#include "chrome/common/l10n_util.h"
#include "base/command_line.h"
-#include "base/file_path.h"
#include "base/file_util.h"
#include "base/path_service.h"
#include "base/scoped_ptr.h"
@@ -229,7 +228,7 @@ std::wstring GetApplicationLocale(const std::wstring& pref_locale) {
// TODO(pinkerton): break this out into a .mm and ask Cocoa.
return L"en";
#else
- std::wstring locale_path;
+ FilePath locale_path;
PathService::Get(chrome::DIR_LOCALES, &locale_path);
std::wstring resolved_locale;
@@ -238,24 +237,27 @@ std::wstring GetApplicationLocale(const std::wstring& pref_locale) {
const std::wstring& lang_arg =
parsed_command_line.GetSwitchValue(switches::kLang);
if (!lang_arg.empty()) {
- if (CheckAndResolveLocale(lang_arg, locale_path, &resolved_locale))
+ if (CheckAndResolveLocale(lang_arg, locale_path.ToWStringHack(),
+ &resolved_locale))
return resolved_locale;
}
// Second, try user prefs.
if (!pref_locale.empty()) {
- if (CheckAndResolveLocale(pref_locale, locale_path, &resolved_locale))
+ if (CheckAndResolveLocale(pref_locale, locale_path.ToWStringHack(),
+ &resolved_locale))
return resolved_locale;
}
// Next, try the system locale.
const std::wstring system_locale = GetSystemLocale();
- if (CheckAndResolveLocale(system_locale, locale_path, &resolved_locale))
+ if (CheckAndResolveLocale(system_locale, locale_path.ToWStringHack(),
+ &resolved_locale))
return resolved_locale;
// Fallback on en-US.
const std::wstring fallback_locale(L"en-US");
- if (IsLocaleAvailable(fallback_locale, locale_path))
+ if (IsLocaleAvailable(fallback_locale, locale_path.ToWStringHack()))
return fallback_locale;
// No locale data file was found; we shouldn't get here.
@@ -479,7 +481,7 @@ TextDirection GetTextDirection() {
}
TextDirection GetTextDirectionForLocale(const char* locale_name) {
- UScriptCode scripts[10]; // 10 scripts should be enough for any locale.
+ UScriptCode scripts[10]; // 10 scripts should be enough for any locale.
UErrorCode error = U_ZERO_ERROR;
int n = uscript_getCode(locale_name, scripts, 10, &error);
DCHECK(U_SUCCESS(error) && n > 0);
diff --git a/chrome/common/l10n_util_unittest.cc b/chrome/common/l10n_util_unittest.cc
index c7ade0f..668e88c 100644
--- a/chrome/common/l10n_util_unittest.cc
+++ b/chrome/common/l10n_util_unittest.cc
@@ -99,36 +99,36 @@ void SetICUDefaultLocale(const std::wstring& locale_string) {
TEST_F(L10nUtilTest, GetAppLocale) {
// Use a temporary locale dir so we don't have to actually build the locale
// dlls for this test.
- std::wstring orig_locale_dir;
+ FilePath orig_locale_dir;
PathService::Get(chrome::DIR_LOCALES, &orig_locale_dir);
- std::wstring new_locale_dir;
- EXPECT_TRUE(file_util::CreateNewTempDirectory(L"l10n_util_test",
- &new_locale_dir));
- PathService::Override(chrome::DIR_LOCALES, new_locale_dir);
+ FilePath new_locale_dir;
+ EXPECT_TRUE(file_util::CreateNewTempDirectory(
+ FILE_PATH_LITERAL("l10n_util_test"),
+ &new_locale_dir));
+ PathService::Override(chrome::DIR_LOCALES, new_locale_dir.ToWStringHack());
// Make fake locale files.
- const wchar_t* filenames[] = {
- L"en-US",
- L"en-GB",
- L"fr",
- L"es-419",
- L"es",
- L"zh-TW",
- L"zh-CN",
- L"he",
- L"fil",
- L"nb",
- L"or",
+ std::string filenames[] = {
+ "en-US",
+ "en-GB",
+ "fr",
+ "es-419",
+ "es",
+ "zh-TW",
+ "zh-CN",
+ "he",
+ "fil",
+ "nb",
+ "or",
};
#if defined(OS_WIN)
- static const wchar_t kLocaleFileExtension[] = L".dll";
+ static const char kLocaleFileExtension[] = ".dll";
#elif defined(OS_POSIX)
- static const wchar_t kLocaleFileExtension[] = L".pak";
+ static const char kLocaleFileExtension[] = ".pak";
#endif
for (size_t i = 0; i < arraysize(filenames); ++i) {
- std::wstring filename = new_locale_dir;
- file_util::AppendToPath(&filename, filenames[i]);
- filename += kLocaleFileExtension;
+ FilePath filename = new_locale_dir.AppendASCII(
+ filenames[i] + kLocaleFileExtension);
file_util::WriteFile(filename, "", 0);
}
@@ -204,7 +204,7 @@ TEST_F(L10nUtilTest, GetAppLocale) {
#endif
// Clean up.
- PathService::Override(chrome::DIR_LOCALES, orig_locale_dir);
+ PathService::Override(chrome::DIR_LOCALES, orig_locale_dir.ToWStringHack());
file_util::Delete(new_locale_dir, true);
UErrorCode error_code = U_ZERO_ERROR;
Locale::setDefault(locale, error_code);
diff --git a/chrome/common/pref_service_uitest.cc b/chrome/common/pref_service_uitest.cc
index e5da154..6e2ab7f 100644
--- a/chrome/common/pref_service_uitest.cc
+++ b/chrome/common/pref_service_uitest.cc
@@ -5,7 +5,6 @@
#include <string>
#include "base/command_line.h"
-#include "base/file_path.h"
#include "base/file_util.h"
#include "base/values.h"
#include "build/build_config.h"
@@ -28,7 +27,7 @@ public:
file_util::CreateDirectory(tmp_profile_);
FilePath reference_pref_file =
- FilePath::FromWStringHack(test_data_directory_)
+ test_data_directory_
.AppendASCII("profiles")
.AppendASCII("window_placement")
.Append(chrome::kLocalStateFilename);
diff --git a/chrome/test/accessibility/accessibility_tests.cc b/chrome/test/accessibility/accessibility_tests.cc
index 542ba7f..107b346 100644
--- a/chrome/test/accessibility/accessibility_tests.cc
+++ b/chrome/test/accessibility/accessibility_tests.cc
@@ -4,7 +4,7 @@
#include <oleacc.h>
-#include "base/file_util.h"
+#include "base/file_path.h"
#include "base/win_util.h"
#include "chrome/app/chrome_dll_resource.h"
#include "chrome/common/l10n_util.h"
@@ -140,7 +140,7 @@ TEST_F(AccessibilityTest, DISABLED_TestBackBtnStatusOnNewTab) {
// Set URL and check button status.
scoped_ptr<TabProxy> tab1(window->GetTab(0));
ASSERT_TRUE(tab1.get());
- FilePath test_file1(FilePath::FromWStringHack(test_data_directory_));
+ FilePath test_file1(test_data_directory_);
test_file1 = test_file1.AppendASCII("title1.html");
tab1->NavigateToURL(net::FilePathToFileURL(test_file1));
Sleep(sleep_timeout_ms());
@@ -167,7 +167,7 @@ TEST_F(AccessibilityTest, DISABLED_TestBackBtnStatusOnNewTab) {
// Add new tab with URL and check status.
ASSERT_TRUE(window->GetTabCount(&tab_count));
- FilePath test_file2(FilePath::FromWStringHack(test_data_directory_));
+ FilePath test_file2(test_data_directory_);
test_file2 = test_file2.AppendASCII("title1.html");
ASSERT_TRUE(window->AppendTab(net::FilePathToFileURL(test_file2)));
ASSERT_TRUE(window->WaitForTabCountToBecome(tab_count + 1,
@@ -242,7 +242,7 @@ TEST_F(AccessibilityTest, DISABLED_TestForwardBtnStatusOnNewTab) {
// Set URL and check button status.
scoped_ptr<TabProxy> tab1(window->GetTab(0));
ASSERT_TRUE(tab1.get());
- FilePath test_file1(FilePath::FromWStringHack(test_data_directory_));
+ FilePath test_file1(test_data_directory_);
test_file1 = test_file1.AppendASCII("title1.html");
tab1->NavigateToURL(net::FilePathToFileURL(test_file1));
Sleep(sleep_timeout_ms());
@@ -275,7 +275,7 @@ TEST_F(AccessibilityTest, DISABLED_TestForwardBtnStatusOnNewTab) {
// Add new tab with URL and check status.
ASSERT_TRUE(window->GetTabCount(&tab_count));
- FilePath test_file2(FilePath::FromWStringHack(test_data_directory_));
+ FilePath test_file2(test_data_directory_);
test_file2 = test_file2.AppendASCII("title1.html");
ASSERT_TRUE(window->AppendTab(net::FilePathToFileURL(test_file2)));
ASSERT_TRUE(window->WaitForTabCountToBecome(tab_count + 1,
@@ -328,7 +328,7 @@ TEST_F(AccessibilityTest, DISABLED_TestStarBtnStatusOnNewTab) {
// Set URL and check button status.
scoped_ptr<TabProxy> tab1(window->GetTab(0));
ASSERT_TRUE(tab1.get());
- FilePath test_file1(FilePath::FromWStringHack(test_data_directory_));
+ FilePath test_file1(test_data_directory_);
test_file1 = test_file1.AppendASCII("title1.html");
tab1->NavigateToURL(net::FilePathToFileURL(test_file1));
Sleep(sleep_timeout_ms());
@@ -346,7 +346,7 @@ TEST_F(AccessibilityTest, DISABLED_TestStarBtnStatusOnNewTab) {
// Add new tab with URL and check status.
ASSERT_TRUE(window->GetTabCount(&tab_count));
- FilePath test_file2(FilePath::FromWStringHack(test_data_directory_));
+ FilePath test_file2(test_data_directory_);
test_file2 = test_file2.AppendASCII("title1.html");
ASSERT_TRUE(window->AppendTab(net::FilePathToFileURL(test_file2)));
ASSERT_TRUE(window->WaitForTabCountToBecome(tab_count + 1,
diff --git a/chrome/test/automation/automation_proxy_uitest.cc b/chrome/test/automation/automation_proxy_uitest.cc
index ba4bf51..e650c35 100644
--- a/chrome/test/automation/automation_proxy_uitest.cc
+++ b/chrome/test/automation/automation_proxy_uitest.cc
@@ -5,7 +5,7 @@
#include <string>
#include "base/command_line.h"
-#include "base/file_util.h"
+#include "base/file_path.h"
#include "base/string_util.h"
#include "build/build_config.h"
#include "chrome/app/chrome_dll_resource.h"
@@ -199,7 +199,7 @@ TEST_F(AutomationProxyVisibleTest, AppendTab) {
ASSERT_EQ(tab_count - 1, active_tab_index);
ASSERT_NE(original_active_tab_index, active_tab_index);
- FilePath filename(FilePath::FromWStringHack(test_data_directory_));
+ FilePath filename(test_data_directory_);
filename = filename.AppendASCII("title2.html");
ASSERT_TRUE(window->AppendTab(net::FilePathToFileURL(filename)));
@@ -267,7 +267,7 @@ TEST_F(AutomationProxyTest, NavigateToURL) {
// BUG [634097] : expected title should be "about:blank"
ASSERT_STREQ(L"", title.c_str());
- FilePath filename(FilePath::FromWStringHack(test_data_directory_));
+ FilePath filename(test_data_directory_);
filename = filename.AppendASCII("title2.html");
tab->NavigateToURL(net::FilePathToFileURL(filename));
@@ -284,7 +284,7 @@ TEST_F(AutomationProxyTest, DISABLED_NavigateToURLWithTimeout1) {
scoped_ptr<TabProxy> tab(window->GetTab(0));
ASSERT_TRUE(tab.get());
- FilePath filename(FilePath::FromWStringHack(test_data_directory_));
+ FilePath filename(test_data_directory_);
filename = filename.AppendASCII("title2.html");
bool is_timeout;
@@ -311,7 +311,7 @@ TEST_F(AutomationProxyTest, DISABLED_NavigateToURLWithTimeout2) {
tab.reset(window->GetTab(0));
ASSERT_TRUE(tab.get());
- FilePath filename1(FilePath::FromWStringHack(test_data_directory_));
+ FilePath filename1(test_data_directory_);
filename1 = filename1.AppendASCII("title1.html");
bool is_timeout;
@@ -319,7 +319,7 @@ TEST_F(AutomationProxyTest, DISABLED_NavigateToURLWithTimeout2) {
1, &is_timeout);
ASSERT_TRUE(is_timeout);
- FilePath filename2(FilePath::FromWStringHack(test_data_directory_));
+ FilePath filename2(test_data_directory_);
filename2 = filename2.AppendASCII("title1.html");
tab->NavigateToURLWithTimeout(net::FilePathToFileURL(filename2),
10000, &is_timeout);
@@ -343,7 +343,7 @@ TEST_F(AutomationProxyTest, GoBackForward) {
ASSERT_TRUE(tab->GetTabTitle(&title));
ASSERT_STREQ(L"", title.c_str());
- FilePath filename(FilePath::FromWStringHack(test_data_directory_));
+ FilePath filename(test_data_directory_);
filename = filename.AppendASCII("title2.html");
ASSERT_TRUE(tab->NavigateToURL(net::FilePathToFileURL(filename)));
ASSERT_TRUE(tab->GetTabTitle(&title));
@@ -372,7 +372,7 @@ TEST_F(AutomationProxyTest, GetCurrentURL) {
ASSERT_TRUE(tab->GetCurrentURL(&url));
ASSERT_STREQ("about:blank", url.spec().c_str());
- FilePath filename(FilePath::FromWStringHack(test_data_directory_));
+ FilePath filename(test_data_directory_);
filename = filename.AppendASCII("cookie1.html");
GURL newurl = net::FilePathToFileURL(filename);
ASSERT_TRUE(tab->NavigateToURL(newurl));
@@ -384,18 +384,16 @@ TEST_F(AutomationProxyTest, GetCurrentURL) {
class AutomationProxyTest2 : public AutomationProxyVisibleTest {
protected:
AutomationProxyTest2() {
- document1_ = test_data_directory_;
- file_util::AppendToPath(&document1_, L"title1.html");
+ document1_= test_data_directory_.AppendASCII("title1.html");
- document2_ = test_data_directory_;
- file_util::AppendToPath(&document2_, L"title2.html");
+ document2_ = test_data_directory_.AppendASCII("title2.html");
launch_arguments_ = CommandLine(L"");
- launch_arguments_.AppendLooseValue(document1_);
- launch_arguments_.AppendLooseValue(document2_);
+ launch_arguments_.AppendLooseValue(document1_.ToWStringHack());
+ launch_arguments_.AppendLooseValue(document2_.ToWStringHack());
}
- std::wstring document1_;
- std::wstring document2_;
+ FilePath document1_;
+ FilePath document2_;
};
TEST_F(AutomationProxyTest2, GetActiveTabIndex) {
@@ -482,7 +480,7 @@ TEST_F(AutomationProxyTest, NavigateToURLAsync) {
scoped_ptr<TabProxy> tab(window->GetTab(0));
ASSERT_TRUE(tab.get());
- FilePath filename(FilePath::FromWStringHack(test_data_directory_));
+ FilePath filename(test_data_directory_);
filename = filename.AppendASCII("cookie1.html");
GURL newurl = net::FilePathToFileURL(filename);
@@ -591,15 +589,15 @@ class AutomationProxyTest3 : public UITest {
protected:
AutomationProxyTest3() : UITest() {
document1_ = test_data_directory_;
- file_util::AppendToPath(&document1_, L"frame_dom_access");
- file_util::AppendToPath(&document1_, L"frame_dom_access.html");
+ document1_ = document1_.AppendASCII("frame_dom_access");
+ document1_ = document1_.AppendASCII("frame_dom_access.html");
dom_automation_enabled_ = true;
launch_arguments_ = CommandLine(L"");
- launch_arguments_.AppendLooseValue(document1_);
+ launch_arguments_.AppendLooseValue(document1_.ToWStringHack());
}
- std::wstring document1_;
+ FilePath document1_;
};
std::wstring CreateJSStringForDOMQuery(const std::wstring& id) {
@@ -667,7 +665,7 @@ TEST_F(AutomationProxyTest, DISABLED_ConstrainedWindowTest) {
tab.reset(window->GetTab(0));
ASSERT_TRUE(tab.get());
- FilePath filename(FilePath::FromWStringHack(test_data_directory_));
+ FilePath filename(test_data_directory_);
filename = filename.AppendASCII("constrained_files");
filename = filename.AppendASCII("constrained_window.html");
@@ -708,7 +706,7 @@ TEST_F(AutomationProxyTest, CantEscapeByOnloadMoveto) {
tab.reset(window->GetTab(0));
ASSERT_TRUE(tab.get());
- FilePath filename(FilePath::FromWStringHack(test_data_directory_));
+ FilePath filename(test_data_directory_);
filename = filename.AppendASCII("constrained_files");
filename = filename.AppendASCII("constrained_window_onload_moveto.html");
@@ -1143,7 +1141,7 @@ TEST_F(AutomationProxyTest5, TestLifetimeOfDomAutomationController) {
scoped_ptr<TabProxy> tab(window->GetTab(0));
ASSERT_TRUE(tab.get());
- FilePath filename(FilePath::FromWStringHack(test_data_directory_));
+ FilePath filename(test_data_directory_);
filename = filename.AppendASCII("dom_automation_test_with_popup.html");
tab->NavigateToURL(net::FilePathToFileURL(filename));
diff --git a/chrome/test/memory_test/memory_test.cc b/chrome/test/memory_test/memory_test.cc
index ce66ad1..ffddf51 100644
--- a/chrome/test/memory_test/memory_test.cc
+++ b/chrome/test/memory_test/memory_test.cc
@@ -404,10 +404,10 @@ class MemoryReferenceTest : public MemoryTest {
// override the browser directory that is used by UITest::SetUp to cause it
// to use the reference build instead.
void SetUp() {
- std::wstring dir;
+ FilePath dir;
PathService::Get(chrome::DIR_TEST_TOOLS, &dir);
- file_util::AppendToPath(&dir, L"reference_build");
- file_util::AppendToPath(&dir, L"chrome");
+ dir = dir.AppendASCII("reference_build");
+ dir = dir.AppendASCII("chrome");
browser_directory_ = dir;
UITest::SetUp();
}
diff --git a/chrome/test/page_cycler/page_cycler_test.cc b/chrome/test/page_cycler/page_cycler_test.cc
index a8826ee..308581a 100644
--- a/chrome/test/page_cycler/page_cycler_test.cc
+++ b/chrome/test/page_cycler/page_cycler_test.cc
@@ -4,7 +4,7 @@
#include "base/basictypes.h"
#include "base/command_line.h"
-#include "base/file_util.h"
+#include "base/file_path.h"
#include "base/path_service.h"
#include "base/process_util.h"
#include "base/string_util.h"
@@ -149,8 +149,6 @@ class PageCyclerTest : public UITest {
PrintResult("total_byte", chrome_name,
"IO_b" + chrome_name + test_name,
total, "kb", true /* important */);
-
-
}
base::CloseProcessHandle(process_handle);
@@ -171,7 +169,6 @@ class PageCyclerTest : public UITest {
size_t current_working_set_size;
if (GetMemoryInfo(*it, &peak_virtual_size, &current_virtual_size,
&peak_working_set_size, &current_working_set_size)) {
-
std::string chrome_name = (*it == browser_process_pid) ? "_b" : "_r";
std::string trace_name(test_name);
@@ -224,10 +221,10 @@ class PageCyclerReferenceTest : public PageCyclerTest {
// override the browser directory that is used by UITest::SetUp to cause it
// to use the reference build instead.
void SetUp() {
- std::wstring dir;
+ FilePath dir;
PathService::Get(chrome::DIR_TEST_TOOLS, &dir);
- file_util::AppendToPath(&dir, L"reference_build");
- file_util::AppendToPath(&dir, L"chrome");
+ dir = dir.AppendASCII("reference_build");
+ dir = dir.AppendASCII("chrome");
browser_directory_ = dir;
UITest::SetUp();
}
diff --git a/chrome/test/plugin/plugin_test.cpp b/chrome/test/plugin/plugin_test.cpp
index d8461fd..babf0bd 100644
--- a/chrome/test/plugin/plugin_test.cpp
+++ b/chrome/test/plugin/plugin_test.cpp
@@ -193,7 +193,7 @@ class ActiveXTest : public PluginTest {
RegisterTestControl(false);
}
void RegisterTestControl(bool register_server) {
- std::wstring test_control_path = browser_directory_ +
+ std::wstring test_control_path = browser_directory_.ToWStringHack() +
L"\\activex_test_control.dll";
HMODULE h = LoadLibrary(test_control_path.c_str());
ASSERT_TRUE(h != NULL) << "Failed to load activex_test_control.dll";
diff --git a/chrome/test/startup/startup_test.cc b/chrome/test/startup/startup_test.cc
index 160369d..0126a24 100644
--- a/chrome/test/startup/startup_test.cc
+++ b/chrome/test/startup/startup_test.cc
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/file_path.h"
#include "base/file_util.h"
#include "base/path_service.h"
#include "base/platform_thread.h"
@@ -93,10 +92,10 @@ class StartupReferenceTest : public StartupTest {
// override the browser directory that is used by UITest::SetUp to cause it
// to use the reference build instead.
void SetUp() {
- std::wstring dir;
+ FilePath dir;
PathService::Get(chrome::DIR_TEST_TOOLS, &dir);
- file_util::AppendToPath(&dir, L"reference_build");
- file_util::AppendToPath(&dir, L"chrome");
+ dir = dir.AppendASCII("reference_build");
+ dir = dir.AppendASCII("chrome");
browser_directory_ = dir;
}
};
@@ -106,13 +105,13 @@ class StartupFileTest : public StartupTest {
// Load a file on startup rather than about:blank. This tests a longer
// startup path, including resource loading and the loading of gears.dll.
void SetUp() {
- std::wstring file_url;
+ FilePath file_url;
ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &file_url));
- file_util::AppendToPath(&file_url, L"empty.html");
+ file_url = file_url.AppendASCII("empty.html");
ASSERT_TRUE(file_util::PathExists(file_url));
- launch_arguments_.AppendLooseValue(file_url);
+ launch_arguments_.AppendLooseValue(file_url.ToWStringHack());
- pages_ = WideToUTF8(file_url);
+ pages_ = WideToUTF8(file_url.ToWStringHack());
}
};
diff --git a/chrome/test/ui/layout_plugin_uitest.cc b/chrome/test/ui/layout_plugin_uitest.cc
index f0778ab..3f4ba9d 100644
--- a/chrome/test/ui/layout_plugin_uitest.cc
+++ b/chrome/test/ui/layout_plugin_uitest.cc
@@ -47,9 +47,9 @@ class LayoutPluginTester : public UITest {
TEST_F(LayoutPluginTester, UnloadNoCrash) {
// We need to copy our test-plugin into the plugins directory so that
// the browser can load it.
- std::wstring plugins_directory = browser_directory_;
+ std::wstring plugins_directory = browser_directory_.ToWStringHack();
plugins_directory += L"\\plugins";
- std::wstring plugin_src = browser_directory_;
+ std::wstring plugin_src = browser_directory_.ToWStringHack();
plugin_src += L"\\npapi_layout_test_plugin.dll";
std::wstring plugin_dest = plugins_directory;
plugin_dest += L"\\npapi_layout_test_plugin.dll";
diff --git a/chrome/test/ui/npapi_test_helper.cc b/chrome/test/ui/npapi_test_helper.cc
index ab891f6..11e1c98 100644
--- a/chrome/test/ui/npapi_test_helper.cc
+++ b/chrome/test/ui/npapi_test_helper.cc
@@ -19,8 +19,10 @@ NPAPITester::NPAPITester()
void NPAPITester::SetUp() {
// We need to copy our test-plugin into the plugins directory so that
// the browser can load it.
- std::wstring plugins_directory = browser_directory_ + L"\\plugins";
- std::wstring plugin_src = browser_directory_ + L"\\npapi_test_plugin.dll";
+ std::wstring plugins_directory = browser_directory_.ToWStringHack() +
+ L"\\plugins";
+ std::wstring plugin_src = browser_directory_.ToWStringHack() +
+ L"\\npapi_test_plugin.dll";
plugin_dll_ = plugins_directory + L"\\npapi_test_plugin.dll";
CreateDirectory(plugins_directory.c_str(), NULL);
diff --git a/chrome/test/ui/sunspider_uitest.cc b/chrome/test/ui/sunspider_uitest.cc
index 31bb621..6ec89d6 100644
--- a/chrome/test/ui/sunspider_uitest.cc
+++ b/chrome/test/ui/sunspider_uitest.cc
@@ -3,7 +3,6 @@
// found in the LICENSE file.
#include "base/command_line.h"
-#include "base/file_path.h"
#include "base/file_util.h"
#include "base/path_service.h"
#include "base/string_util.h"
@@ -127,7 +126,7 @@ class SunSpiderReferenceTest : public SunSpiderTest {
PathService::Get(chrome::DIR_TEST_TOOLS, &dir);
dir = dir.AppendASCII("reference_build");
dir = dir.AppendASCII("chrome");
- browser_directory_ = dir.ToWStringHack();
+ browser_directory_ = dir;
UITest::SetUp();
}
};
diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc
index 6bece9c..386f5f2 100644
--- a/chrome/test/ui/ui_test.cc
+++ b/chrome/test/ui/ui_test.cc
@@ -9,7 +9,6 @@
#include "base/base_switches.h"
#include "base/command_line.h"
-#include "base/file_path.h"
#include "base/file_util.h"
#include "base/path_service.h"
#include "base/platform_thread.h"
@@ -235,10 +234,10 @@ void UITest::CloseBrowserAndServer() {
}
void UITest::LaunchBrowser(const CommandLine& arguments, bool clear_profile) {
- std::wstring command = browser_directory_;
- file_util::AppendToPath(&command,
- chrome::kBrowserProcessExecutablePath);
- CommandLine command_line(command);
+ FilePath command = browser_directory_;
+ command = command.Append(FilePath::FromWStringHack(
+ chrome::kBrowserProcessExecutablePath));
+ CommandLine command_line(command.ToWStringHack());
// Add any explict command line flags passed to the process.
std::wstring extra_chrome_flags =
@@ -767,11 +766,11 @@ bool UITest::CloseBrowser(BrowserProxy* browser,
GURL UITest::GetTestUrl(const std::wstring& test_directory,
const std::wstring &test_case) {
- std::wstring path;
+ FilePath path;
PathService::Get(chrome::DIR_TEST_DATA, &path);
- file_util::AppendToPath(&path, test_directory);
- file_util::AppendToPath(&path, test_case);
- return net::FilePathToFileURL(FilePath::FromWStringHack(path));
+ path = path.Append(FilePath::FromWStringHack(test_directory));
+ path = path.Append(FilePath::FromWStringHack(test_case));
+ return net::FilePathToFileURL(path);
}
void UITest::WaitForFinish(const std::string &name,
diff --git a/chrome/test/ui/ui_test.h b/chrome/test/ui/ui_test.h
index ff9a87b..543f1fd 100644
--- a/chrome/test/ui/ui_test.h
+++ b/chrome/test/ui/ui_test.h
@@ -39,6 +39,7 @@
class AutomationProxy;
class BrowserProxy;
class DictionaryValue;
+class FilePath;
class GURL;
class TabProxy;
@@ -433,10 +434,8 @@ class UITest : public testing::Test {
// ********* Member variables *********
- std::wstring browser_directory_; // Path to the browser executable,
- // with no trailing slash
- std::wstring test_data_directory_; // Path to the unit test data,
- // with no trailing slash
+ FilePath browser_directory_; // Path to the browser executable.
+ FilePath test_data_directory_; // Path to the unit test data.
CommandLine launch_arguments_; // Command to launch the browser
size_t expected_errors_; // The number of errors expected during
// the run (generally 0).
diff --git a/chrome/test/ui/v8_benchmark_uitest.cc b/chrome/test/ui/v8_benchmark_uitest.cc
index 19656de..76deb22 100644
--- a/chrome/test/ui/v8_benchmark_uitest.cc
+++ b/chrome/test/ui/v8_benchmark_uitest.cc
@@ -128,7 +128,7 @@ class V8BenchmarkReferenceTest : public V8BenchmarkTest {
PathService::Get(chrome::DIR_TEST_TOOLS, &dir);
dir = dir.AppendASCII("reference_build");
dir = dir.AppendASCII("chrome");
- browser_directory_ = dir.ToWStringHack();
+ browser_directory_ = dir;
UITest::SetUp();
}
};
diff --git a/chrome/test/unit/chrome_test_suite.h b/chrome/test/unit/chrome_test_suite.h
index 527f6c4..baf21af 100644
--- a/chrome/test/unit/chrome_test_suite.h
+++ b/chrome/test/unit/chrome_test_suite.h
@@ -7,8 +7,10 @@
#include "build/build_config.h"
+#include <string>
+
#include "base/stats_table.h"
-#include "base/file_util.h"
+#include "base/file_path.h"
#if defined(OS_MACOSX)
#include "base/mac_util.h"
#endif
@@ -54,11 +56,11 @@ class WarningHostMapper : public net::HostMapper {
};
class ChromeTestSuite : public TestSuite {
-public:
+ public:
ChromeTestSuite(int argc, char** argv) : TestSuite(argc, argv) {
}
-protected:
+ protected:
virtual void Initialize() {
base::ScopedNSAutoreleasePool autorelease_pool;
@@ -75,14 +77,15 @@ protected:
// user data directory that lives alongside the current app.
// NOTE: The user data directory will be erased before each UI test that
// uses it, in order to ensure consistency.
- std::wstring user_data_dir =
+ FilePath user_data_dir = FilePath::FromWStringHack(
CommandLine::ForCurrentProcess()->GetSwitchValue(
- switches::kUserDataDir);
+ switches::kUserDataDir));
if (user_data_dir.empty() &&
PathService::Get(base::DIR_EXE, &user_data_dir))
- file_util::AppendToPath(&user_data_dir, L"test_user_data");
+ user_data_dir = user_data_dir.AppendASCII("test_user_data");
if (!user_data_dir.empty())
- PathService::Override(chrome::DIR_USER_DATA, user_data_dir);
+ PathService::Override(chrome::DIR_USER_DATA,
+ user_data_dir.ToWStringHack());
#if defined(OS_MACOSX)
FilePath path;
@@ -128,4 +131,4 @@ protected:
net::ScopedHostMapper scoped_host_mapper_;
};
-#endif // CHROME_TEST_UNIT_CHROME_TEST_SUITE_H_
+#endif // CHROME_TEST_UNIT_CHROME_TEST_SUITE_H_