| 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/pattern.h" | 9 #include "base/strings/pattern.h" | 
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" | 
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 130   factory->SetLocalDeviceInfoProvider( | 130   factory->SetLocalDeviceInfoProvider( | 
| 131       scoped_ptr<sync_driver::LocalDeviceInfoProvider>( | 131       scoped_ptr<sync_driver::LocalDeviceInfoProvider>( | 
| 132           new sync_driver::LocalDeviceInfoProviderMock( | 132           new sync_driver::LocalDeviceInfoProviderMock( | 
| 133               kSessionTags[0], | 133               kSessionTags[0], | 
| 134               "machine name", | 134               "machine name", | 
| 135               "Chromium 10k", | 135               "Chromium 10k", | 
| 136               "Chrome 10k", | 136               "Chrome 10k", | 
| 137               sync_pb::SyncEnums_DeviceType_TYPE_LINUX, | 137               sync_pb::SyncEnums_DeviceType_TYPE_LINUX, | 
| 138               "device_id"))); | 138               "device_id"))); | 
| 139 | 139 | 
| 140   return make_scoped_ptr(new ProfileSyncServiceMock( | 140   Profile* profile = static_cast<Profile*>(context); | 
| 141       make_scoped_ptr(new browser_sync::ChromeSyncClient( | 141   ProfileSyncServiceMock* sync_service = new ProfileSyncServiceMock( | 
| 142           static_cast<Profile*>(context), factory.Pass())), | 142       make_scoped_ptr(new browser_sync::ChromeSyncClient(profile)), profile); | 
| 143       static_cast<Profile*>(context))); | 143   static_cast<browser_sync::ChromeSyncClient*>(sync_service->GetSyncClient()) | 
|  | 144       ->SetSyncApiComponentFactoryForTesting( | 
|  | 145           make_scoped_ptr(new SyncApiComponentFactoryMock())); | 
|  | 146   return make_scoped_ptr(sync_service); | 
| 144 } | 147 } | 
| 145 | 148 | 
| 146 void ExtensionSessionsTest::CreateTestProfileSyncService() { | 149 void ExtensionSessionsTest::CreateTestProfileSyncService() { | 
| 147   ProfileManager* profile_manager = g_browser_process->profile_manager(); | 150   ProfileManager* profile_manager = g_browser_process->profile_manager(); | 
| 148   base::FilePath path; | 151   base::FilePath path; | 
| 149   PathService::Get(chrome::DIR_USER_DATA, &path); | 152   PathService::Get(chrome::DIR_USER_DATA, &path); | 
| 150   path = path.AppendASCII("test_profile"); | 153   path = path.AppendASCII("test_profile"); | 
| 151   if (!base::PathExists(path)) | 154   if (!base::PathExists(path)) | 
| 152     CHECK(base::CreateDirectory(path)); | 155     CHECK(base::CreateDirectory(path)); | 
| 153   Profile* profile = | 156   Profile* profile = | 
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 387     return; | 390     return; | 
| 388 #endif | 391 #endif | 
| 389 | 392 | 
| 390   ASSERT_TRUE(RunExtensionSubtest("sessions", | 393   ASSERT_TRUE(RunExtensionSubtest("sessions", | 
| 391                                   "sessions.html")) << message_; | 394                                   "sessions.html")) << message_; | 
| 392 } | 395 } | 
| 393 | 396 | 
| 394 }  // namespace | 397 }  // namespace | 
| 395 | 398 | 
| 396 }  // namespace extensions | 399 }  // namespace extensions | 
| OLD | NEW | 
|---|