| 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 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 return; | 586 return; |
| 587 } else { | 587 } else { |
| 588 // No need to check the URL, just the title is enough. | 588 // No need to check the URL, just the title is enough. |
| 589 ASSERT_TRUE(actual_child->GetType() == BookmarkNode::URL); | 589 ASSERT_TRUE(actual_child->GetType() == BookmarkNode::URL); |
| 590 } | 590 } |
| 591 } | 591 } |
| 592 } | 592 } |
| 593 | 593 |
| 594 void VerifyNoDuplicateIDs(BookmarkModel* model) { | 594 void VerifyNoDuplicateIDs(BookmarkModel* model) { |
| 595 TreeNodeIterator<const BookmarkNode> it(model->root_node()); | 595 TreeNodeIterator<const BookmarkNode> it(model->root_node()); |
| 596 base::hash_set<int> ids; | 596 base::hash_set<int64> ids; |
| 597 while (it.has_next()) | 597 while (it.has_next()) |
| 598 ASSERT_TRUE(ids.insert(it.Next()->id()).second); | 598 ASSERT_TRUE(ids.insert(it.Next()->id()).second); |
| 599 } | 599 } |
| 600 | 600 |
| 601 void BlockTillBookmarkModelLoaded() { | 601 void BlockTillBookmarkModelLoaded() { |
| 602 bb_model_ = profile_->GetBookmarkModel(); | 602 bb_model_ = profile_->GetBookmarkModel(); |
| 603 if (!bb_model_->IsLoaded()) | 603 if (!bb_model_->IsLoaded()) |
| 604 BlockTillLoaded(bb_model_); | 604 BlockTillLoaded(bb_model_); |
| 605 else | 605 else |
| 606 bb_model_->AddObserver(this); | 606 bb_model_->AddObserver(this); |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 851 // Make sure we were notified. | 851 // Make sure we were notified. |
| 852 AssertObserverCount(0, 0, 0, 0, 1); | 852 AssertObserverCount(0, 0, 0, 0, 1); |
| 853 | 853 |
| 854 // Make sure the order matches (remember, 'a' and 'C' are folders and | 854 // Make sure the order matches (remember, 'a' and 'C' are folders and |
| 855 // come first). | 855 // come first). |
| 856 EXPECT_TRUE(parent->GetChild(0)->GetTitle() == L"a"); | 856 EXPECT_TRUE(parent->GetChild(0)->GetTitle() == L"a"); |
| 857 EXPECT_TRUE(parent->GetChild(1)->GetTitle() == L"C"); | 857 EXPECT_TRUE(parent->GetChild(1)->GetTitle() == L"C"); |
| 858 EXPECT_TRUE(parent->GetChild(2)->GetTitle() == L"B"); | 858 EXPECT_TRUE(parent->GetChild(2)->GetTitle() == L"B"); |
| 859 EXPECT_TRUE(parent->GetChild(3)->GetTitle() == L"d"); | 859 EXPECT_TRUE(parent->GetChild(3)->GetTitle() == L"d"); |
| 860 } | 860 } |
| OLD | NEW |