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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 PathService::Get(chrome::DIR_USER_DATA, &path); | 146 PathService::Get(chrome::DIR_USER_DATA, &path); |
147 path = path.AppendASCII("test_profile"); | 147 path = path.AppendASCII("test_profile"); |
148 if (!base::PathExists(path)) | 148 if (!base::PathExists(path)) |
149 CHECK(base::CreateDirectory(path)); | 149 CHECK(base::CreateDirectory(path)); |
150 Profile* profile = | 150 Profile* profile = |
151 Profile::CreateProfile(path, NULL, Profile::CREATE_MODE_SYNCHRONOUS); | 151 Profile::CreateProfile(path, NULL, Profile::CREATE_MODE_SYNCHRONOUS); |
152 profile_manager->RegisterTestingProfile(profile, true, false); | 152 profile_manager->RegisterTestingProfile(profile, true, false); |
153 ProfileSyncServiceMock* service = static_cast<ProfileSyncServiceMock*>( | 153 ProfileSyncServiceMock* service = static_cast<ProfileSyncServiceMock*>( |
154 ProfileSyncServiceFactory::GetInstance()->SetTestingFactoryAndUse( | 154 ProfileSyncServiceFactory::GetInstance()->SetTestingFactoryAndUse( |
155 profile, &ExtensionSessionsTest::BuildProfileSyncService)); | 155 profile, &ExtensionSessionsTest::BuildProfileSyncService)); |
156 browser_ = new Browser(Browser::CreateParams( | 156 browser_ = |
157 profile, chrome::HOST_DESKTOP_TYPE_NATIVE)); | 157 new Browser(Browser::CreateParams(profile, ui::HOST_DESKTOP_TYPE_NATIVE)); |
158 | 158 |
159 syncer::ModelTypeSet preferred_types; | 159 syncer::ModelTypeSet preferred_types; |
160 preferred_types.Put(syncer::SESSIONS); | 160 preferred_types.Put(syncer::SESSIONS); |
161 GoogleServiceAuthError no_error(GoogleServiceAuthError::NONE); | 161 GoogleServiceAuthError no_error(GoogleServiceAuthError::NONE); |
162 ON_CALL(*service, IsDataTypeControllerRunning(syncer::SESSIONS)) | 162 ON_CALL(*service, IsDataTypeControllerRunning(syncer::SESSIONS)) |
163 .WillByDefault(testing::Return(true)); | 163 .WillByDefault(testing::Return(true)); |
164 ON_CALL(*service, GetRegisteredDataTypes()) | 164 ON_CALL(*service, GetRegisteredDataTypes()) |
165 .WillByDefault(testing::Return(syncer::UserTypes())); | 165 .WillByDefault(testing::Return(syncer::UserTypes())); |
166 ON_CALL(*service, GetPreferredDataTypes()).WillByDefault( | 166 ON_CALL(*service, GetPreferredDataTypes()).WillByDefault( |
167 testing::Return(preferred_types)); | 167 testing::Return(preferred_types)); |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 return; | 384 return; |
385 #endif | 385 #endif |
386 | 386 |
387 ASSERT_TRUE(RunExtensionSubtest("sessions", | 387 ASSERT_TRUE(RunExtensionSubtest("sessions", |
388 "sessions.html")) << message_; | 388 "sessions.html")) << message_; |
389 } | 389 } |
390 | 390 |
391 } // namespace | 391 } // namespace |
392 | 392 |
393 } // namespace extensions | 393 } // namespace extensions |
OLD | NEW |