diff options
author | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-06 02:29:45 +0000 |
---|---|---|
committer | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-06 02:29:45 +0000 |
commit | 3be3dc9eef11feec71b5d88c8f5a7061cbf47724 (patch) | |
tree | 6dabbd54b4ffe8457c2db95387916bcea5e8a173 /chrome/browser/history/visit_database_unittest.cc | |
parent | 4f6fddb6190a3c2ed61b686158943848dfeecf14 (diff) | |
download | chromium_src-3be3dc9eef11feec71b5d88c8f5a7061cbf47724.zip chromium_src-3be3dc9eef11feec71b5d88c8f5a7061cbf47724.tar.gz chromium_src-3be3dc9eef11feec71b5d88c8f5a7061cbf47724.tar.bz2 |
Reverting 7570.
Review URL: http://codereview.chromium.org/16528
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7574 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/history/visit_database_unittest.cc')
-rw-r--r-- | chrome/browser/history/visit_database_unittest.cc | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/chrome/browser/history/visit_database_unittest.cc b/chrome/browser/history/visit_database_unittest.cc index 1373e83..47846b6 100644 --- a/chrome/browser/history/visit_database_unittest.cc +++ b/chrome/browser/history/visit_database_unittest.cc @@ -10,7 +10,6 @@ #include "chrome/common/sqlite_compiled_statement.h" #include "chrome/common/sqlite_utils.h" #include "testing/gtest/include/gtest/gtest.h" -#include "testing/platform_test.h" using base::Time; using base::TimeDelta; @@ -31,7 +30,7 @@ bool IsVisitInfoEqual(const VisitRow& a, } // namespace -class VisitDatabaseTest : public PlatformTest, +class VisitDatabaseTest : public testing::Test, public URLDatabase, public VisitDatabase { public: @@ -41,7 +40,6 @@ class VisitDatabaseTest : public PlatformTest, private: // Test setup. void SetUp() { - PlatformTest::SetUp(); PathService::Get(base::DIR_TEMP, &db_file_); db_file_.push_back(FilePath::kSeparators[0]); db_file_.append(L"VisitTest.db"); @@ -60,7 +58,6 @@ class VisitDatabaseTest : public PlatformTest, delete statement_cache_; sqlite3_close(db_); file_util::Delete(db_file_, false); - PlatformTest::TearDown(); } // Provided for URL/VisitDatabase. @@ -96,7 +93,7 @@ TEST_F(VisitDatabaseTest, Add) { // Query the first two. std::vector<VisitRow> matches; EXPECT_TRUE(GetVisitsForURL(visit_info1.url_id, &matches)); - EXPECT_EQ(static_cast<size_t>(2), matches.size()); + EXPECT_EQ(2, matches.size()); // Make sure we got both (order in result set is visit time). EXPECT_TRUE(IsVisitInfoEqual(matches[0], visit_info1) && @@ -125,7 +122,7 @@ TEST_F(VisitDatabaseTest, Delete) { // First make sure all the visits are there. std::vector<VisitRow> matches; EXPECT_TRUE(GetVisitsForURL(visit_info1.url_id, &matches)); - EXPECT_EQ(static_cast<size_t>(3), matches.size()); + EXPECT_EQ(3, matches.size()); EXPECT_TRUE(IsVisitInfoEqual(matches[0], visit_info1) && IsVisitInfoEqual(matches[1], visit_info2) && IsVisitInfoEqual(matches[2], visit_info3)); @@ -138,7 +135,7 @@ TEST_F(VisitDatabaseTest, Delete) { visit_info3.referring_visit = visit_info1.visit_id; matches.clear(); EXPECT_TRUE(GetVisitsForURL(visit_info1.url_id, &matches)); - EXPECT_EQ(static_cast<size_t>(2), matches.size()); + EXPECT_EQ(2, matches.size()); EXPECT_TRUE(IsVisitInfoEqual(matches[0], visit_info1) && IsVisitInfoEqual(matches[1], visit_info3)); } @@ -165,8 +162,6 @@ TEST_F(VisitDatabaseTest, Update) { // TODO(brettw) write test for GetMostRecentVisitForURL! -#if defined(OS_WIN) -// TODO(playmobil): Enable on POSIX TEST_F(VisitDatabaseTest, GetVisibleVisitsInRange) { // Add one visit. VisitRow visit_info1(1, Time::Now(), 0, @@ -219,7 +214,7 @@ TEST_F(VisitDatabaseTest, GetVisibleVisitsInRange) { // order, but not the redirect & subframe ones later. VisitVector results; GetVisibleVisitsInRange(Time(), Time(), false, 0, &results); - ASSERT_EQ(static_cast<size_t>(3), results.size()); + ASSERT_EQ(3, results.size()); EXPECT_TRUE(IsVisitInfoEqual(results[0], visit_info4) && IsVisitInfoEqual(results[1], visit_info2) && IsVisitInfoEqual(results[2], visit_info1)); @@ -227,7 +222,7 @@ TEST_F(VisitDatabaseTest, GetVisibleVisitsInRange) { // If we want only the most recent one, it should give us the same results // minus the first (duplicate of the second) one. GetVisibleVisitsInRange(Time(), Time(), true, 0, &results); - ASSERT_EQ(static_cast<size_t>(2), results.size()); + ASSERT_EQ(2, results.size()); EXPECT_TRUE(IsVisitInfoEqual(results[0], visit_info4) && IsVisitInfoEqual(results[1], visit_info2)); @@ -235,14 +230,14 @@ TEST_F(VisitDatabaseTest, GetVisibleVisitsInRange) { // exclusive. GetVisibleVisitsInRange(visit_info2.visit_time, visit_info4.visit_time, false, 0, &results); - ASSERT_EQ(static_cast<size_t>(1), results.size()); + ASSERT_EQ(1, results.size()); EXPECT_TRUE(IsVisitInfoEqual(results[0], visit_info2)); // Query for a max count and make sure we get only that number. GetVisibleVisitsInRange(Time(), Time(), false, 2, &results); - ASSERT_EQ(static_cast<size_t>(2), results.size()); + ASSERT_EQ(2, results.size()); EXPECT_TRUE(IsVisitInfoEqual(results[0], visit_info4) && IsVisitInfoEqual(results[1], visit_info2)); } -#endif // defined(OS_WIN) + } // namespace history |