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

Side by Side Diff: components/bookmarks/browser/bookmark_model_unittest.cc

Issue 867473002: Revert of Eliminate components_unittests' dependence on chrome resources. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | components/components_tests.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/bookmarks/browser/bookmark_model.h" 5 #include "components/bookmarks/browser/bookmark_model.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 9
10 #include "base/base_paths.h" 10 #include "base/base_paths.h"
(...skipping 968 matching lines...) Expand 10 before | Expand all | Expand 10 after
979 PopulateNodeFromString(data[i].mobile_contents, &mobile); 979 PopulateNodeFromString(data[i].mobile_contents, &mobile);
980 PopulateBookmarkNode(&mobile, model_.get(), model_->mobile_node()); 980 PopulateBookmarkNode(&mobile, model_.get(), model_->mobile_node());
981 981
982 VerifyModelMatchesNode(&bbn, model_->bookmark_bar_node()); 982 VerifyModelMatchesNode(&bbn, model_->bookmark_bar_node());
983 VerifyModelMatchesNode(&other, model_->other_node()); 983 VerifyModelMatchesNode(&other, model_->other_node());
984 VerifyModelMatchesNode(&mobile, model_->mobile_node()); 984 VerifyModelMatchesNode(&mobile, model_->mobile_node());
985 VerifyNoDuplicateIDs(model_.get()); 985 VerifyNoDuplicateIDs(model_.get());
986 } 986 }
987 } 987 }
988 988
989 #if !defined(OS_ANDROID) && !defined(OS_IOS) // http://crbug.com/450464
990 TEST_F(BookmarkModelTest, Sort) { 989 TEST_F(BookmarkModelTest, Sort) {
991 // Populate the bookmark bar node with nodes for 'B', 'a', 'd' and 'C'. 990 // Populate the bookmark bar node with nodes for 'B', 'a', 'd' and 'C'.
992 // 'C' and 'a' are folders. 991 // 'C' and 'a' are folders.
993 TestNode bbn; 992 TestNode bbn;
994 PopulateNodeFromString("B [ a ] d [ a ]", &bbn); 993 PopulateNodeFromString("B [ a ] d [ a ]", &bbn);
995 const BookmarkNode* parent = model_->bookmark_bar_node(); 994 const BookmarkNode* parent = model_->bookmark_bar_node();
996 PopulateBookmarkNode(&bbn, model_.get(), parent); 995 PopulateBookmarkNode(&bbn, model_.get(), parent);
997 996
998 BookmarkNode* child1 = AsMutable(parent->GetChild(1)); 997 BookmarkNode* child1 = AsMutable(parent->GetChild(1));
999 child1->SetTitle(ASCIIToUTF16("a")); 998 child1->SetTitle(ASCIIToUTF16("a"));
(...skipping 10 matching lines...) Expand all
1010 // Make sure we were notified. 1009 // Make sure we were notified.
1011 AssertObserverCount(0, 0, 0, 0, 1, 0, 0, 1, 0); 1010 AssertObserverCount(0, 0, 0, 0, 1, 0, 0, 1, 0);
1012 1011
1013 // Make sure the order matches (remember, 'a' and 'C' are folders and 1012 // Make sure the order matches (remember, 'a' and 'C' are folders and
1014 // come first). 1013 // come first).
1015 EXPECT_EQ(parent->GetChild(0)->GetTitle(), ASCIIToUTF16("a")); 1014 EXPECT_EQ(parent->GetChild(0)->GetTitle(), ASCIIToUTF16("a"));
1016 EXPECT_EQ(parent->GetChild(1)->GetTitle(), ASCIIToUTF16("C")); 1015 EXPECT_EQ(parent->GetChild(1)->GetTitle(), ASCIIToUTF16("C"));
1017 EXPECT_EQ(parent->GetChild(2)->GetTitle(), ASCIIToUTF16("B")); 1016 EXPECT_EQ(parent->GetChild(2)->GetTitle(), ASCIIToUTF16("B"));
1018 EXPECT_EQ(parent->GetChild(3)->GetTitle(), ASCIIToUTF16("d")); 1017 EXPECT_EQ(parent->GetChild(3)->GetTitle(), ASCIIToUTF16("d"));
1019 } 1018 }
1020 #endif
1021 1019
1022 TEST_F(BookmarkModelTest, Reorder) { 1020 TEST_F(BookmarkModelTest, Reorder) {
1023 // Populate the bookmark bar node with nodes 'A', 'B', 'C' and 'D'. 1021 // Populate the bookmark bar node with nodes 'A', 'B', 'C' and 'D'.
1024 TestNode bbn; 1022 TestNode bbn;
1025 PopulateNodeFromString("A B C D", &bbn); 1023 PopulateNodeFromString("A B C D", &bbn);
1026 BookmarkNode* parent = AsMutable(model_->bookmark_bar_node()); 1024 BookmarkNode* parent = AsMutable(model_->bookmark_bar_node());
1027 PopulateBookmarkNode(&bbn, model_.get(), parent); 1025 PopulateBookmarkNode(&bbn, model_.get(), parent);
1028 1026
1029 ClearCounts(); 1027 ClearCounts();
1030 1028
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
1193 EXPECT_FALSE(node.DeleteMetaInfo("key3")); 1191 EXPECT_FALSE(node.DeleteMetaInfo("key3"));
1194 EXPECT_FALSE(node.GetMetaInfo("key1", &out_value)); 1192 EXPECT_FALSE(node.GetMetaInfo("key1", &out_value));
1195 EXPECT_FALSE(node.GetMetaInfo("key2.subkey1", &out_value)); 1193 EXPECT_FALSE(node.GetMetaInfo("key2.subkey1", &out_value));
1196 EXPECT_FALSE(node.GetMetaInfo("key2.subkey2", &out_value)); 1194 EXPECT_FALSE(node.GetMetaInfo("key2.subkey2", &out_value));
1197 EXPECT_FALSE(node.GetMetaInfo("key2.subkey2.leaf", &out_value)); 1195 EXPECT_FALSE(node.GetMetaInfo("key2.subkey2.leaf", &out_value));
1198 EXPECT_FALSE(node.GetMetaInfoMap()); 1196 EXPECT_FALSE(node.GetMetaInfoMap());
1199 } 1197 }
1200 1198
1201 } // namespace 1199 } // namespace
1202 } // namespace bookmarks 1200 } // namespace bookmarks
OLDNEW
« no previous file with comments | « no previous file | components/components_tests.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698