| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/settings/people_handler.h" | 5 #include "chrome/browser/ui/webui/settings/people_handler.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 ON_CALL(*mock_pss_, GetPassphraseType()).WillByDefault( | 213 ON_CALL(*mock_pss_, GetPassphraseType()).WillByDefault( |
| 214 Return(syncer::IMPLICIT_PASSPHRASE)); | 214 Return(syncer::IMPLICIT_PASSPHRASE)); |
| 215 ON_CALL(*mock_pss_, GetExplicitPassphraseTime()).WillByDefault( | 215 ON_CALL(*mock_pss_, GetExplicitPassphraseTime()).WillByDefault( |
| 216 Return(base::Time())); | 216 Return(base::Time())); |
| 217 ON_CALL(*mock_pss_, GetRegisteredDataTypes()) | 217 ON_CALL(*mock_pss_, GetRegisteredDataTypes()) |
| 218 .WillByDefault(Return(syncer::ModelTypeSet())); | 218 .WillByDefault(Return(syncer::ModelTypeSet())); |
| 219 | 219 |
| 220 mock_pss_->Initialize(); | 220 mock_pss_->Initialize(); |
| 221 | 221 |
| 222 handler_.reset(new TestingPeopleHandler(&web_ui_, profile_)); | 222 handler_.reset(new TestingPeopleHandler(&web_ui_, profile_)); |
| 223 handler_->AllowJavascript(); |
| 223 } | 224 } |
| 224 | 225 |
| 225 // Setup the expectations for calls made when displaying the config page. | 226 // Setup the expectations for calls made when displaying the config page. |
| 226 void SetDefaultExpectationsForConfigPage() { | 227 void SetDefaultExpectationsForConfigPage() { |
| 227 EXPECT_CALL(*mock_pss_, CanSyncStart()).WillRepeatedly(Return(true)); | 228 EXPECT_CALL(*mock_pss_, CanSyncStart()).WillRepeatedly(Return(true)); |
| 228 EXPECT_CALL(*mock_pss_, GetRegisteredDataTypes()) | 229 EXPECT_CALL(*mock_pss_, GetRegisteredDataTypes()) |
| 229 .WillRepeatedly(Return(GetAllTypes())); | 230 .WillRepeatedly(Return(GetAllTypes())); |
| 230 EXPECT_CALL(*mock_pss_, GetPreferredDataTypes()) | 231 EXPECT_CALL(*mock_pss_, GetPreferredDataTypes()) |
| 231 .WillRepeatedly(Return(GetAllTypes())); | 232 .WillRepeatedly(Return(GetAllTypes())); |
| 232 EXPECT_CALL(*mock_pss_, GetActiveDataTypes()) | 233 EXPECT_CALL(*mock_pss_, GetActiveDataTypes()) |
| (...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 951 SetupInitializedProfileSyncService(); | 952 SetupInitializedProfileSyncService(); |
| 952 EXPECT_CALL(*mock_pss_, IsEncryptEverythingAllowed()) | 953 EXPECT_CALL(*mock_pss_, IsEncryptEverythingAllowed()) |
| 953 .WillRepeatedly(Return(false)); | 954 .WillRepeatedly(Return(false)); |
| 954 EXPECT_CALL(*mock_pss_, EnableEncryptEverything()).Times(0); | 955 EXPECT_CALL(*mock_pss_, EnableEncryptEverything()).Times(0); |
| 955 handler_->HandleSetEncryption(&list_args); | 956 handler_->HandleSetEncryption(&list_args); |
| 956 | 957 |
| 957 ExpectPageStatusResponse(PeopleHandler::kConfigurePageStatus); | 958 ExpectPageStatusResponse(PeopleHandler::kConfigurePageStatus); |
| 958 } | 959 } |
| 959 | 960 |
| 960 } // namespace settings | 961 } // namespace settings |
| OLD | NEW |