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

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

Issue 348893002: Fixed flakiness in GetMostRecentlyAddedUserNodeForURLSkipsManagedNodes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after
1166 // Having a managed node doesn't count. 1166 // Having a managed node doesn't count.
1167 model_->AddURL(managed_parent, 0, title, url); 1167 model_->AddURL(managed_parent, 0, title, url);
1168 EXPECT_TRUE(model_->GetMostRecentlyAddedUserNodeForURL(url) == NULL); 1168 EXPECT_TRUE(model_->GetMostRecentlyAddedUserNodeForURL(url) == NULL);
1169 1169
1170 // Now add a user node. 1170 // Now add a user node.
1171 const BookmarkNode* user = model_->AddURL(user_parent, 0, title, url); 1171 const BookmarkNode* user = model_->AddURL(user_parent, 0, title, url);
1172 EXPECT_EQ(user, model_->GetMostRecentlyAddedUserNodeForURL(url)); 1172 EXPECT_EQ(user, model_->GetMostRecentlyAddedUserNodeForURL(url));
1173 1173
1174 // Having a more recent managed node doesn't count either. 1174 // Having a more recent managed node doesn't count either.
1175 const BookmarkNode* managed = model_->AddURL(managed_parent, 0, title, url); 1175 const BookmarkNode* managed = model_->AddURL(managed_parent, 0, title, url);
1176 EXPECT_GT(managed->date_added(), user->date_added()); 1176 EXPECT_GE(managed->date_added(), user->date_added());
1177 EXPECT_EQ(user, model_->GetMostRecentlyAddedUserNodeForURL(url)); 1177 EXPECT_EQ(user, model_->GetMostRecentlyAddedUserNodeForURL(url));
1178 } 1178 }
1179 1179
1180 TEST(BookmarkNodeTest, NodeMetaInfo) { 1180 TEST(BookmarkNodeTest, NodeMetaInfo) {
1181 GURL url; 1181 GURL url;
1182 BookmarkNode node(url); 1182 BookmarkNode node(url);
1183 EXPECT_FALSE(node.GetMetaInfoMap()); 1183 EXPECT_FALSE(node.GetMetaInfoMap());
1184 1184
1185 EXPECT_TRUE(node.SetMetaInfo("key1", "value1")); 1185 EXPECT_TRUE(node.SetMetaInfo("key1", "value1"));
1186 std::string out_value; 1186 std::string out_value;
(...skipping 16 matching lines...) Expand all
1203 EXPECT_TRUE(node.DeleteMetaInfo("key2.subkey2.leaf")); 1203 EXPECT_TRUE(node.DeleteMetaInfo("key2.subkey2.leaf"));
1204 EXPECT_FALSE(node.DeleteMetaInfo("key3")); 1204 EXPECT_FALSE(node.DeleteMetaInfo("key3"));
1205 EXPECT_FALSE(node.GetMetaInfo("key1", &out_value)); 1205 EXPECT_FALSE(node.GetMetaInfo("key1", &out_value));
1206 EXPECT_FALSE(node.GetMetaInfo("key2.subkey1", &out_value)); 1206 EXPECT_FALSE(node.GetMetaInfo("key2.subkey1", &out_value));
1207 EXPECT_FALSE(node.GetMetaInfo("key2.subkey2", &out_value)); 1207 EXPECT_FALSE(node.GetMetaInfo("key2.subkey2", &out_value));
1208 EXPECT_FALSE(node.GetMetaInfo("key2.subkey2.leaf", &out_value)); 1208 EXPECT_FALSE(node.GetMetaInfo("key2.subkey2.leaf", &out_value));
1209 EXPECT_FALSE(node.GetMetaInfoMap()); 1209 EXPECT_FALSE(node.GetMetaInfoMap());
1210 } 1210 }
1211 1211
1212 } // namespace 1212 } // namespace
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698