| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "app/gfx/codec/jpeg_codec.h" | 5 #include "app/gfx/codec/jpeg_codec.h" |
| 6 #include "base/file_path.h" | 6 #include "base/file_path.h" |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_model.h" | 10 #include "chrome/browser/bookmarks/bookmark_model.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 friend class HistoryBackendTestDelegate; | 114 friend class HistoryBackendTestDelegate; |
| 115 | 115 |
| 116 // testing::Test | 116 // testing::Test |
| 117 virtual void SetUp() { | 117 virtual void SetUp() { |
| 118 if (!file_util::CreateNewTempDirectory(FILE_PATH_LITERAL("BackendTest"), | 118 if (!file_util::CreateNewTempDirectory(FILE_PATH_LITERAL("BackendTest"), |
| 119 &test_dir_)) | 119 &test_dir_)) |
| 120 return; | 120 return; |
| 121 backend_ = new HistoryBackend(test_dir_, | 121 backend_ = new HistoryBackend(test_dir_, |
| 122 new HistoryBackendTestDelegate(this), | 122 new HistoryBackendTestDelegate(this), |
| 123 &bookmark_model_); | 123 &bookmark_model_); |
| 124 backend_->Init(); | 124 backend_->Init(false); |
| 125 } | 125 } |
| 126 virtual void TearDown() { | 126 virtual void TearDown() { |
| 127 backend_->Closing(); | 127 backend_->Closing(); |
| 128 backend_ = NULL; | 128 backend_ = NULL; |
| 129 mem_backend_.reset(); | 129 mem_backend_.reset(); |
| 130 file_util::Delete(test_dir_, true); | 130 file_util::Delete(test_dir_, true); |
| 131 } | 131 } |
| 132 | 132 |
| 133 void SetInMemoryBackend(InMemoryHistoryBackend* backend) { | 133 void SetInMemoryBackend(InMemoryHistoryBackend* backend) { |
| 134 mem_backend_.reset(backend); | 134 mem_backend_.reset(backend); |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 | 555 |
| 556 // If the URL is bookmarked, it should get added to history with 0 visits. | 556 // If the URL is bookmarked, it should get added to history with 0 visits. |
| 557 bookmark_model_.AddURL(bookmark_model_.GetBookmarkBarNode(), 0, | 557 bookmark_model_.AddURL(bookmark_model_.GetBookmarkBarNode(), 0, |
| 558 std::wstring(), url3); | 558 std::wstring(), url3); |
| 559 backend_->SetImportedFavicons(favicons); | 559 backend_->SetImportedFavicons(favicons); |
| 560 EXPECT_FALSE(backend_->db_->GetRowForURL(url3, &url_row3) == 0); | 560 EXPECT_FALSE(backend_->db_->GetRowForURL(url3, &url_row3) == 0); |
| 561 EXPECT_TRUE(url_row3.visit_count() == 0); | 561 EXPECT_TRUE(url_row3.visit_count() == 0); |
| 562 } | 562 } |
| 563 | 563 |
| 564 } // namespace history | 564 } // namespace history |
| OLD | NEW |