OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_TEST_HELPERS_H_ | 5 #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_TEST_HELPERS_H_ |
6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_TEST_HELPERS_H_ | 6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_TEST_HELPERS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "components/bookmarks/core/browser/bookmark_client.h" | |
11 | |
10 class BookmarkModel; | 12 class BookmarkModel; |
11 class BookmarkNode; | 13 class BookmarkNode; |
12 class Profile; | 14 class Profile; |
13 | 15 |
14 namespace test { | 16 namespace test { |
15 | 17 |
18 class TestBookmarkClient : public BookmarkClient { | |
tfarina
2014/04/22 21:19:58
Also, no. Leave this file for helper utility test
sdefresne
2014/04/23 16:10:18
Done.
| |
19 public: | |
20 // Create a BookmarkClient using the this object as its client. | |
21 BookmarkModel* CreateModel(); | |
22 | |
23 virtual base::CancelableTaskTracker::TaskId GetFaviconImageForURL( | |
tfarina
2014/04/22 21:19:58
Group the overrides, can you also override everyth
sdefresne
2014/04/23 16:10:18
Done.
| |
24 const GURL& page_url, | |
25 int icon_types, | |
26 int desired_size_in_dip, | |
27 const FaviconImageCallback& callback, | |
28 base::CancelableTaskTracker* tracker) OVERRIDE; | |
29 | |
30 virtual bool SupportsTypedCountForNodes() OVERRIDE; | |
31 | |
32 virtual void GetTypedCountForNodes( | |
33 const NodeSet& nodes, | |
34 NodeTypedCountPairs* node_typed_count_pairs) OVERRIDE; | |
35 | |
36 virtual void RecordAction(const base::UserMetricsAction& action) OVERRIDE; | |
37 | |
38 private: | |
39 virtual void OnLoad() OVERRIDE; | |
40 | |
41 virtual void OnClearStore() OVERRIDE; | |
42 | |
43 virtual void NotifyHistoryAboutRemovedBookmarks( | |
44 const std::set<GURL>& removed_bookmark_urls) OVERRIDE; | |
45 }; | |
tfarina
2014/04/22 21:19:58
DISALLOW_COPY_AND_ASSIGN
sdefresne
2014/04/23 16:10:18
Done.
| |
46 | |
16 // Blocks until |model| finishes loading. | 47 // Blocks until |model| finishes loading. |
17 void WaitForBookmarkModelToLoad(BookmarkModel* model); | 48 void WaitForBookmarkModelToLoad(BookmarkModel* model); |
18 void WaitForBookmarkModelToLoad(Profile* profile); | 49 void WaitForBookmarkModelToLoad(Profile* profile); |
19 | 50 |
20 // Return the descendants of |node| as a string useful for verifying node | 51 // Return the descendants of |node| as a string useful for verifying node |
21 // modifications. The format of the resulting string is: | 52 // modifications. The format of the resulting string is: |
22 // | 53 // |
23 // result = node " " , { node " " } | 54 // result = node " " , { node " " } |
24 // node = bookmark title | folder | 55 // node = bookmark title | folder |
25 // folder = folder title ":[ " { node " " } "]" | 56 // folder = folder title ":[ " { node " " } "]" |
(...skipping 12 matching lines...) Expand all Loading... | |
38 // are appended to the end of node's existing subnodes, if any. | 69 // are appended to the end of node's existing subnodes, if any. |
39 // |model| must be the model of which |node| is a member. | 70 // |model| must be the model of which |node| is a member. |
40 // NOTE: The string format is very rigid and easily broken if not followed | 71 // NOTE: The string format is very rigid and easily broken if not followed |
41 // exactly (since we're using a very simple parser). | 72 // exactly (since we're using a very simple parser). |
42 void AddNodesFromModelString(BookmarkModel* model, | 73 void AddNodesFromModelString(BookmarkModel* model, |
43 const BookmarkNode* node, | 74 const BookmarkNode* node, |
44 const std::string& model_string); | 75 const std::string& model_string); |
45 } // namespace test | 76 } // namespace test |
46 | 77 |
47 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_TEST_HELPERS_H_ | 78 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_TEST_HELPERS_H_ |
OLD | NEW |