| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <map> | 5 #include <map> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 ASSERT_TRUE(create_root.success()); | 409 ASSERT_TRUE(create_root.success()); |
| 410 | 410 |
| 411 // Check that the DataTypeController associated the models. | 411 // Check that the DataTypeController associated the models. |
| 412 bool has_nodes; | 412 bool has_nodes; |
| 413 ASSERT_TRUE(model_associator_->SyncModelHasUserCreatedNodes(&has_nodes)); | 413 ASSERT_TRUE(model_associator_->SyncModelHasUserCreatedNodes(&has_nodes)); |
| 414 ASSERT_TRUE(has_nodes); | 414 ASSERT_TRUE(has_nodes); |
| 415 | 415 |
| 416 // Fill an instance of session specifics with a foreign session's data. | 416 // Fill an instance of session specifics with a foreign session's data. |
| 417 std::string tag = "tag1"; | 417 std::string tag = "tag1"; |
| 418 sync_pb::SessionSpecifics meta; | 418 sync_pb::SessionSpecifics meta; |
| 419 DCHECK(!meta.header().has_client_name()); |
| 419 BuildSessionSpecifics(tag, &meta); | 420 BuildSessionSpecifics(tag, &meta); |
| 420 SessionID::id_type tab_nums1[] = {5, 10, 13, 17}; | 421 SessionID::id_type tab_nums1[] = {5, 10, 13, 17}; |
| 421 std::vector<SessionID::id_type> tab_list1( | 422 std::vector<SessionID::id_type> tab_list1( |
| 422 tab_nums1, tab_nums1 + arraysize(tab_nums1)); | 423 tab_nums1, tab_nums1 + arraysize(tab_nums1)); |
| 423 AddWindowSpecifics(0, tab_list1, &meta); | 424 AddWindowSpecifics(0, tab_list1, &meta); |
| 424 std::vector<sync_pb::SessionSpecifics> tabs1; | 425 std::vector<sync_pb::SessionSpecifics> tabs1; |
| 425 tabs1.resize(tab_list1.size()); | 426 tabs1.resize(tab_list1.size()); |
| 426 for (size_t i = 0; i < tab_list1.size(); ++i) { | 427 for (size_t i = 0; i < tab_list1.size(); ++i) { |
| 427 BuildTabSpecifics(tag, 0, tab_list1[i], &tabs1[i]); | 428 BuildTabSpecifics(tag, 0, tab_list1[i], &tabs1[i]); |
| 428 } | 429 } |
| (...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1213 sync_pb::SessionSpecifics specifics; | 1214 sync_pb::SessionSpecifics specifics; |
| 1214 header.SetSessionSpecifics(specifics); | 1215 header.SetSessionSpecifics(specifics); |
| 1215 } | 1216 } |
| 1216 // Ensure we associate properly despite the pre-existing node with our local | 1217 // Ensure we associate properly despite the pre-existing node with our local |
| 1217 // tag. | 1218 // tag. |
| 1218 error = model_associator_->AssociateModels(NULL, NULL); | 1219 error = model_associator_->AssociateModels(NULL, NULL); |
| 1219 ASSERT_FALSE(error.IsSet()); | 1220 ASSERT_FALSE(error.IsSet()); |
| 1220 } | 1221 } |
| 1221 | 1222 |
| 1222 } // namespace browser_sync | 1223 } // namespace browser_sync |
| OLD | NEW |