From 7ff3f63b8c66408a382adc88458a6e70038cad8d Mon Sep 17 00:00:00 2001 From: "evan@chromium.org" Date: Tue, 13 Oct 2009 18:43:35 +0000 Subject: Remove the unnecessary conversion to wstring when calling file_util::WriteFile. Also use FilePath in npapi_test_helper. BUG=24672 TEST=compiled Review URL: http://codereview.chromium.org/266061 Patch from Thiago Farina . git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28856 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/test/ui/npapi_test_helper.cc | 16 ++++++++-------- chrome/test/ui/npapi_test_helper.h | 18 +++++++++--------- 2 files changed, 17 insertions(+), 17 deletions(-) (limited to 'chrome/test') diff --git a/chrome/test/ui/npapi_test_helper.cc b/chrome/test/ui/npapi_test_helper.cc index 11e1c98..e3913b0 100644 --- a/chrome/test/ui/npapi_test_helper.cc +++ b/chrome/test/ui/npapi_test_helper.cc @@ -10,6 +10,7 @@ #include "chrome/test/ui/npapi_test_helper.h" +#include "base/file_util.h" #include "chrome/common/chrome_switches.h" NPAPITester::NPAPITester() @@ -19,20 +20,19 @@ 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_.ToWStringHack() + - L"\\plugins"; - std::wstring plugin_src = browser_directory_.ToWStringHack() + - L"\\npapi_test_plugin.dll"; - plugin_dll_ = plugins_directory + L"\\npapi_test_plugin.dll"; + FilePath plugins_directory = browser_directory_.AppendASCII("plugins"); - CreateDirectory(plugins_directory.c_str(), NULL); - CopyFile(plugin_src.c_str(), plugin_dll_.c_str(), FALSE); + FilePath plugin_src = browser_directory_.AppendASCII("npapi_test_plugin.dll"); + plugin_dll_ = plugins_directory.AppendASCII("npapi_test_plugin.dll"); + + file_util::CreateDirectory(plugins_directory); + file_util::CopyFile(plugin_src, plugin_dll_); UITest::SetUp(); } void NPAPITester::TearDown() { - DeleteFile(plugin_dll_.c_str()); + file_util::Delete(plugin_dll_, false); UITest::TearDown(); } diff --git a/chrome/test/ui/npapi_test_helper.h b/chrome/test/ui/npapi_test_helper.h index 6af2d73..b914916 100644 --- a/chrome/test/ui/npapi_test_helper.h +++ b/chrome/test/ui/npapi_test_helper.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_TEST_HELPER_H_ -#define CHROME_TEST_HELPER_H_ +#ifndef CHROME_TEST_UI_NPAPI_TEST_HELPER_H_ +#define CHROME_TEST_UI_NPAPI_TEST_HELPER_H_ #include "chrome/test/ui/ui_test.h" @@ -14,21 +14,21 @@ class NPAPITester : public UITest { virtual void SetUp(); virtual void TearDown(); -private: - std::wstring plugin_dll_; + private: + FilePath plugin_dll_; }; // Helper class for NPAPI plugin UI tests, which need the browser window // to be visible. class NPAPIVisiblePluginTester : public NPAPITester { - protected: - virtual void SetUp(); + protected: + virtual void SetUp(); }; // Helper class for NPAPI plugin UI tests which use incognito mode. class NPAPIIncognitoTester : public NPAPITester { - protected: - virtual void SetUp(); + protected: + virtual void SetUp(); }; -#endif // CHROME_TEST_HELPER_H_ +#endif // CHROME_TEST_UI_NPAPI_TEST_HELPER_H_ -- cgit v1.1