| 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" | |
| 6 | |
| 7 #include <stddef.h> | 5 #include <stddef.h> |
| 6 #include <utility> |
| 8 | 7 |
| 9 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 10 #include "base/macros.h" | 9 #include "base/macros.h" |
| 11 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| 12 #include "base/strings/pattern.h" | 11 #include "base/strings/pattern.h" |
| 13 #include "base/strings/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
| 14 #include "build/build_config.h" | 13 #include "build/build_config.h" |
| 14 #include "chrome/browser/extensions/api/sessions/sessions_api.h" |
| 15 #include "chrome/browser/extensions/api/tabs/tabs_api.h" | 15 #include "chrome/browser/extensions/api/tabs/tabs_api.h" |
| 16 #include "chrome/browser/extensions/extension_apitest.h" | 16 #include "chrome/browser/extensions/extension_apitest.h" |
| 17 #include "chrome/browser/extensions/extension_function_test_utils.h" | 17 #include "chrome/browser/extensions/extension_function_test_utils.h" |
| 18 #include "chrome/browser/profiles/profile_manager.h" | 18 #include "chrome/browser/profiles/profile_manager.h" |
| 19 #include "chrome/browser/sync/chrome_sync_client.h" | 19 #include "chrome/browser/sync/chrome_sync_client.h" |
| 20 #include "chrome/browser/sync/profile_sync_service_factory.h" | 20 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 21 #include "chrome/browser/sync/profile_sync_test_util.h" | 21 #include "chrome/browser/sync/profile_sync_test_util.h" |
| 22 #include "chrome/common/chrome_paths.h" | 22 #include "chrome/common/chrome_paths.h" |
| 23 #include "chrome/common/chrome_switches.h" | 23 #include "chrome/common/chrome_switches.h" |
| 24 #include "chrome/test/base/in_process_browser_test.h" | 24 #include "chrome/test/base/in_process_browser_test.h" |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 "Chrome 10k", | 141 "Chrome 10k", |
| 142 sync_pb::SyncEnums_DeviceType_TYPE_LINUX, | 142 sync_pb::SyncEnums_DeviceType_TYPE_LINUX, |
| 143 "device_id"))); | 143 "device_id"))); |
| 144 | 144 |
| 145 Profile* profile = static_cast<Profile*>(context); | 145 Profile* profile = static_cast<Profile*>(context); |
| 146 ProfileSyncServiceMock* sync_service = | 146 ProfileSyncServiceMock* sync_service = |
| 147 new ProfileSyncServiceMock(CreateProfileSyncServiceParamsForTest( | 147 new ProfileSyncServiceMock(CreateProfileSyncServiceParamsForTest( |
| 148 make_scoped_ptr(new browser_sync::ChromeSyncClient(profile)), | 148 make_scoped_ptr(new browser_sync::ChromeSyncClient(profile)), |
| 149 profile)); | 149 profile)); |
| 150 static_cast<browser_sync::ChromeSyncClient*>(sync_service->GetSyncClient()) | 150 static_cast<browser_sync::ChromeSyncClient*>(sync_service->GetSyncClient()) |
| 151 ->SetSyncApiComponentFactoryForTesting(factory.Pass()); | 151 ->SetSyncApiComponentFactoryForTesting(std::move(factory)); |
| 152 return make_scoped_ptr(sync_service); | 152 return make_scoped_ptr(sync_service); |
| 153 } | 153 } |
| 154 | 154 |
| 155 void ExtensionSessionsTest::CreateTestProfileSyncService() { | 155 void ExtensionSessionsTest::CreateTestProfileSyncService() { |
| 156 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 156 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
| 157 base::FilePath path; | 157 base::FilePath path; |
| 158 PathService::Get(chrome::DIR_USER_DATA, &path); | 158 PathService::Get(chrome::DIR_USER_DATA, &path); |
| 159 path = path.AppendASCII("test_profile"); | 159 path = path.AppendASCII("test_profile"); |
| 160 if (!base::PathExists(path)) | 160 if (!base::PathExists(path)) |
| 161 CHECK(base::CreateDirectory(path)); | 161 CHECK(base::CreateDirectory(path)); |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 return; | 396 return; |
| 397 #endif | 397 #endif |
| 398 | 398 |
| 399 ASSERT_TRUE(RunExtensionSubtest("sessions", | 399 ASSERT_TRUE(RunExtensionSubtest("sessions", |
| 400 "sessions.html")) << message_; | 400 "sessions.html")) << message_; |
| 401 } | 401 } |
| 402 | 402 |
| 403 } // namespace | 403 } // namespace |
| 404 | 404 |
| 405 } // namespace extensions | 405 } // namespace extensions |
| OLD | NEW |