| 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 } | 134 } |
| 135 | 135 |
| 136 virtual void TearDown() OVERRIDE { | 136 virtual void TearDown() OVERRIDE { |
| 137 mock_attachment_service_ = NULL; | 137 mock_attachment_service_ = NULL; |
| 138 test_user_share_.TearDown(); | 138 test_user_share_.TearDown(); |
| 139 } | 139 } |
| 140 | 140 |
| 141 void BuildChildNodes(int n) { | 141 void BuildChildNodes(int n) { |
| 142 syncer::WriteTransaction trans(FROM_HERE, user_share()); | 142 syncer::WriteTransaction trans(FROM_HERE, user_share()); |
| 143 syncer::ReadNode root(&trans); | 143 syncer::ReadNode root(&trans); |
| 144 ASSERT_EQ(syncer::BaseNode::INIT_OK, | 144 ASSERT_EQ(syncer::BaseNode::INIT_OK, root.InitTypeRoot(kType)); |
| 145 root.InitByTagLookup(syncer::ModelTypeToRootTag(kType))); | |
| 146 for (int i = 0; i < n; ++i) { | 145 for (int i = 0; i < n; ++i) { |
| 147 syncer::WriteNode node(&trans); | 146 syncer::WriteNode node(&trans); |
| 148 node.InitUniqueByCreation(kType, root, base::StringPrintf("node%05d", i)); | 147 node.InitUniqueByCreation(kType, root, base::StringPrintf("node%05d", i)); |
| 149 } | 148 } |
| 150 } | 149 } |
| 151 | 150 |
| 152 GenericChangeProcessor* change_processor() { | 151 GenericChangeProcessor* change_processor() { |
| 153 return change_processor_.get(); | 152 return change_processor_.get(); |
| 154 } | 153 } |
| 155 | 154 |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 syncer::ReadNode node(&read_transaction); | 412 syncer::ReadNode node(&read_transaction); |
| 414 ASSERT_EQ(node.InitByClientTagLookup(syncer::PREFERENCES, tag), | 413 ASSERT_EQ(node.InitByClientTagLookup(syncer::PREFERENCES, tag), |
| 415 syncer::BaseNode::INIT_OK); | 414 syncer::BaseNode::INIT_OK); |
| 416 syncer::AttachmentIdList attachment_ids = node.GetAttachmentIds(); | 415 syncer::AttachmentIdList attachment_ids = node.GetAttachmentIds(); |
| 417 EXPECT_EQ(1U, attachment_ids.size()); | 416 EXPECT_EQ(1U, attachment_ids.size()); |
| 418 } | 417 } |
| 419 | 418 |
| 420 } // namespace | 419 } // namespace |
| 421 | 420 |
| 422 } // namespace browser_sync | 421 } // namespace browser_sync |
| OLD | NEW |