diff options
author | munjal@chromium.org <munjal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-30 23:09:01 +0000 |
---|---|---|
committer | munjal@chromium.org <munjal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-30 23:09:01 +0000 |
commit | 814a2d33e8655daf6d699bf6aa5c0da6a88919e2 (patch) | |
tree | 7643729895f84a32031c175bf66128d8ada3020b /chrome/browser/bookmarks/bookmark_model_test_utils.h | |
parent | a0580124bbc7affc8d7517ca6b7f972c5da882fc (diff) | |
download | chromium_src-814a2d33e8655daf6d699bf6aa5c0da6a88919e2.zip chromium_src-814a2d33e8655daf6d699bf6aa5c0da6a88919e2.tar.gz chromium_src-814a2d33e8655daf6d699bf6aa5c0da6a88919e2.tar.bz2 |
Implement ID persistence for bookmarks:
- Bookmark codec now takes in a ctor argument persist_ids
- If it's true, it will serialize IDs of bookmarks when encoding, and
deserialize already serialized IDs (if present) when decoding.
- During decoding, unique-ify the IDs if they are not unique.
- Add unit tests for all new code.
Coming up in a separate changelist:
- Move ID generation logic to bookmark model, and make it non-static.
Review URL: http://codereview.chromium.org/99217
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15013 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/bookmarks/bookmark_model_test_utils.h')
-rw-r--r-- | chrome/browser/bookmarks/bookmark_model_test_utils.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/chrome/browser/bookmarks/bookmark_model_test_utils.h b/chrome/browser/bookmarks/bookmark_model_test_utils.h new file mode 100644 index 0000000..fbd814f --- /dev/null +++ b/chrome/browser/bookmarks/bookmark_model_test_utils.h @@ -0,0 +1,27 @@ +// Copyright (c) 2006-2009 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 CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_TEST_UTILS_H_ +#define CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_TEST_UTILS_H_ + +class BookmarkModel; +class BookmarkNode; + +// Contains utilities for bookmark model related tests. +class BookmarkModelTestUtils { + public: + // Verifies that the two given bookmark models are the same. + // The IDs of the bookmark nodes are compared only if check_ids is true. + static void AssertModelsEqual(BookmarkModel* expected, + BookmarkModel* actual, + bool check_ids); + private: + // Helper to verify the two given bookmark nodes. + // The IDs of the bookmark nodes are compared only if check_ids is true. + static void AssertNodesEqual(BookmarkNode* expected, + BookmarkNode* actual, + bool check_ids); +}; + +#endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_TEST_UTILS_H_ |