| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #include "app/tree_node_iterator.h" | 5 #include "app/tree_node_iterator.h" |
| 6 #include "app/tree_node_model.h" | 6 #include "app/tree_node_model.h" |
| 7 #include "base/hash_tables.h" | 7 #include "base/hash_tables.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "chrome/browser/bookmarks/bookmark_codec.h" | 9 #include "chrome/browser/bookmarks/bookmark_codec.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_model.h" | 10 #include "chrome/browser/bookmarks/bookmark_model.h" |
| (...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 } else { | 588 } else { |
| 589 // No need to check the URL, just the title is enough. | 589 // No need to check the URL, just the title is enough. |
| 590 ASSERT_TRUE(actual_child->GetType() == | 590 ASSERT_TRUE(actual_child->GetType() == |
| 591 history::StarredEntry::URL); | 591 history::StarredEntry::URL); |
| 592 } | 592 } |
| 593 } | 593 } |
| 594 } | 594 } |
| 595 | 595 |
| 596 void VerifyNoDuplicateIDs(BookmarkModel* model) { | 596 void VerifyNoDuplicateIDs(BookmarkModel* model) { |
| 597 TreeNodeIterator<const BookmarkNode> it(model->root_node()); | 597 TreeNodeIterator<const BookmarkNode> it(model->root_node()); |
| 598 base::hash_set<int> ids; | 598 base::hash_set<int64> ids; |
| 599 while (it.has_next()) | 599 while (it.has_next()) |
| 600 ASSERT_TRUE(ids.insert(it.Next()->id()).second); | 600 ASSERT_TRUE(ids.insert(it.Next()->id()).second); |
| 601 } | 601 } |
| 602 | 602 |
| 603 void BlockTillBookmarkModelLoaded() { | 603 void BlockTillBookmarkModelLoaded() { |
| 604 bb_model_ = profile_->GetBookmarkModel(); | 604 bb_model_ = profile_->GetBookmarkModel(); |
| 605 if (!bb_model_->IsLoaded()) | 605 if (!bb_model_->IsLoaded()) |
| 606 BlockTillLoaded(bb_model_); | 606 BlockTillLoaded(bb_model_); |
| 607 else | 607 else |
| 608 bb_model_->AddObserver(this); | 608 bb_model_->AddObserver(this); |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 853 // Make sure we were notified. | 853 // Make sure we were notified. |
| 854 AssertObserverCount(0, 0, 0, 0, 1); | 854 AssertObserverCount(0, 0, 0, 0, 1); |
| 855 | 855 |
| 856 // Make sure the order matches (remember, 'a' and 'C' are folders and | 856 // Make sure the order matches (remember, 'a' and 'C' are folders and |
| 857 // come first). | 857 // come first). |
| 858 EXPECT_TRUE(parent->GetChild(0)->GetTitle() == L"a"); | 858 EXPECT_TRUE(parent->GetChild(0)->GetTitle() == L"a"); |
| 859 EXPECT_TRUE(parent->GetChild(1)->GetTitle() == L"C"); | 859 EXPECT_TRUE(parent->GetChild(1)->GetTitle() == L"C"); |
| 860 EXPECT_TRUE(parent->GetChild(2)->GetTitle() == L"B"); | 860 EXPECT_TRUE(parent->GetChild(2)->GetTitle() == L"B"); |
| 861 EXPECT_TRUE(parent->GetChild(3)->GetTitle() == L"d"); | 861 EXPECT_TRUE(parent->GetChild(3)->GetTitle() == L"d"); |
| 862 } | 862 } |
| OLD | NEW |