diff options
Diffstat (limited to 'chrome/browser/history/thumbnail_database_unittest.cc')
-rw-r--r-- | chrome/browser/history/thumbnail_database_unittest.cc | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/chrome/browser/history/thumbnail_database_unittest.cc b/chrome/browser/history/thumbnail_database_unittest.cc index 9890aa1..620bd08 100644 --- a/chrome/browser/history/thumbnail_database_unittest.cc +++ b/chrome/browser/history/thumbnail_database_unittest.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "base/basictypes.h" +#include "base/file_path.h" #include "base/file_util.h" #include "base/gfx/jpeg_codec.h" #include "base/path_service.h" @@ -21,6 +22,22 @@ namespace history { namespace { +// data we'll put into the thumbnail database +static const unsigned char blob1[] = + "12346102356120394751634516591348710478123649165419234519234512349134"; +static const unsigned char blob2[] = + "goiwuegrqrcomizqyzkjalitbahxfjytrqvpqeroicxmnlkhlzunacxaneviawrtxcywhgef"; +static const unsigned char blob3[] = + "3716871354098370776510470746794707624107647054607467847164027"; +const double kBoringness = 0.25; +const double kWorseBoringness = 0.50; +const double kBetterBoringness = 0.10; +const double kTotallyBoring = 1.0; + +const int64 kPage1 = 1234; + +} // namespace + class ThumbnailDatabaseTest : public testing::Test { public: ThumbnailDatabaseTest() { @@ -32,8 +49,9 @@ class ThumbnailDatabaseTest : public testing::Test { // testing::Test virtual void SetUp() { // get an empty file for the test DB - PathService::Get(chrome::DIR_TEST_DATA, &file_name_); - file_util::AppendToPath(&file_name_, L"TestThumbnails.db"); + FilePath test_data_dir; + PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir); + file_name_ = test_data_dir.AppendASCII("TestThumbnails.db"); file_util::Delete(file_name_, false); google_bitmap_.reset( @@ -46,26 +64,9 @@ class ThumbnailDatabaseTest : public testing::Test { scoped_ptr<SkBitmap> google_bitmap_; - std::wstring file_name_; + FilePath file_name_; }; -// data we'll put into the thumbnail database -static const unsigned char blob1[] = - "12346102356120394751634516591348710478123649165419234519234512349134"; -static const unsigned char blob2[] = - "goiwuegrqrcomizqyzkjalitbahxfjytrqvpqeroicxmnlkhlzunacxaneviawrtxcywhgef"; -static const unsigned char blob3[] = - "3716871354098370776510470746794707624107647054607467847164027"; -const double kBoringness = 0.25; -const double kWorseBoringness = 0.50; -const double kBetterBoringness = 0.10; -const double kTotallyBoring = 1.0; - -const int64 kPage1 = 1234; - -} // namespace - - TEST_F(ThumbnailDatabaseTest, AddDelete) { ThumbnailDatabase db; ASSERT_TRUE(db.Init(file_name_, NULL) == INIT_OK); |