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

Side by Side Diff: chrome/browser/bookmarks/bookmark_test_helpers.h

Issue 257003004: Remove dependency on bookmark_model_factory from bookmark_test_helpers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@364433
Patch Set: Fix unit tests on Linux & Windows 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 unified diff | Download patch
OLDNEW
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 class BookmarkModel; 10 class BookmarkModel;
11 class BookmarkNode; 11 class BookmarkNode;
12 class Profile;
13 12
14 namespace test { 13 namespace test {
15 14
16 // Blocks until |model| finishes loading. 15 // Blocks until |model| finishes loading.
17 void WaitForBookmarkModelToLoad(BookmarkModel* model); 16 void WaitForBookmarkModelToLoad(BookmarkModel* model);
18 void WaitForBookmarkModelToLoad(Profile* profile);
19 17
20 // Return the descendants of |node| as a string useful for verifying node 18 // Return the descendants of |node| as a string useful for verifying node
21 // modifications. The format of the resulting string is: 19 // modifications. The format of the resulting string is:
22 // 20 //
23 // result = node " " , { node " " } 21 // result = node " " , { node " " }
24 // node = bookmark title | folder 22 // node = bookmark title | folder
25 // folder = folder title ":[ " { node " " } "]" 23 // folder = folder title ":[ " { node " " } "]"
26 // bookmark title = (* string with no spaces *) 24 // bookmark title = (* string with no spaces *)
27 // folder title = (* string with no spaces *) 25 // folder title = (* string with no spaces *)
28 // 26 //
29 // Example: "a f1:[ b d c ] d f2:[ e f g ] h " 27 // Example: "a f1:[ b d c ] d f2:[ e f g ] h "
30 // 28 //
31 // (Logically, we should use |string16|s, but it's more convenient for test 29 // (Logically, we should use |string16|s, but it's more convenient for test
32 // purposes to use (UTF-8) |std::string|s.) 30 // purposes to use (UTF-8) |std::string|s.)
33 std::string ModelStringFromNode(const BookmarkNode* node); 31 std::string ModelStringFromNode(const BookmarkNode* node);
34 32
35 // Create and add the node hierarchy specified by |model_string| to the 33 // Create and add the node hierarchy specified by |model_string| to the
36 // bookmark node given by |node|. The string has the same format as 34 // bookmark node given by |node|. The string has the same format as
37 // specified for ModelStringFromNode(). The new nodes added to |node| 35 // specified for ModelStringFromNode(). The new nodes added to |node|
38 // are appended to the end of node's existing subnodes, if any. 36 // are appended to the end of node's existing subnodes, if any.
39 // |model| must be the model of which |node| is a member. 37 // |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 38 // NOTE: The string format is very rigid and easily broken if not followed
41 // exactly (since we're using a very simple parser). 39 // exactly (since we're using a very simple parser).
42 void AddNodesFromModelString(BookmarkModel* model, 40 void AddNodesFromModelString(BookmarkModel* model,
43 const BookmarkNode* node, 41 const BookmarkNode* node,
44 const std::string& model_string); 42 const std::string& model_string);
45 } // namespace test 43 } // namespace test
46 44
47 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_TEST_HELPERS_H_ 45 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_TEST_HELPERS_H_
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/history_quick_provider_unittest.cc ('k') | chrome/browser/bookmarks/bookmark_test_helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698