Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(276)

Side by Side Diff: chrome/browser/sync/glue/session_sync_test_helper.cc

Issue 672083002: Refactoring of SessionService to get componentized. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing windows compile problem Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/sessions/session_types.cc ('k') | chrome/browser/sync/sessions/sessions_sync_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698