| OLD | NEW |
| 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/sync_driver/generic_change_processor.h" | 5 #include "components/sync_driver/generic_change_processor.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 } | 131 } |
| 132 | 132 |
| 133 virtual void TearDown() OVERRIDE { | 133 virtual void TearDown() OVERRIDE { |
| 134 mock_attachment_service_ = NULL; | 134 mock_attachment_service_ = NULL; |
| 135 test_user_share_.TearDown(); | 135 test_user_share_.TearDown(); |
| 136 } | 136 } |
| 137 | 137 |
| 138 void BuildChildNodes(int n) { | 138 void BuildChildNodes(int n) { |
| 139 syncer::WriteTransaction trans(FROM_HERE, user_share()); | 139 syncer::WriteTransaction trans(FROM_HERE, user_share()); |
| 140 syncer::ReadNode root(&trans); | 140 syncer::ReadNode root(&trans); |
| 141 ASSERT_EQ(syncer::BaseNode::INIT_OK, | 141 ASSERT_EQ(syncer::BaseNode::INIT_OK, root.InitTypeRoot(kType)); |
| 142 root.InitByTagLookup(syncer::ModelTypeToRootTag(kType))); | |
| 143 for (int i = 0; i < n; ++i) { | 142 for (int i = 0; i < n; ++i) { |
| 144 syncer::WriteNode node(&trans); | 143 syncer::WriteNode node(&trans); |
| 145 node.InitUniqueByCreation(kType, root, base::StringPrintf("node%05d", i)); | 144 node.InitUniqueByCreation(kType, root, base::StringPrintf("node%05d", i)); |
| 146 } | 145 } |
| 147 } | 146 } |
| 148 | 147 |
| 149 GenericChangeProcessor* change_processor() { | 148 GenericChangeProcessor* change_processor() { |
| 150 return change_processor_.get(); | 149 return change_processor_.get(); |
| 151 } | 150 } |
| 152 | 151 |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 syncer::ReadNode node(&read_transaction); | 409 syncer::ReadNode node(&read_transaction); |
| 411 ASSERT_EQ(node.InitByClientTagLookup(syncer::PREFERENCES, tag), | 410 ASSERT_EQ(node.InitByClientTagLookup(syncer::PREFERENCES, tag), |
| 412 syncer::BaseNode::INIT_OK); | 411 syncer::BaseNode::INIT_OK); |
| 413 syncer::AttachmentIdList attachment_ids = node.GetAttachmentIds(); | 412 syncer::AttachmentIdList attachment_ids = node.GetAttachmentIds(); |
| 414 EXPECT_EQ(1U, attachment_ids.size()); | 413 EXPECT_EQ(1U, attachment_ids.size()); |
| 415 } | 414 } |
| 416 | 415 |
| 417 } // namespace | 416 } // namespace |
| 418 | 417 |
| 419 } // namespace browser_sync | 418 } // namespace browser_sync |
| OLD | NEW |