OLD | NEW |
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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 #endif | 371 #endif |
372 handler_.reset(new TestingSyncSetupHandler(&web_ui_, profile_.get())); | 372 handler_.reset(new TestingSyncSetupHandler(&web_ui_, profile_.get())); |
373 } | 373 } |
374 | 374 |
375 // Setup the expectations for calls made when displaying the config page. | 375 // Setup the expectations for calls made when displaying the config page. |
376 void SetDefaultExpectationsForConfigPage() { | 376 void SetDefaultExpectationsForConfigPage() { |
377 EXPECT_CALL(*mock_pss_, GetRegisteredDataTypes()). | 377 EXPECT_CALL(*mock_pss_, GetRegisteredDataTypes()). |
378 WillRepeatedly(Return(GetAllTypes())); | 378 WillRepeatedly(Return(GetAllTypes())); |
379 EXPECT_CALL(*mock_pss_, GetPreferredDataTypes()). | 379 EXPECT_CALL(*mock_pss_, GetPreferredDataTypes()). |
380 WillRepeatedly(Return(GetAllTypes())); | 380 WillRepeatedly(Return(GetAllTypes())); |
| 381 EXPECT_CALL(*mock_pss_, GetActiveDataTypes()). |
| 382 WillRepeatedly(Return(GetAllTypes())); |
381 EXPECT_CALL(*mock_pss_, EncryptEverythingEnabled()). | 383 EXPECT_CALL(*mock_pss_, EncryptEverythingEnabled()). |
382 WillRepeatedly(Return(false)); | 384 WillRepeatedly(Return(false)); |
383 } | 385 } |
384 | 386 |
385 void SetupInitializedProfileSyncService() { | 387 void SetupInitializedProfileSyncService() { |
386 // An initialized ProfileSyncService will have already completed sync setup | 388 // An initialized ProfileSyncService will have already completed sync setup |
387 // and will have an initialized sync backend. | 389 // and will have an initialized sync backend. |
388 if (!mock_signin_->IsInitialized()) { | 390 if (!mock_signin_->IsInitialized()) { |
389 profile_->GetPrefs()->SetString( | 391 profile_->GetPrefs()->SetString( |
390 prefs::kGoogleServicesUsername, kTestUser); | 392 prefs::kGoogleServicesUsername, kTestUser); |
(...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1350 ExpectConfig(); | 1352 ExpectConfig(); |
1351 const TestWebUI::CallData& data = web_ui_.call_data()[0]; | 1353 const TestWebUI::CallData& data = web_ui_.call_data()[0]; |
1352 DictionaryValue* dictionary; | 1354 DictionaryValue* dictionary; |
1353 ASSERT_TRUE(data.arg2->GetAsDictionary(&dictionary)); | 1355 ASSERT_TRUE(data.arg2->GetAsDictionary(&dictionary)); |
1354 CheckBool(dictionary, "encryptAllData", true); | 1356 CheckBool(dictionary, "encryptAllData", true); |
1355 } | 1357 } |
1356 | 1358 |
1357 INSTANTIATE_TEST_CASE_P(SyncSetupHandlerTestWithParam, | 1359 INSTANTIATE_TEST_CASE_P(SyncSetupHandlerTestWithParam, |
1358 SyncSetupHandlerTest, | 1360 SyncSetupHandlerTest, |
1359 Values(true, false)); | 1361 Values(true, false)); |
OLD | NEW |