diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-18 20:50:46 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-18 20:50:46 +0000 |
commit | 0a8f88c90840e5f642e6bc64e150229d336eca72 (patch) | |
tree | 646c7fd7c7ccd20c8902c9b8058b5f675418c098 /chrome/browser/history/thumbnail_database_unittest.cc | |
parent | 420949ff13d309c7bbc56173bca33ee4ffafd1b3 (diff) | |
download | chromium_src-0a8f88c90840e5f642e6bc64e150229d336eca72.zip chromium_src-0a8f88c90840e5f642e6bc64e150229d336eca72.tar.gz chromium_src-0a8f88c90840e5f642e6bc64e150229d336eca72.tar.bz2 |
Ports all of the chrome/browser/history code to use FilePath, except
for DownloadDatabase, InMemoryDatabase, and RedirectUiTest. Except for in those
files, we now only use std::wstring for text strings.
This CL also enables two more unittests on Mac.
patch by Rohit Rao.
http://codereview.chromium.org/48018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12009 0039d316-1c4b-4281-b951-d872f2087c98
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); |