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

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

Issue 342048: Show a warning when the history files can't be read correctly.... (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
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 14 matching lines...) Expand all
25 // harder than calling it directly for many things. 25 // harder than calling it directly for many things.
26 26
27 namespace history { 27 namespace history {
28 28
29 class HistoryBackendTest; 29 class HistoryBackendTest;
30 30
31 // This must be a separate object since HistoryBackend manages its lifetime. 31 // This must be a separate object since HistoryBackend manages its lifetime.
32 // This just forwards the messages we're interested in to the test object. 32 // This just forwards the messages we're interested in to the test object.
33 class HistoryBackendTestDelegate : public HistoryBackend::Delegate { 33 class HistoryBackendTestDelegate : public HistoryBackend::Delegate {
34 public: 34 public:
35 explicit HistoryBackendTestDelegate(HistoryBackendTest* test) : test_(test) { 35 explicit HistoryBackendTestDelegate(HistoryBackendTest* test) : test_(test) {}
36 }
37 36
38 virtual void NotifyTooNew() { 37 virtual void NotifyProfileError(int message_id) {}
39 }
40 virtual void SetInMemoryBackend(InMemoryHistoryBackend* backend); 38 virtual void SetInMemoryBackend(InMemoryHistoryBackend* backend);
41 virtual void BroadcastNotifications(NotificationType type, 39 virtual void BroadcastNotifications(NotificationType type,
42 HistoryDetails* details); 40 HistoryDetails* details);
43 virtual void DBLoaded(); 41 virtual void DBLoaded();
44 42
45 private: 43 private:
46 // Not owned by us. 44 // Not owned by us.
47 HistoryBackendTest* test_; 45 HistoryBackendTest* test_;
48 46
49 DISALLOW_EVIL_CONSTRUCTORS(HistoryBackendTestDelegate); 47 DISALLOW_EVIL_CONSTRUCTORS(HistoryBackendTestDelegate);
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 555
558 // 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.
559 bookmark_model_.AddURL(bookmark_model_.GetBookmarkBarNode(), 0, 557 bookmark_model_.AddURL(bookmark_model_.GetBookmarkBarNode(), 0,
560 std::wstring(), url3); 558 std::wstring(), url3);
561 backend_->SetImportedFavicons(favicons); 559 backend_->SetImportedFavicons(favicons);
562 EXPECT_FALSE(backend_->db_->GetRowForURL(url3, &url_row3) == 0); 560 EXPECT_FALSE(backend_->db_->GetRowForURL(url3, &url_row3) == 0);
563 EXPECT_TRUE(url_row3.visit_count() == 0); 561 EXPECT_TRUE(url_row3.visit_count() == 0);
564 } 562 }
565 563
566 } // namespace history 564 } // namespace history
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698