| OLD | NEW |
| 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/location.h" | 12 #include "base/location.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/message_loop.h" | 14 #include "base/message_loop.h" |
| 15 #include "base/scoped_temp_dir.h" | 15 #include "base/scoped_temp_dir.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 "chrome/browser/sessions/session_types_test_helper.h" |
| 18 #include "chrome/browser/signin/signin_manager.h" | 19 #include "chrome/browser/signin/signin_manager.h" |
| 19 #include "chrome/browser/signin/signin_manager_factory.h" | 20 #include "chrome/browser/signin/signin_manager_factory.h" |
| 20 #include "chrome/browser/signin/token_service_factory.h" | 21 #include "chrome/browser/signin/token_service_factory.h" |
| 21 #include "chrome/browser/sync/abstract_profile_sync_service_test.h" | 22 #include "chrome/browser/sync/abstract_profile_sync_service_test.h" |
| 22 #include "chrome/browser/sync/glue/session_change_processor.h" | 23 #include "chrome/browser/sync/glue/session_change_processor.h" |
| 23 #include "chrome/browser/sync/glue/session_data_type_controller.h" | 24 #include "chrome/browser/sync/glue/session_data_type_controller.h" |
| 24 #include "chrome/browser/sync/glue/session_model_associator.h" | 25 #include "chrome/browser/sync/glue/session_model_associator.h" |
| 25 #include "chrome/browser/sync/glue/sync_backend_host.h" | 26 #include "chrome/browser/sync/glue/sync_backend_host.h" |
| 26 #include "chrome/browser/sync/profile_sync_components_factory_mock.h" | 27 #include "chrome/browser/sync/profile_sync_components_factory_mock.h" |
| 27 #include "chrome/browser/sync/profile_sync_service_factory.h" | 28 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 tab_iter != (*win_iter).end(); ++tab_iter, ++j) { | 133 tab_iter != (*win_iter).end(); ++tab_iter, ++j) { |
| 133 SessionTab* tab = win_ptr->tabs[j]; | 134 SessionTab* tab = win_ptr->tabs[j]; |
| 134 ASSERT_EQ(*tab_iter, tab->tab_id.id()); | 135 ASSERT_EQ(*tab_iter, tab->tab_id.id()); |
| 135 ASSERT_EQ(1U, tab->navigations.size()); | 136 ASSERT_EQ(1U, tab->navigations.size()); |
| 136 ASSERT_EQ(1, tab->tab_visual_index); | 137 ASSERT_EQ(1, tab->tab_visual_index); |
| 137 ASSERT_EQ(0, tab->current_navigation_index); | 138 ASSERT_EQ(0, tab->current_navigation_index); |
| 138 ASSERT_TRUE(tab->pinned); | 139 ASSERT_TRUE(tab->pinned); |
| 139 ASSERT_EQ("app_id", tab->extension_app_id); | 140 ASSERT_EQ("app_id", tab->extension_app_id); |
| 140 ASSERT_EQ(1U, tab->navigations.size()); | 141 ASSERT_EQ(1U, tab->navigations.size()); |
| 141 ASSERT_EQ(tab->navigations[0].virtual_url(), GURL("http://foo/1")); | 142 ASSERT_EQ(tab->navigations[0].virtual_url(), GURL("http://foo/1")); |
| 142 ASSERT_EQ(tab->navigations[0].referrer().url, GURL("referrer")); | 143 ASSERT_EQ(SessionTypesTestHelper::GetReferrer(tab->navigations[0]).url, |
| 144 GURL("referrer")); |
| 143 ASSERT_EQ(tab->navigations[0].title(), string16(ASCIIToUTF16("title"))); | 145 ASSERT_EQ(tab->navigations[0].title(), string16(ASCIIToUTF16("title"))); |
| 144 ASSERT_EQ(tab->navigations[0].transition(), | 146 ASSERT_EQ(SessionTypesTestHelper::GetTransitionType(tab->navigations[0]), |
| 145 content::PAGE_TRANSITION_TYPED); | 147 content::PAGE_TRANSITION_TYPED); |
| 146 } | 148 } |
| 147 } | 149 } |
| 148 } | 150 } |
| 149 | 151 |
| 150 } // namespace | 152 } // namespace |
| 151 | 153 |
| 152 class ProfileSyncServiceSessionTest | 154 class ProfileSyncServiceSessionTest |
| 153 : public BrowserWithTestWindowTest, | 155 : public BrowserWithTestWindowTest, |
| 154 public content::NotificationObserver { | 156 public content::NotificationObserver { |
| (...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1195 sync_pb::SessionSpecifics specifics; | 1197 sync_pb::SessionSpecifics specifics; |
| 1196 header.SetSessionSpecifics(specifics); | 1198 header.SetSessionSpecifics(specifics); |
| 1197 } | 1199 } |
| 1198 // Ensure we associate properly despite the pre-existing node with our local | 1200 // Ensure we associate properly despite the pre-existing node with our local |
| 1199 // tag. | 1201 // tag. |
| 1200 error = model_associator_->AssociateModels(); | 1202 error = model_associator_->AssociateModels(); |
| 1201 ASSERT_FALSE(error.IsSet()); | 1203 ASSERT_FALSE(error.IsSet()); |
| 1202 } | 1204 } |
| 1203 | 1205 |
| 1204 } // namespace browser_sync | 1206 } // namespace browser_sync |
| OLD | NEW |