OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <set> | 5 #include <set> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/base_paths.h" | 8 #include "base/base_paths.h" |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 1051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1062 GURL url("http://www.google.com"); | 1062 GURL url("http://www.google.com"); |
1063 bookmark_utils::AddIfNotBookmarked(bb_model_, url, string16()); | 1063 bookmark_utils::AddIfNotBookmarked(bb_model_, url, string16()); |
1064 | 1064 |
1065 HistoryServiceFactory::GetForProfile( | 1065 HistoryServiceFactory::GetForProfile( |
1066 profile_.get(), Profile::EXPLICIT_ACCESS)->AddPage( | 1066 profile_.get(), Profile::EXPLICIT_ACCESS)->AddPage( |
1067 url, NULL, 1, GURL(), content::PAGE_TRANSITION_TYPED, | 1067 url, NULL, 1, GURL(), content::PAGE_TRANSITION_TYPED, |
1068 history::RedirectList(), history::SOURCE_BROWSED, false); | 1068 history::RedirectList(), history::SOURCE_BROWSED, false); |
1069 | 1069 |
1070 // This won't actually delete the URL, rather it'll empty out the visits. | 1070 // This won't actually delete the URL, rather it'll empty out the visits. |
1071 // This triggers blocking on the BookmarkModel. | 1071 // This triggers blocking on the BookmarkModel. |
1072 profile_->GetHistoryService(Profile::EXPLICIT_ACCESS)->DeleteURL(url); | 1072 HistoryServiceFactory::GetForProfile( |
| 1073 profile_.get(), Profile::EXPLICIT_ACCESS)->DeleteURL(url); |
1073 } | 1074 } |
1074 | 1075 |
1075 TEST_F(BookmarkModelTest, Sort) { | 1076 TEST_F(BookmarkModelTest, Sort) { |
1076 // Populate the bookmark bar node with nodes for 'B', 'a', 'd' and 'C'. | 1077 // Populate the bookmark bar node with nodes for 'B', 'a', 'd' and 'C'. |
1077 // 'C' and 'a' are folders. | 1078 // 'C' and 'a' are folders. |
1078 TestNode bbn; | 1079 TestNode bbn; |
1079 PopulateNodeFromString("B [ a ] d [ a ]", &bbn); | 1080 PopulateNodeFromString("B [ a ] d [ a ]", &bbn); |
1080 const BookmarkNode* parent = model_.bookmark_bar_node(); | 1081 const BookmarkNode* parent = model_.bookmark_bar_node(); |
1081 PopulateBookmarkNode(&bbn, &model_, parent); | 1082 PopulateBookmarkNode(&bbn, &model_, parent); |
1082 | 1083 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1159 AssertExtensiveChangesObserverCount(1, 0); | 1160 AssertExtensiveChangesObserverCount(1, 0); |
1160 model_.EndExtensiveChanges(); | 1161 model_.EndExtensiveChanges(); |
1161 EXPECT_TRUE(model_.IsDoingExtensiveChanges()); | 1162 EXPECT_TRUE(model_.IsDoingExtensiveChanges()); |
1162 AssertExtensiveChangesObserverCount(1, 0); | 1163 AssertExtensiveChangesObserverCount(1, 0); |
1163 model_.EndExtensiveChanges(); | 1164 model_.EndExtensiveChanges(); |
1164 EXPECT_FALSE(model_.IsDoingExtensiveChanges()); | 1165 EXPECT_FALSE(model_.IsDoingExtensiveChanges()); |
1165 AssertExtensiveChangesObserverCount(1, 1); | 1166 AssertExtensiveChangesObserverCount(1, 1); |
1166 } | 1167 } |
1167 | 1168 |
1168 } // namespace | 1169 } // namespace |
OLD | NEW |