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

Unified Diff: chrome/browser/bookmarks/bookmark_model_test_utils.cc

Issue 99217: Implement ID persistence for bookmarks:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 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: chrome/browser/bookmarks/bookmark_model_test_utils.cc
===================================================================
--- chrome/browser/bookmarks/bookmark_model_test_utils.cc (revision 0)
+++ chrome/browser/bookmarks/bookmark_model_test_utils.cc (revision 0)
@@ -0,0 +1,43 @@
+// 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.
+
+#include "chrome/browser/bookmarks/bookmark_model_test_utils.h"
+
+#include "chrome/browser/bookmarks/bookmark_model.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+// static
+void BookmarkModelTestUtils::AssertNodesEqual(BookmarkNode* expected,
+ BookmarkNode* actual,
+ bool check_ids) {
+ ASSERT_TRUE(expected);
+ ASSERT_TRUE(actual);
+ if (check_ids)
+ EXPECT_EQ(expected->id(), actual->id());
+ EXPECT_EQ(expected->GetTitle(), actual->GetTitle());
+ EXPECT_EQ(expected->GetType(), actual->GetType());
+ EXPECT_TRUE(expected->date_added() == actual->date_added());
+ if (expected->GetType() == history::StarredEntry::URL) {
+ EXPECT_EQ(expected->GetURL(), actual->GetURL());
+ } else {
+ EXPECT_TRUE(expected->date_group_modified() ==
+ actual->date_group_modified());
+ ASSERT_EQ(expected->GetChildCount(), actual->GetChildCount());
+ for (int i = 0; i < expected->GetChildCount(); ++i)
+ AssertNodesEqual(expected->GetChild(i), actual->GetChild(i), check_ids);
+ }
+}
+
+// static
+void BookmarkModelTestUtils::AssertModelsEqual(BookmarkModel* expected,
+ BookmarkModel* actual,
+ bool check_ids) {
+ AssertNodesEqual(expected->GetBookmarkBarNode(),
+ actual->GetBookmarkBarNode(),
+ check_ids);
+ AssertNodesEqual(expected->other_node(),
+ actual->other_node(),
+ check_ids);
+}
+
Property changes on: chrome\browser\bookmarks\bookmark_model_test_utils.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome/browser/bookmarks/bookmark_model_test_utils.h ('k') | chrome/browser/bookmarks/bookmark_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698