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 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
816 profile_->CreateHistoryService(false); | 816 profile_->CreateHistoryService(false); |
817 profile_->CreateBookmarkModel(true); | 817 profile_->CreateBookmarkModel(true); |
818 BlockTillBookmarkModelLoaded(); | 818 BlockTillBookmarkModelLoaded(); |
819 | 819 |
820 // Add a URL. | 820 // Add a URL. |
821 GURL url("http://www.google.com"); | 821 GURL url("http://www.google.com"); |
822 bb_model_->SetURLStarred(url, std::wstring(), true); | 822 bb_model_->SetURLStarred(url, std::wstring(), true); |
823 | 823 |
824 profile_->GetHistoryService(Profile::EXPLICIT_ACCESS)->AddPage( | 824 profile_->GetHistoryService(Profile::EXPLICIT_ACCESS)->AddPage( |
825 url, NULL, 1, GURL(), PageTransition::TYPED, | 825 url, NULL, 1, GURL(), PageTransition::TYPED, |
826 HistoryService::RedirectList()); | 826 HistoryService::RedirectList(), false); |
827 | 827 |
828 // This won't actually delete the URL, rather it'll empty out the visits. | 828 // This won't actually delete the URL, rather it'll empty out the visits. |
829 // This triggers blocking on the BookmarkModel. | 829 // This triggers blocking on the BookmarkModel. |
830 profile_->GetHistoryService(Profile::EXPLICIT_ACCESS)->DeleteURL(url); | 830 profile_->GetHistoryService(Profile::EXPLICIT_ACCESS)->DeleteURL(url); |
831 } | 831 } |
832 | 832 |
833 TEST_F(BookmarkModelTest, Sort) { | 833 TEST_F(BookmarkModelTest, Sort) { |
834 // Populate the bookmark bar node with nodes for 'B', 'a', 'd' and 'C'. | 834 // Populate the bookmark bar node with nodes for 'B', 'a', 'd' and 'C'. |
835 // 'C' and 'a' are folders. | 835 // 'C' and 'a' are folders. |
836 TestNode bbn; | 836 TestNode bbn; |
(...skipping 16 matching lines...) Expand all 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 |