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/extensions/api/sessions/sessions_api.h" | 5 #include "chrome/browser/extensions/api/sessions/sessions_api.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "chrome/browser/extensions/api/tabs/tabs_api.h" | 10 #include "chrome/browser/extensions/api/tabs/tabs_api.h" |
11 #include "chrome/browser/extensions/extension_apitest.h" | 11 #include "chrome/browser/extensions/extension_apitest.h" |
12 #include "chrome/browser/extensions/extension_function_test_utils.h" | 12 #include "chrome/browser/extensions/extension_function_test_utils.h" |
13 #include "chrome/browser/profiles/profile_manager.h" | 13 #include "chrome/browser/profiles/profile_manager.h" |
14 #include "chrome/browser/sync/glue/local_device_info_provider_mock.h" | |
15 #include "chrome/browser/sync/open_tabs_ui_delegate.h" | 14 #include "chrome/browser/sync/open_tabs_ui_delegate.h" |
16 #include "chrome/browser/sync/profile_sync_components_factory_mock.h" | 15 #include "chrome/browser/sync/profile_sync_components_factory_mock.h" |
17 #include "chrome/browser/sync/profile_sync_service.h" | 16 #include "chrome/browser/sync/profile_sync_service.h" |
18 #include "chrome/browser/sync/profile_sync_service_factory.h" | 17 #include "chrome/browser/sync/profile_sync_service_factory.h" |
19 #include "chrome/browser/sync/profile_sync_service_mock.h" | 18 #include "chrome/browser/sync/profile_sync_service_mock.h" |
20 #include "chrome/common/chrome_paths.h" | 19 #include "chrome/common/chrome_paths.h" |
21 #include "chrome/common/chrome_switches.h" | 20 #include "chrome/common/chrome_switches.h" |
22 #include "chrome/test/base/in_process_browser_test.h" | 21 #include "chrome/test/base/in_process_browser_test.h" |
23 #include "chrome/test/base/test_switches.h" | 22 #include "chrome/test/base/test_switches.h" |
24 #include "chrome/test/base/testing_browser_process.h" | 23 #include "chrome/test/base/testing_browser_process.h" |
| 24 #include "components/sync_driver/local_device_info_provider_mock.h" |
25 #include "sync/api/attachments/attachment_id.h" | 25 #include "sync/api/attachments/attachment_id.h" |
26 #include "sync/api/fake_sync_change_processor.h" | 26 #include "sync/api/fake_sync_change_processor.h" |
27 #include "sync/api/sync_error_factory_mock.h" | 27 #include "sync/api/sync_error_factory_mock.h" |
28 #include "sync/internal_api/public/attachments/attachment_service_proxy_for_test
.h" | 28 #include "sync/internal_api/public/attachments/attachment_service_proxy_for_test
.h" |
29 | 29 |
30 #if defined(OS_CHROMEOS) | 30 #if defined(OS_CHROMEOS) |
31 #include "chromeos/chromeos_switches.h" | 31 #include "chromeos/chromeos_switches.h" |
32 #endif | 32 #endif |
33 | 33 |
34 namespace utils = extension_function_test_utils; | 34 namespace utils = extension_function_test_utils; |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 } | 119 } |
120 | 120 |
121 KeyedService* ExtensionSessionsTest::BuildProfileSyncService( | 121 KeyedService* ExtensionSessionsTest::BuildProfileSyncService( |
122 content::BrowserContext* profile) { | 122 content::BrowserContext* profile) { |
123 | 123 |
124 ProfileSyncComponentsFactoryMock* factory = | 124 ProfileSyncComponentsFactoryMock* factory = |
125 new ProfileSyncComponentsFactoryMock(); | 125 new ProfileSyncComponentsFactoryMock(); |
126 | 126 |
127 factory->SetLocalDeviceInfoProvider( | 127 factory->SetLocalDeviceInfoProvider( |
128 scoped_ptr<sync_driver::LocalDeviceInfoProvider>( | 128 scoped_ptr<sync_driver::LocalDeviceInfoProvider>( |
129 new browser_sync::LocalDeviceInfoProviderMock( | 129 new sync_driver::LocalDeviceInfoProviderMock( |
130 kSessionTags[0], | 130 kSessionTags[0], |
131 "machine name", | 131 "machine name", |
132 "Chromium 10k", | 132 "Chromium 10k", |
133 "Chrome 10k", | 133 "Chrome 10k", |
134 sync_pb::SyncEnums_DeviceType_TYPE_LINUX, | 134 sync_pb::SyncEnums_DeviceType_TYPE_LINUX, |
135 "device_id"))); | 135 "device_id"))); |
136 | 136 |
137 return new ProfileSyncServiceMock( | 137 return new ProfileSyncServiceMock( |
138 scoped_ptr<ProfileSyncComponentsFactory>(factory), | 138 scoped_ptr<ProfileSyncComponentsFactory>(factory), |
139 static_cast<Profile*>(profile)); | 139 static_cast<Profile*>(profile)); |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 // Disable this test in Metro+Ash for now (http://crbug.com/262796). | 360 // Disable this test in Metro+Ash for now (http://crbug.com/262796). |
361 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) | 361 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) |
362 return; | 362 return; |
363 #endif | 363 #endif |
364 | 364 |
365 ASSERT_TRUE(RunExtensionSubtest("sessions", | 365 ASSERT_TRUE(RunExtensionSubtest("sessions", |
366 "sessions.html")) << message_; | 366 "sessions.html")) << message_; |
367 } | 367 } |
368 | 368 |
369 } // namespace extensions | 369 } // namespace extensions |
OLD | NEW |