Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Side by Side Diff: chrome/browser/history/history_backend_unittest.cc

Issue 343067: Unittest for fix to allow navigation when there is no history DB.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/history/history_backend.cc ('k') | chrome/browser/history/history_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/history/history_backend.cc ('k') | chrome/browser/history/history_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698