| 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 "components/sync_sessions/session_sync_test_helper.h" | 5 #include "components/sync_sessions/session_sync_test_helper.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "components/sync/protocol/session_specifics.pb.h" | 10 #include "components/sync/protocol/session_specifics.pb.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 ASSERT_EQ(kClientName, session.session_name); | 55 ASSERT_EQ(kClientName, session.session_name); |
| 56 ASSERT_EQ(windows.size(), session.windows.size()); | 56 ASSERT_EQ(windows.size(), session.windows.size()); |
| 57 | 57 |
| 58 // We assume the window id's are in increasing order. | 58 // We assume the window id's are in increasing order. |
| 59 int i = 0; | 59 int i = 0; |
| 60 for (std::vector<std::vector<int>>::const_iterator win_iter = windows.begin(); | 60 for (std::vector<std::vector<int>>::const_iterator win_iter = windows.begin(); |
| 61 win_iter != windows.end(); ++win_iter, ++i) { | 61 win_iter != windows.end(); ++win_iter, ++i) { |
| 62 sessions::SessionWindow* win_ptr; | 62 sessions::SessionWindow* win_ptr; |
| 63 auto map_iter = session.windows.find(i); | 63 auto map_iter = session.windows.find(i); |
| 64 if (map_iter != session.windows.end()) | 64 if (map_iter != session.windows.end()) |
| 65 win_ptr = map_iter->second.get(); | 65 win_ptr = &map_iter->second->wrapped_window; |
| 66 else | 66 else |
| 67 FAIL(); | 67 FAIL(); |
| 68 ASSERT_EQ(win_iter->size(), win_ptr->tabs.size()); | 68 ASSERT_EQ(win_iter->size(), win_ptr->tabs.size()); |
| 69 ASSERT_EQ(0, win_ptr->selected_tab_index); | 69 ASSERT_EQ(0, win_ptr->selected_tab_index); |
| 70 ASSERT_EQ(sessions::SessionWindow::TYPE_TABBED, win_ptr->type); | 70 ASSERT_EQ(sessions::SessionWindow::TYPE_TABBED, win_ptr->type); |
| 71 int j = 0; | 71 int j = 0; |
| 72 for (auto tab_iter = (*win_iter).begin(); tab_iter != (*win_iter).end(); | 72 for (auto tab_iter = (*win_iter).begin(); tab_iter != (*win_iter).end(); |
| 73 ++tab_iter, ++j) { | 73 ++tab_iter, ++j) { |
| 74 sessions::SessionTab* tab = win_ptr->tabs[j].get(); | 74 sessions::SessionTab* tab = win_ptr->tabs[j].get(); |
| 75 ASSERT_EQ(*tab_iter, tab->tab_id.id()); | 75 ASSERT_EQ(*tab_iter, tab->tab_id.id()); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 for (size_t i = 0; i < tab_list.size(); ++i) { | 133 for (size_t i = 0; i < tab_list.size(); ++i) { |
| 134 BuildTabSpecifics(tag, 0, tab_list[i], &tabs1[i]); | 134 BuildTabSpecifics(tag, 0, tab_list[i], &tabs1[i]); |
| 135 } | 135 } |
| 136 | 136 |
| 137 if (tabs) | 137 if (tabs) |
| 138 tabs->swap(tabs1); | 138 tabs->swap(tabs1); |
| 139 return meta; | 139 return meta; |
| 140 } | 140 } |
| 141 | 141 |
| 142 } // namespace sync_sessions | 142 } // namespace sync_sessions |
| OLD | NEW |