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

Side by Side Diff: chrome/browser/sync/profile_sync_service_session_unittest.cc

Issue 14497003: Moves TabNavigation into components/sessions and renames (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Really remove webkit_support Created 7 years, 7 months 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <map> 5 #include <map>
6 #include <string> 6 #include <string>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/files/scoped_temp_dir.h" 12 #include "base/files/scoped_temp_dir.h"
13 #include "base/location.h" 13 #include "base/location.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/message_loop.h" 15 #include "base/message_loop.h"
16 #include "base/stl_util.h" 16 #include "base/stl_util.h"
17 #include "base/time.h" 17 #include "base/time.h"
18 #include "base/utf_string_conversions.h" 18 #include "base/utf_string_conversions.h"
19 #include "chrome/browser/sessions/session_types_test_helper.h"
20 #include "chrome/browser/signin/signin_manager.h" 19 #include "chrome/browser/signin/signin_manager.h"
21 #include "chrome/browser/signin/signin_manager_factory.h" 20 #include "chrome/browser/signin/signin_manager_factory.h"
22 #include "chrome/browser/signin/token_service_factory.h" 21 #include "chrome/browser/signin/token_service_factory.h"
23 #include "chrome/browser/sync/abstract_profile_sync_service_test.h" 22 #include "chrome/browser/sync/abstract_profile_sync_service_test.h"
24 #include "chrome/browser/sync/glue/device_info.h" 23 #include "chrome/browser/sync/glue/device_info.h"
25 #include "chrome/browser/sync/glue/session_change_processor.h" 24 #include "chrome/browser/sync/glue/session_change_processor.h"
26 #include "chrome/browser/sync/glue/session_data_type_controller.h" 25 #include "chrome/browser/sync/glue/session_data_type_controller.h"
27 #include "chrome/browser/sync/glue/session_model_associator.h" 26 #include "chrome/browser/sync/glue/session_model_associator.h"
28 #include "chrome/browser/sync/glue/sync_backend_host.h" 27 #include "chrome/browser/sync/glue/sync_backend_host.h"
29 #include "chrome/browser/sync/glue/synced_device_tracker.h" 28 #include "chrome/browser/sync/glue/synced_device_tracker.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 tab_iter != (*win_iter).end(); ++tab_iter, ++j) { 159 tab_iter != (*win_iter).end(); ++tab_iter, ++j) {
161 SessionTab* tab = win_ptr->tabs[j]; 160 SessionTab* tab = win_ptr->tabs[j];
162 ASSERT_EQ(*tab_iter, tab->tab_id.id()); 161 ASSERT_EQ(*tab_iter, tab->tab_id.id());
163 ASSERT_EQ(1U, tab->navigations.size()); 162 ASSERT_EQ(1U, tab->navigations.size());
164 ASSERT_EQ(1, tab->tab_visual_index); 163 ASSERT_EQ(1, tab->tab_visual_index);
165 ASSERT_EQ(0, tab->current_navigation_index); 164 ASSERT_EQ(0, tab->current_navigation_index);
166 ASSERT_TRUE(tab->pinned); 165 ASSERT_TRUE(tab->pinned);
167 ASSERT_EQ("app_id", tab->extension_app_id); 166 ASSERT_EQ("app_id", tab->extension_app_id);
168 ASSERT_EQ(1U, tab->navigations.size()); 167 ASSERT_EQ(1U, tab->navigations.size());
169 ASSERT_EQ(tab->navigations[0].virtual_url(), GURL("http://foo/1")); 168 ASSERT_EQ(tab->navigations[0].virtual_url(), GURL("http://foo/1"));
170 ASSERT_EQ(SessionTypesTestHelper::GetReferrer(tab->navigations[0]).url, 169 ASSERT_EQ(tab->navigations[0].referrer().url, GURL("referrer"));
171 GURL("referrer"));
172 ASSERT_EQ(tab->navigations[0].title(), string16(ASCIIToUTF16("title"))); 170 ASSERT_EQ(tab->navigations[0].title(), string16(ASCIIToUTF16("title")));
173 ASSERT_EQ(SessionTypesTestHelper::GetTransitionType(tab->navigations[0]), 171 ASSERT_EQ(tab->navigations[0].transition_type(),
174 content::PAGE_TRANSITION_TYPED); 172 content::PAGE_TRANSITION_TYPED);
175 } 173 }
176 } 174 }
177 } 175 }
178 176
179 bool CompareMemoryToString( 177 bool CompareMemoryToString(
180 const std::string& str, 178 const std::string& str,
181 const scoped_refptr<base::RefCountedMemory>& mem) { 179 const scoped_refptr<base::RefCountedMemory>& mem) {
182 if (mem->size() != str.size()) 180 if (mem->size() != str.size())
183 return false; 181 return false;
(...skipping 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after
1247 sync_pb::SessionSpecifics specifics; 1245 sync_pb::SessionSpecifics specifics;
1248 header.SetSessionSpecifics(specifics); 1246 header.SetSessionSpecifics(specifics);
1249 } 1247 }
1250 // Ensure we associate properly despite the pre-existing node with our local 1248 // Ensure we associate properly despite the pre-existing node with our local
1251 // tag. 1249 // tag.
1252 error = model_associator_->AssociateModels(NULL, NULL); 1250 error = model_associator_->AssociateModels(NULL, NULL);
1253 ASSERT_FALSE(error.IsSet()); 1251 ASSERT_FALSE(error.IsSet());
1254 } 1252 }
1255 1253
1256 } // namespace browser_sync 1254 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/synced_session_tracker_unittest.cc ('k') | chrome/browser/sync/test/integration/sessions_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698