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

Unified Diff: components/history/core/test/history_client_fake_bookmarks.h

Issue 285233012: Abstract history dependencies on bookmarks through HistoryClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix android unit tests Created 6 years, 7 months 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 side-by-side diff with in-line comments
Download patch
Index: components/history/core/test/history_client_fake_bookmarks.h
diff --git a/components/history/core/test/history_client_fake_bookmarks.h b/components/history/core/test/history_client_fake_bookmarks.h
new file mode 100644
index 0000000000000000000000000000000000000000..71db9fe2f28c67e967addfc2e28e66d85bf944d0
--- /dev/null
+++ b/components/history/core/test/history_client_fake_bookmarks.h
@@ -0,0 +1,38 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_HISTORY_CORE_TEST_HISTORY_CLIENT_FAKE_BOOKMARKS_H_
+#define COMPONENTS_HISTORY_CORE_TEST_HISTORY_CLIENT_FAKE_BOOKMARKS_H_
+
+#include <map>
+
+#include "components/history/core/browser/history_client.h"
+
+namespace history {
+
+// The class HistoryClientFakeBookmarks implements HistoryClient faking the
+// methods relating to bookmarks for unit testing.
+class HistoryClientFakeBookmarks : public HistoryClient {
+ public:
+ HistoryClientFakeBookmarks();
+ virtual ~HistoryClientFakeBookmarks();
+
+ void ClearAllBookmarks();
+ void AddBookmark(const GURL& url);
+ void AddBookmarkWithTitle(const GURL& url, const base::string16& title);
+ void DelBookmark(const GURL& url);
+
+ // HistoryClient:
+ virtual bool IsBookmarked(const GURL& url) OVERRIDE;
+ virtual void GetBookmarks(std::vector<URLAndTitle>* bookmarks) OVERRIDE;
+
+ private:
+ std::map<GURL, base::string16> bookmarks_;
+
+ DISALLOW_COPY_AND_ASSIGN(HistoryClientFakeBookmarks);
+};
+
+} // namespace history
+
+#endif // COMPONENTS_HISTORY_CORE_TEST_HISTORY_CLIENT_FAKE_BOOKMARKS_H_
« no previous file with comments | « components/history/core/browser/history_client.cc ('k') | components/history/core/test/history_client_fake_bookmarks.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698