diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-14 01:33:02 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-14 01:33:02 +0000 |
commit | 5a82010ab774e803a0a69328fdf56a37dee91e86 (patch) | |
tree | d408294cb73ec4577395b301b91fbd71f32a3e1d /chrome/browser/sessions/session_backend_unittest.cc | |
parent | 1871ae373abc3a867280d61b7b069aed5bc3b0fe (diff) | |
download | chromium_src-5a82010ab774e803a0a69328fdf56a37dee91e86.zip chromium_src-5a82010ab774e803a0a69328fdf56a37dee91e86.tar.gz chromium_src-5a82010ab774e803a0a69328fdf56a37dee91e86.tar.bz2 |
Port session_backend.cc to Posix.
* Using FilePath for paths instead of wstring.
* File operations using cross-platform FileStream instead of win32 API.
Review URL: http://codereview.chromium.org/20327
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9811 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sessions/session_backend_unittest.cc')
-rw-r--r-- | chrome/browser/sessions/session_backend_unittest.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/chrome/browser/sessions/session_backend_unittest.cc b/chrome/browser/sessions/session_backend_unittest.cc index b7bfd92..5400c17 100644 --- a/chrome/browser/sessions/session_backend_unittest.cc +++ b/chrome/browser/sessions/session_backend_unittest.cc @@ -2,7 +2,9 @@ // 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/string_util.h" #include "base/path_service.h" #include "base/time.h" #include "chrome/browser/sessions/session_backend.h" @@ -33,13 +35,12 @@ SessionCommand* CreateCommandFromData(const TestData& data) { class SessionBackendTest : public testing::Test { protected: virtual void SetUp() { - wchar_t b[32]; - _itow_s(static_cast<int>(GetTickCount()), b, arraysize(b), 10); + std::wstring b = IntToWString(static_cast<int>(GetTickCount())); PathService::Get(base::DIR_TEMP, &path_); - file_util::AppendToPath(&path_, L"SessionTestDirs"); + path_ = path_.Append(FILE_PATH_LITERAL("SessionTestDirs")); file_util::CreateDirectory(path_); - file_util::AppendToPath(&path_, b); + path_ = path_.Append(b); } virtual void TearDown() { @@ -54,7 +55,7 @@ class SessionBackendTest : public testing::Test { } // Path used in testing. - std::wstring path_; + FilePath path_; }; TEST_F(SessionBackendTest, SimpleReadWrite) { |