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

Side by Side Diff: chrome/browser/ui/webui/sync_setup_handler_unittest.cc

Issue 11046008: [Invalidations] Require there to be no registered handlers on Invalidator destruction (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync to HEAD Created 8 years, 2 months 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/sync/profile_sync_service_unittest.cc ('k') | sync/notifier/invalidator.h » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/webui/sync_setup_handler.h" 5 #include "chrome/browser/ui/webui/sync_setup_handler.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 class SyncSetupHandlerTest : public testing::Test { 354 class SyncSetupHandlerTest : public testing::Test {
355 public: 355 public:
356 SyncSetupHandlerTest() : error_(GoogleServiceAuthError::NONE) {} 356 SyncSetupHandlerTest() : error_(GoogleServiceAuthError::NONE) {}
357 virtual void SetUp() OVERRIDE { 357 virtual void SetUp() OVERRIDE {
358 error_ = GoogleServiceAuthError::None(); 358 error_ = GoogleServiceAuthError::None();
359 profile_.reset(ProfileSyncServiceMock::MakeSignedInTestingProfile()); 359 profile_.reset(ProfileSyncServiceMock::MakeSignedInTestingProfile());
360 mock_pss_ = static_cast<ProfileSyncServiceMock*>( 360 mock_pss_ = static_cast<ProfileSyncServiceMock*>(
361 ProfileSyncServiceFactory::GetInstance()->SetTestingFactoryAndUse( 361 ProfileSyncServiceFactory::GetInstance()->SetTestingFactoryAndUse(
362 profile_.get(), 362 profile_.get(),
363 ProfileSyncServiceMock::BuildMockProfileSyncService)); 363 ProfileSyncServiceMock::BuildMockProfileSyncService));
364 mock_pss_->Initialize();
364 mock_signin_ = static_cast<SigninManagerMock*>( 365 mock_signin_ = static_cast<SigninManagerMock*>(
365 SigninManagerFactory::GetInstance()->SetTestingFactoryAndUse( 366 SigninManagerFactory::GetInstance()->SetTestingFactoryAndUse(
366 profile_.get(), BuildSigninManagerMock)); 367 profile_.get(), BuildSigninManagerMock));
367 handler_.reset(new TestingSyncSetupHandler(&web_ui_, profile_.get())); 368 handler_.reset(new TestingSyncSetupHandler(&web_ui_, profile_.get()));
368 } 369 }
369 370
370 // Setup the expectations for calls made when displaying the config page. 371 // Setup the expectations for calls made when displaying the config page.
371 void SetDefaultExpectationsForConfigPage() { 372 void SetDefaultExpectationsForConfigPage() {
372 EXPECT_CALL(*mock_pss_, GetRegisteredDataTypes()). 373 EXPECT_CALL(*mock_pss_, GetRegisteredDataTypes()).
373 WillRepeatedly(Return(GetAllTypes())); 374 WillRepeatedly(Return(GetAllTypes()));
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after
1139 DictionaryValue* dictionary; 1140 DictionaryValue* dictionary;
1140 ASSERT_TRUE(data.arg2->GetAsDictionary(&dictionary)); 1141 ASSERT_TRUE(data.arg2->GetAsDictionary(&dictionary));
1141 std::string err = l10n_util::GetStringUTF8(IDS_SYNC_LOGIN_NAME_PROHIBITED); 1142 std::string err = l10n_util::GetStringUTF8(IDS_SYNC_LOGIN_NAME_PROHIBITED);
1142 CheckShowSyncSetupArgs( 1143 CheckShowSyncSetupArgs(
1143 dictionary, err, false, GoogleServiceAuthError::NONE, "", true, ""); 1144 dictionary, err, false, GoogleServiceAuthError::NONE, "", true, "");
1144 handler_->CloseSyncSetup(); 1145 handler_->CloseSyncSetup();
1145 EXPECT_EQ(NULL, 1146 EXPECT_EQ(NULL,
1146 LoginUIServiceFactory::GetForProfile( 1147 LoginUIServiceFactory::GetForProfile(
1147 profile_.get())->current_login_ui()); 1148 profile_.get())->current_login_ui());
1148 } 1149 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service_unittest.cc ('k') | sync/notifier/invalidator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698