summaryrefslogtreecommitdiffstats
path: root/chrome/browser
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/browser
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/browser')
-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
12 files changed, 37 insertions, 44 deletions
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)));