Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(671)

Side by Side Diff: chrome/browser/extensions/api/sessions/sessions_apitest.cc

Issue 2504433002: [Sync] Return nullptr for OpenTabsUIDelegate when PROXY_TABS is disabled. (Closed)
Patch Set: Gave test case an appropriate name. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/browser_sync/profile_sync_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 if (!base::PathExists(path)) 210 if (!base::PathExists(path))
211 CHECK(base::CreateDirectory(path)); 211 CHECK(base::CreateDirectory(path));
212 Profile* profile = 212 Profile* profile =
213 Profile::CreateProfile(path, NULL, Profile::CREATE_MODE_SYNCHRONOUS); 213 Profile::CreateProfile(path, NULL, Profile::CREATE_MODE_SYNCHRONOUS);
214 profile_manager->RegisterTestingProfile(profile, true, false); 214 profile_manager->RegisterTestingProfile(profile, true, false);
215 browser_sync::ProfileSyncServiceMock* service = 215 browser_sync::ProfileSyncServiceMock* service =
216 static_cast<browser_sync::ProfileSyncServiceMock*>( 216 static_cast<browser_sync::ProfileSyncServiceMock*>(
217 ProfileSyncServiceFactory::GetInstance()->SetTestingFactoryAndUse( 217 ProfileSyncServiceFactory::GetInstance()->SetTestingFactoryAndUse(
218 profile, &ExtensionSessionsTest::BuildProfileSyncService)); 218 profile, &ExtensionSessionsTest::BuildProfileSyncService));
219 219
220 syncer::ModelTypeSet preferred_types; 220 syncer::ModelTypeSet preferred_types(syncer::SESSIONS, syncer::PROXY_TABS);
221 preferred_types.Put(syncer::SESSIONS);
222 GoogleServiceAuthError no_error(GoogleServiceAuthError::NONE); 221 GoogleServiceAuthError no_error(GoogleServiceAuthError::NONE);
223 ON_CALL(*service, IsDataTypeControllerRunning(syncer::SESSIONS)) 222 ON_CALL(*service, IsDataTypeControllerRunning(syncer::SESSIONS))
224 .WillByDefault(testing::Return(true)); 223 .WillByDefault(testing::Return(true));
224 ON_CALL(*service, IsDataTypeControllerRunning(syncer::PROXY_TABS))
225 .WillByDefault(testing::Return(true));
225 ON_CALL(*service, GetRegisteredDataTypes()) 226 ON_CALL(*service, GetRegisteredDataTypes())
226 .WillByDefault(testing::Return(syncer::UserTypes())); 227 .WillByDefault(testing::Return(syncer::UserTypes()));
227 ON_CALL(*service, GetPreferredDataTypes()).WillByDefault( 228 ON_CALL(*service, GetPreferredDataTypes()).WillByDefault(
228 testing::Return(preferred_types)); 229 testing::Return(preferred_types));
229 EXPECT_CALL(*service, GetAuthError()).WillRepeatedly( 230 EXPECT_CALL(*service, GetAuthError()).WillRepeatedly(
230 testing::ReturnRef(no_error)); 231 testing::ReturnRef(no_error));
231 ON_CALL(*service, GetActiveDataTypes()).WillByDefault( 232 ON_CALL(*service, GetActiveDataTypes()).WillByDefault(
232 testing::Return(preferred_types)); 233 testing::Return(preferred_types));
233 234
234 EXPECT_CALL(*service, AddObserver(testing::_)).Times(testing::AnyNumber()); 235 EXPECT_CALL(*service, AddObserver(testing::_)).Times(testing::AnyNumber());
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 EXPECT_EQ(0u, sessions->GetSize()); 380 EXPECT_EQ(0u, sessions->GetSize());
380 } 381 }
381 382
382 // http://crbug.com/251199 383 // http://crbug.com/251199
383 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_SessionsApis) { 384 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_SessionsApis) {
384 ASSERT_TRUE(RunExtensionSubtest("sessions", 385 ASSERT_TRUE(RunExtensionSubtest("sessions",
385 "sessions.html")) << message_; 386 "sessions.html")) << message_;
386 } 387 }
387 388
388 } // namespace extensions 389 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | components/browser_sync/profile_sync_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698