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" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 profile_manager->RegisterTestingProfile(profile, true, false); | 151 profile_manager->RegisterTestingProfile(profile, true, false); |
152 ProfileSyncServiceMock* service = static_cast<ProfileSyncServiceMock*>( | 152 ProfileSyncServiceMock* service = static_cast<ProfileSyncServiceMock*>( |
153 ProfileSyncServiceFactory::GetInstance()->SetTestingFactoryAndUse( | 153 ProfileSyncServiceFactory::GetInstance()->SetTestingFactoryAndUse( |
154 profile, &ExtensionSessionsTest::BuildProfileSyncService)); | 154 profile, &ExtensionSessionsTest::BuildProfileSyncService)); |
155 browser_ = new Browser(Browser::CreateParams( | 155 browser_ = new Browser(Browser::CreateParams( |
156 profile, chrome::HOST_DESKTOP_TYPE_NATIVE)); | 156 profile, chrome::HOST_DESKTOP_TYPE_NATIVE)); |
157 | 157 |
158 syncer::ModelTypeSet preferred_types; | 158 syncer::ModelTypeSet preferred_types; |
159 preferred_types.Put(syncer::SESSIONS); | 159 preferred_types.Put(syncer::SESSIONS); |
160 GoogleServiceAuthError no_error(GoogleServiceAuthError::NONE); | 160 GoogleServiceAuthError no_error(GoogleServiceAuthError::NONE); |
161 ON_CALL(*service, IsSessionsDataTypeControllerRunning()) | 161 ON_CALL(*service, IsDataTypeControllerRunning(syncer::SESSIONS)) |
162 .WillByDefault(testing::Return(true)); | 162 .WillByDefault(testing::Return(true)); |
163 ON_CALL(*service, GetRegisteredDataTypes()) | 163 ON_CALL(*service, GetRegisteredDataTypes()) |
164 .WillByDefault(testing::Return(syncer::UserTypes())); | 164 .WillByDefault(testing::Return(syncer::UserTypes())); |
165 ON_CALL(*service, GetPreferredDataTypes()).WillByDefault( | 165 ON_CALL(*service, GetPreferredDataTypes()).WillByDefault( |
166 testing::Return(preferred_types)); | 166 testing::Return(preferred_types)); |
167 EXPECT_CALL(*service, GetAuthError()).WillRepeatedly( | 167 EXPECT_CALL(*service, GetAuthError()).WillRepeatedly( |
168 testing::ReturnRef(no_error)); | 168 testing::ReturnRef(no_error)); |
169 ON_CALL(*service, GetActiveDataTypes()).WillByDefault( | 169 ON_CALL(*service, GetActiveDataTypes()).WillByDefault( |
170 testing::Return(preferred_types)); | 170 testing::Return(preferred_types)); |
171 | 171 |
(...skipping 188 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 |