OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 std::vector<sync_pb::SessionSpecifics> tabs(tab_list.size()); | 256 std::vector<sync_pb::SessionSpecifics> tabs(tab_list.size()); |
257 for (size_t i = 0; i < tab_list.size(); ++i) { | 257 for (size_t i = 0; i < tab_list.size(); ++i) { |
258 BuildTabSpecifics(kSessionTags[index], tab_list[i], &tabs[i]); | 258 BuildTabSpecifics(kSessionTags[index], tab_list[i], &tabs[i]); |
259 } | 259 } |
260 | 260 |
261 sync_pb::EntitySpecifics entity; | 261 sync_pb::EntitySpecifics entity; |
262 entity.mutable_session()->CopyFrom(meta); | 262 entity.mutable_session()->CopyFrom(meta); |
263 initial_data.push_back(syncer::SyncData::CreateRemoteData( | 263 initial_data.push_back(syncer::SyncData::CreateRemoteData( |
264 1, entity, base::Time(), syncer::AttachmentIdList(), | 264 1, entity, base::Time(), syncer::AttachmentIdList(), |
265 syncer::AttachmentServiceProxyForTest::Create(), | 265 syncer::AttachmentServiceProxyForTest::Create(), |
266 browser_sync::SessionsSyncManager::TagHashFromSpecifics( | 266 sync_sessions::SessionsSyncManager::TagHashFromSpecifics( |
267 entity.session()))); | 267 entity.session()))); |
268 for (size_t i = 0; i < tabs.size(); i++) { | 268 for (size_t i = 0; i < tabs.size(); i++) { |
269 sync_pb::EntitySpecifics entity; | 269 sync_pb::EntitySpecifics entity; |
270 entity.mutable_session()->CopyFrom(tabs[i]); | 270 entity.mutable_session()->CopyFrom(tabs[i]); |
271 initial_data.push_back(syncer::SyncData::CreateRemoteData( | 271 initial_data.push_back(syncer::SyncData::CreateRemoteData( |
272 i + 2, entity, base::Time(), syncer::AttachmentIdList(), | 272 i + 2, entity, base::Time(), syncer::AttachmentIdList(), |
273 syncer::AttachmentServiceProxyForTest::Create(), | 273 syncer::AttachmentServiceProxyForTest::Create(), |
274 browser_sync::SessionsSyncManager::TagHashFromSpecifics( | 274 sync_sessions::SessionsSyncManager::TagHashFromSpecifics( |
275 entity.session()))); | 275 entity.session()))); |
276 } | 276 } |
277 } | 277 } |
278 | 278 |
279 ProfileSyncServiceFactory::GetForProfile(browser_->profile()) | 279 ProfileSyncServiceFactory::GetForProfile(browser_->profile()) |
280 ->GetSessionsSyncableService() | 280 ->GetSessionsSyncableService() |
281 ->MergeDataAndStartSyncing(syncer::SESSIONS, initial_data, | 281 ->MergeDataAndStartSyncing(syncer::SESSIONS, initial_data, |
282 std::unique_ptr<syncer::SyncChangeProcessor>( | 282 std::unique_ptr<syncer::SyncChangeProcessor>( |
283 new syncer::FakeSyncChangeProcessor()), | 283 new syncer::FakeSyncChangeProcessor()), |
284 std::unique_ptr<syncer::SyncErrorFactory>( | 284 std::unique_ptr<syncer::SyncErrorFactory>( |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 EXPECT_EQ(0u, sessions->GetSize()); | 376 EXPECT_EQ(0u, sessions->GetSize()); |
377 } | 377 } |
378 | 378 |
379 // http://crbug.com/251199 | 379 // http://crbug.com/251199 |
380 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_SessionsApis) { | 380 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_SessionsApis) { |
381 ASSERT_TRUE(RunExtensionSubtest("sessions", | 381 ASSERT_TRUE(RunExtensionSubtest("sessions", |
382 "sessions.html")) << message_; | 382 "sessions.html")) << message_; |
383 } | 383 } |
384 | 384 |
385 } // namespace extensions | 385 } // namespace extensions |
OLD | NEW |