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 "chrome/browser/sync/sessions/sessions_sync_manager.h" | 5 #include "chrome/browser/sync/sessions/sessions_sync_manager.h" |
6 | 6 |
7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
9 #include "chrome/browser/sessions/session_tab_helper.h" | 9 #include "chrome/browser/sessions/session_tab_helper.h" |
10 #include "chrome/browser/sessions/session_types.h" | 10 #include "chrome/browser/sessions/session_types.h" |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 window_s.set_browser_type(sync_pb::SessionWindow_BrowserType_TYPE_TABBED); | 328 window_s.set_browser_type(sync_pb::SessionWindow_BrowserType_TYPE_TABBED); |
329 window_s.set_selected_tab_index(1); | 329 window_s.set_selected_tab_index(1); |
330 | 330 |
331 std::string tag = "tag"; | 331 std::string tag = "tag"; |
332 SyncedSession* session = manager()->session_tracker_.GetSession(tag); | 332 SyncedSession* session = manager()->session_tracker_.GetSession(tag); |
333 manager()->session_tracker_.PutWindowInSession(tag, 0); | 333 manager()->session_tracker_.PutWindowInSession(tag, 0); |
334 manager()->BuildSyncedSessionFromSpecifics( | 334 manager()->BuildSyncedSessionFromSpecifics( |
335 tag, window_s, base::Time(), session->windows[0]); | 335 tag, window_s, base::Time(), session->windows[0]); |
336 ASSERT_EQ(1U, session->windows[0]->tabs.size()); | 336 ASSERT_EQ(1U, session->windows[0]->tabs.size()); |
337 ASSERT_EQ(1, session->windows[0]->selected_tab_index); | 337 ASSERT_EQ(1, session->windows[0]->selected_tab_index); |
338 ASSERT_EQ(1, session->windows[0]->type); | 338 ASSERT_EQ(SessionWindow::TYPE_TABBED, session->windows[0]->type); |
339 ASSERT_EQ(1U, manager()->session_tracker_.num_synced_sessions()); | 339 ASSERT_EQ(1U, manager()->session_tracker_.num_synced_sessions()); |
340 ASSERT_EQ(1U, | 340 ASSERT_EQ(1U, |
341 manager()->session_tracker_.num_synced_tabs(std::string("tag"))); | 341 manager()->session_tracker_.num_synced_tabs(std::string("tag"))); |
342 } | 342 } |
343 | 343 |
344 namespace { | 344 namespace { |
345 | 345 |
346 class SyncedTabDelegateFake : public SyncedTabDelegate { | 346 class SyncedTabDelegateFake : public SyncedTabDelegate { |
347 public: | 347 public: |
348 SyncedTabDelegateFake() : current_entry_index_(0), | 348 SyncedTabDelegateFake() : current_entry_index_(0), |
(...skipping 1614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1963 base::Time(), | 1963 base::Time(), |
1964 syncer::AttachmentIdList(), | 1964 syncer::AttachmentIdList(), |
1965 syncer::AttachmentServiceProxyForTest::Create())); | 1965 syncer::AttachmentServiceProxyForTest::Create())); |
1966 } | 1966 } |
1967 | 1967 |
1968 syncer::SyncChangeList output; | 1968 syncer::SyncChangeList output; |
1969 InitWithSyncDataTakeOutput(initial_data, &output); | 1969 InitWithSyncDataTakeOutput(initial_data, &output); |
1970 } | 1970 } |
1971 | 1971 |
1972 } // namespace browser_sync | 1972 } // namespace browser_sync |
OLD | NEW |