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

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

Issue 562693002: Move TestBookmarkClient into bookmarks namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix enhanced_bookmarks Created 6 years, 3 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
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_codec.h" 5 #include "components/bookmarks/browser/bookmark_codec.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/json/json_file_value_serializer.h" 9 #include "base/json/json_file_value_serializer.h"
10 #include "base/json/json_string_value_serializer.h" 10 #include "base/json/json_string_value_serializer.h"
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 CheckIDs(node->GetChild(i), assigned_ids); 217 CheckIDs(node->GetChild(i), assigned_ids);
218 } 218 }
219 219
220 void ExpectIDsUnique(BookmarkModel* model) { 220 void ExpectIDsUnique(BookmarkModel* model) {
221 std::set<int64> assigned_ids; 221 std::set<int64> assigned_ids;
222 CheckIDs(model->bookmark_bar_node(), &assigned_ids); 222 CheckIDs(model->bookmark_bar_node(), &assigned_ids);
223 CheckIDs(model->other_node(), &assigned_ids); 223 CheckIDs(model->other_node(), &assigned_ids);
224 CheckIDs(model->mobile_node(), &assigned_ids); 224 CheckIDs(model->mobile_node(), &assigned_ids);
225 } 225 }
226 226
227 test::TestBookmarkClient client_; 227 TestBookmarkClient client_;
228 }; 228 };
229 229
230 TEST_F(BookmarkCodecTest, ChecksumEncodeDecodeTest) { 230 TEST_F(BookmarkCodecTest, ChecksumEncodeDecodeTest) {
231 scoped_ptr<BookmarkModel> model_to_encode(CreateTestModel1()); 231 scoped_ptr<BookmarkModel> model_to_encode(CreateTestModel1());
232 std::string enc_checksum; 232 std::string enc_checksum;
233 scoped_ptr<base::Value> value( 233 scoped_ptr<base::Value> value(
234 EncodeHelper(model_to_encode.get(), &enc_checksum)); 234 EncodeHelper(model_to_encode.get(), &enc_checksum));
235 235
236 EXPECT_TRUE(value.get() != NULL); 236 EXPECT_TRUE(value.get() != NULL);
237 237
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 bbn->GetChild(1)->GetMetaInfo(kSyncTransactionVersionKey, &meta_value)); 469 bbn->GetChild(1)->GetMetaInfo(kSyncTransactionVersionKey, &meta_value));
470 EXPECT_TRUE(bbn->GetChild(0)->GetMetaInfo(kNormalKey, &meta_value)); 470 EXPECT_TRUE(bbn->GetChild(0)->GetMetaInfo(kNormalKey, &meta_value));
471 EXPECT_EQ("value", meta_value); 471 EXPECT_EQ("value", meta_value);
472 EXPECT_TRUE(bbn->GetChild(1)->GetMetaInfo(kNormalKey, &meta_value)); 472 EXPECT_TRUE(bbn->GetChild(1)->GetMetaInfo(kNormalKey, &meta_value));
473 EXPECT_EQ("value2", meta_value); 473 EXPECT_EQ("value2", meta_value);
474 EXPECT_TRUE(bbn->GetChild(0)->GetMetaInfo(kNestedKey, &meta_value)); 474 EXPECT_TRUE(bbn->GetChild(0)->GetMetaInfo(kNestedKey, &meta_value));
475 EXPECT_EQ("value3", meta_value); 475 EXPECT_EQ("value3", meta_value);
476 } 476 }
477 477
478 } // namespace bookmarks 478 } // namespace bookmarks
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698