1 // Copyright 2014 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef COMPONENTS_HISTORY_CORE_TEST_HISTORY_CLIENT_FAKE_BOOKMARKS_H_ 6 #define COMPONENTS_HISTORY_CORE_TEST_HISTORY_CLIENT_FAKE_BOOKMARKS_H_ 7 8 #include <map> 9 10 #include "components/history/core/browser/history_client.h" 11 12 namespace history { 13 14 // The class HistoryClientFakeBookmarks implements HistoryClient faking the 15 // methods relating to bookmarks for unit testing. 16 class HistoryClientFakeBookmarks : public HistoryClient { 17 public: 18 HistoryClientFakeBookmarks(); 19 virtual ~HistoryClientFakeBookmarks(); 20 21 void ClearAllBookmarks(); 22 void AddBookmark(const GURL& url); 23 void AddBookmarkWithTitle(const GURL& url, const base::string16& title); 24 void DelBookmark(const GURL& url); 25 26 // HistoryClient: 27 virtual bool IsBookmarked(const GURL& url) OVERRIDE; 28 virtual void GetBookmarks(std::vector<URLAndTitle>* bookmarks) OVERRIDE; 29 30 private: 31 std::map<GURL, base::string16> bookmarks_; 32 33 DISALLOW_COPY_AND_ASSIGN(HistoryClientFakeBookmarks); 34 }; 35 36 } // namespace history 37 38 #endif // COMPONENTS_HISTORY_CORE_TEST_HISTORY_CLIENT_FAKE_BOOKMARKS_H_ 39