| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <utility> | 6 #include <utility> |
| 7 | 7 |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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)); |
| 162 Profile* profile = | 162 Profile* profile = |
| 163 Profile::CreateProfile(path, NULL, Profile::CREATE_MODE_SYNCHRONOUS); | 163 Profile::CreateProfile(path, NULL, Profile::CREATE_MODE_SYNCHRONOUS); |
| 164 profile_manager->RegisterTestingProfile(profile, true, false); | 164 profile_manager->RegisterTestingProfile(profile, true, false); |
| 165 ProfileSyncServiceMock* service = static_cast<ProfileSyncServiceMock*>( | 165 ProfileSyncServiceMock* service = static_cast<ProfileSyncServiceMock*>( |
| 166 ProfileSyncServiceFactory::GetInstance()->SetTestingFactoryAndUse( | 166 ProfileSyncServiceFactory::GetInstance()->SetTestingFactoryAndUse( |
| 167 profile, &ExtensionSessionsTest::BuildProfileSyncService)); | 167 profile, &ExtensionSessionsTest::BuildProfileSyncService)); |
| 168 browser_ = new Browser(Browser::CreateParams( | 168 browser_ = new Browser(Browser::CreateParams(profile)); |
| 169 profile, chrome::HOST_DESKTOP_TYPE_NATIVE)); | |
| 170 | 169 |
| 171 syncer::ModelTypeSet preferred_types; | 170 syncer::ModelTypeSet preferred_types; |
| 172 preferred_types.Put(syncer::SESSIONS); | 171 preferred_types.Put(syncer::SESSIONS); |
| 173 GoogleServiceAuthError no_error(GoogleServiceAuthError::NONE); | 172 GoogleServiceAuthError no_error(GoogleServiceAuthError::NONE); |
| 174 ON_CALL(*service, IsDataTypeControllerRunning(syncer::SESSIONS)) | 173 ON_CALL(*service, IsDataTypeControllerRunning(syncer::SESSIONS)) |
| 175 .WillByDefault(testing::Return(true)); | 174 .WillByDefault(testing::Return(true)); |
| 176 ON_CALL(*service, GetRegisteredDataTypes()) | 175 ON_CALL(*service, GetRegisteredDataTypes()) |
| 177 .WillByDefault(testing::Return(syncer::UserTypes())); | 176 .WillByDefault(testing::Return(syncer::UserTypes())); |
| 178 ON_CALL(*service, GetPreferredDataTypes()).WillByDefault( | 177 ON_CALL(*service, GetPreferredDataTypes()).WillByDefault( |
| 179 testing::Return(preferred_types)); | 178 testing::Return(preferred_types)); |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 return; | 395 return; |
| 397 #endif | 396 #endif |
| 398 | 397 |
| 399 ASSERT_TRUE(RunExtensionSubtest("sessions", | 398 ASSERT_TRUE(RunExtensionSubtest("sessions", |
| 400 "sessions.html")) << message_; | 399 "sessions.html")) << message_; |
| 401 } | 400 } |
| 402 | 401 |
| 403 } // namespace | 402 } // namespace |
| 404 | 403 |
| 405 } // namespace extensions | 404 } // namespace extensions |
| OLD | NEW |