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 "chrome/browser/sync/glue/session_sync_test_helper.h" | 5 #include "chrome/browser/sync/glue/session_sync_test_helper.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/sync/glue/synced_session.h" | 8 #include "chrome/browser/sync/glue/synced_session.h" |
9 #include "sync/protocol/session_specifics.pb.h" | 9 #include "sync/protocol/session_specifics.pb.h" |
10 #include "sync/protocol/sync_enums.pb.h" | 10 #include "sync/protocol/sync_enums.pb.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 win_iter != windows.end(); ++win_iter, ++i) { | 62 win_iter != windows.end(); ++win_iter, ++i) { |
63 SessionWindow* win_ptr; | 63 SessionWindow* win_ptr; |
64 SyncedSession::SyncedWindowMap::const_iterator map_iter = | 64 SyncedSession::SyncedWindowMap::const_iterator map_iter = |
65 session.windows.find(i); | 65 session.windows.find(i); |
66 if (map_iter != session.windows.end()) | 66 if (map_iter != session.windows.end()) |
67 win_ptr = map_iter->second; | 67 win_ptr = map_iter->second; |
68 else | 68 else |
69 FAIL(); | 69 FAIL(); |
70 ASSERT_EQ(win_iter->size(), win_ptr->tabs.size()); | 70 ASSERT_EQ(win_iter->size(), win_ptr->tabs.size()); |
71 ASSERT_EQ(0, win_ptr->selected_tab_index); | 71 ASSERT_EQ(0, win_ptr->selected_tab_index); |
72 ASSERT_EQ(1, win_ptr->type); | 72 ASSERT_EQ(SessionWindow::TYPE_TABBED, win_ptr->type); |
73 int j = 0; | 73 int j = 0; |
74 for (std::vector<int>::const_iterator tab_iter = (*win_iter).begin(); | 74 for (std::vector<int>::const_iterator tab_iter = (*win_iter).begin(); |
75 tab_iter != (*win_iter).end(); ++tab_iter, ++j) { | 75 tab_iter != (*win_iter).end(); ++tab_iter, ++j) { |
76 SessionTab* tab = win_ptr->tabs[j]; | 76 SessionTab* tab = win_ptr->tabs[j]; |
77 ASSERT_EQ(*tab_iter, tab->tab_id.id()); | 77 ASSERT_EQ(*tab_iter, tab->tab_id.id()); |
78 ASSERT_EQ(1U, tab->navigations.size()); | 78 ASSERT_EQ(1U, tab->navigations.size()); |
79 ASSERT_EQ(1, tab->tab_visual_index); | 79 ASSERT_EQ(1, tab->tab_visual_index); |
80 ASSERT_EQ(0, tab->current_navigation_index); | 80 ASSERT_EQ(0, tab->current_navigation_index); |
81 ASSERT_TRUE(tab->pinned); | 81 ASSERT_TRUE(tab->pinned); |
82 ASSERT_EQ(kAppId, tab->extension_app_id); | 82 ASSERT_EQ(kAppId, tab->extension_app_id); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 for (size_t i = 0; i < tab_list.size(); ++i) { | 127 for (size_t i = 0; i < tab_list.size(); ++i) { |
128 BuildTabSpecifics(tag, 0, tab_list[i], &tabs1[i]); | 128 BuildTabSpecifics(tag, 0, tab_list[i], &tabs1[i]); |
129 } | 129 } |
130 | 130 |
131 if (tabs) | 131 if (tabs) |
132 tabs->swap(tabs1); | 132 tabs->swap(tabs1); |
133 return meta; | 133 return meta; |
134 } | 134 } |
135 | 135 |
136 } // namespace browser_sync | 136 } // namespace browser_sync |
OLD | NEW |