summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sessions/session_backend_unittest.cc
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-09 17:01:37 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-09 17:01:37 +0000
commit489d73e7fca72f29bd6620e268609133aa217795 (patch)
treea3ea497ed6b15be2d9742821dd4a2f36a0d885ce /chrome/browser/sessions/session_backend_unittest.cc
parent60c413c96834553e182e8c9c34d1e8958f3b0fb5 (diff)
downloadchromium_src-489d73e7fca72f29bd6620e268609133aa217795.zip
chromium_src-489d73e7fca72f29bd6620e268609133aa217795.tar.gz
chromium_src-489d73e7fca72f29bd6620e268609133aa217795.tar.bz2
Run more unit tests on Linux:
- used string16 instead of wstring where needed - replaced GetTickCount calls with portable functions from base/time.h - misc GCC cleanups - enabled following unit tests on Linux: browser/autocomplete/history_contents_provider_unittest.cc browser/autocomplete/history_url_provider_unittest.cc browser/autocomplete/keyword_provider_unittest.cc browser/bookmarks/bookmark_html_writer_unittest.cc Review URL: http://codereview.chromium.org/39335 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11249 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sessions/session_backend_unittest.cc')
-rw-r--r--chrome/browser/sessions/session_backend_unittest.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/chrome/browser/sessions/session_backend_unittest.cc b/chrome/browser/sessions/session_backend_unittest.cc
index f26ab45..fb424f2 100644
--- a/chrome/browser/sessions/session_backend_unittest.cc
+++ b/chrome/browser/sessions/session_backend_unittest.cc
@@ -35,12 +35,12 @@ SessionCommand* CreateCommandFromData(const TestData& data) {
class SessionBackendTest : public testing::Test {
protected:
virtual void SetUp() {
- std::wstring b = IntToWString(static_cast<int>(GetTickCount()));
+ std::string b = Int64ToString(base::Time::Now().ToInternalValue());
PathService::Get(base::DIR_TEMP, &path_);
path_ = path_.Append(FILE_PATH_LITERAL("SessionTestDirs"));
file_util::CreateDirectory(path_);
- path_ = path_.Append(b);
+ path_ = path_.AppendASCII(b);
}
virtual void TearDown() {
@@ -72,7 +72,7 @@ TEST_F(SessionBackendTest, SimpleReadWrite) {
backend = new SessionBackend(BaseSessionService::SESSION_RESTORE, path_);
backend->ReadLastSessionCommandsImpl(&commands);
- ASSERT_EQ(1, commands.size());
+ ASSERT_EQ(1U, commands.size());
AssertCommandEqualsData(data, commands[0]);
STLDeleteElements(&commands);
@@ -81,12 +81,12 @@ TEST_F(SessionBackendTest, SimpleReadWrite) {
backend = new SessionBackend(BaseSessionService::SESSION_RESTORE, path_);
backend->ReadLastSessionCommandsImpl(&commands);
- ASSERT_EQ(0, commands.size());
+ ASSERT_EQ(0U, commands.size());
// Make sure we can delete.
backend->DeleteLastSession();
backend->ReadLastSessionCommandsImpl(&commands);
- ASSERT_EQ(0, commands.size());
+ ASSERT_EQ(0U, commands.size());
}
TEST_F(SessionBackendTest, RandomData) {
@@ -106,7 +106,7 @@ TEST_F(SessionBackendTest, RandomData) {
{ 13, "abcdefghijklm" },
};
- for (int i = 0; i < arraysize(data); ++i) {
+ for (size_t i = 0; i < arraysize(data); ++i) {
scoped_refptr<SessionBackend> backend(
new SessionBackend(BaseSessionService::SESSION_RESTORE, path_));
std::vector<SessionCommand*> commands;
@@ -151,7 +151,7 @@ TEST_F(SessionBackendTest, BigData) {
backend = new SessionBackend(BaseSessionService::SESSION_RESTORE, path_);
commands.clear();
backend->ReadLastSessionCommandsImpl(&commands);
- ASSERT_EQ(3, commands.size());
+ ASSERT_EQ(3U, commands.size());
AssertCommandEqualsData(data[0], commands[0]);
AssertCommandEqualsData(data[1], commands[2]);
@@ -176,7 +176,7 @@ TEST_F(SessionBackendTest, EmptyCommand) {
std::vector<SessionCommand*> commands;
backend->ReadLastSessionCommandsImpl(&commands);
- ASSERT_EQ(1, commands.size());
+ ASSERT_EQ(1U, commands.size());
AssertCommandEqualsData(empty_command, commands[0]);
STLDeleteElements(&commands);
}