diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-02 00:56:57 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-02 00:56:57 +0000 |
commit | 4b68e0d50c4a69b91a384b698a96f6a51ca7241f (patch) | |
tree | a11dc1b6baf8d2e1d1c3d8b7930fb9ca0cec46eb /chrome/test/ui | |
parent | 82d10b14f9b4150ce1e154629dec9dcddadcf272 (diff) | |
download | chromium_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/test/ui')
-rw-r--r-- | chrome/test/ui/layout_plugin_uitest.cc | 4 | ||||
-rw-r--r-- | chrome/test/ui/npapi_test_helper.cc | 6 | ||||
-rw-r--r-- | chrome/test/ui/sunspider_uitest.cc | 3 | ||||
-rw-r--r-- | chrome/test/ui/ui_test.cc | 17 | ||||
-rw-r--r-- | chrome/test/ui/ui_test.h | 7 | ||||
-rw-r--r-- | chrome/test/ui/v8_benchmark_uitest.cc | 2 |
6 files changed, 19 insertions, 20 deletions
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(); } }; |