Chromium Code Reviews| 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 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 514 } | 514 } | 
| 515 | 515 | 
| 516 handler_->CloseSyncSetup(); | 516 handler_->CloseSyncSetup(); | 
| 517 EXPECT_EQ(NULL, | 517 EXPECT_EQ(NULL, | 
| 518 LoginUIServiceFactory::GetForProfile( | 518 LoginUIServiceFactory::GetForProfile( | 
| 519 profile_.get())->current_login_ui()); | 519 profile_.get())->current_login_ui()); | 
| 520 } | 520 } | 
| 521 | 521 | 
| 522 // Verifies that the handler correctly handles a cancellation when | 522 // Verifies that the handler correctly handles a cancellation when | 
| 523 // it is displaying the spinner to the user. | 523 // it is displaying the spinner to the user. | 
| 524 TEST_P(SyncSetupHandlerTest, DisplayConfigureWithBackendDisabledAndCancel) { | 524 TEST_P(SyncSetupHandlerTest, | 
| 525 DISABLED_DisplayConfigureWithBackendDisabledAndCancel) { | |
| 525 EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn()) | 526 EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn()) | 
| 526 .WillRepeatedly(Return(true)); | 527 .WillRepeatedly(Return(true)); | 
| 527 EXPECT_CALL(*mock_pss_, IsSyncTokenAvailable()) | 528 EXPECT_CALL(*mock_pss_, IsSyncTokenAvailable()) | 
| 528 .WillRepeatedly(Return(true)); | 529 .WillRepeatedly(Return(true)); | 
| 529 EXPECT_CALL(*mock_pss_, HasSyncSetupCompleted()) | 530 EXPECT_CALL(*mock_pss_, HasSyncSetupCompleted()) | 
| 530 .WillRepeatedly(Return(false)); | 531 .WillRepeatedly(Return(false)); | 
| 531 error_ = GoogleServiceAuthError::None(); | 532 error_ = GoogleServiceAuthError::None(); | 
| 532 EXPECT_CALL(*mock_pss_, GetAuthError()).WillRepeatedly(ReturnRef(error_)); | 533 EXPECT_CALL(*mock_pss_, GetAuthError()).WillRepeatedly(ReturnRef(error_)); | 
| 533 EXPECT_CALL(*mock_pss_, sync_initialized()).WillRepeatedly(Return(false)); | 534 EXPECT_CALL(*mock_pss_, sync_initialized()).WillRepeatedly(Return(false)); | 
| 534 | 535 | 
| (...skipping 15 matching lines...) Expand all Loading... | |
| 550 // Cancelling the spinner dialog will cause CloseSyncSetup(). | 551 // Cancelling the spinner dialog will cause CloseSyncSetup(). | 
| 551 handler_->CloseSyncSetup(); | 552 handler_->CloseSyncSetup(); | 
| 552 EXPECT_EQ(NULL, | 553 EXPECT_EQ(NULL, | 
| 553 LoginUIServiceFactory::GetForProfile( | 554 LoginUIServiceFactory::GetForProfile( | 
| 554 profile_.get())->current_login_ui()); | 555 profile_.get())->current_login_ui()); | 
| 555 } | 556 } | 
| 556 | 557 | 
| 557 // Verifies that the handler correctly transitions from showing the spinner | 558 // Verifies that the handler correctly transitions from showing the spinner | 
| 558 // to showing a configuration page when signin completes successfully. | 559 // to showing a configuration page when signin completes successfully. | 
| 559 TEST_P(SyncSetupHandlerTest, | 560 TEST_P(SyncSetupHandlerTest, | 
| 560 DisplayConfigureWithBackendDisabledAndSigninSuccess) { | 561 DISABLED_DisplayConfigureWithBackendDisabledAndSigninSuccess) { | 
| 
 
Roger Tawa OOO till Jul 10th
2013/01/09 15:03:23
Instead of always disabling this test, you should
 
James Hawkins
2013/01/09 18:27:47
Yeah, I can't LG adding a disabled test.
 
 | |
| 561 EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn()) | 562 EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn()) | 
| 562 .WillRepeatedly(Return(true)); | 563 .WillRepeatedly(Return(true)); | 
| 563 EXPECT_CALL(*mock_pss_, IsSyncTokenAvailable()) | 564 EXPECT_CALL(*mock_pss_, IsSyncTokenAvailable()) | 
| 564 .WillRepeatedly(Return(true)); | 565 .WillRepeatedly(Return(true)); | 
| 565 EXPECT_CALL(*mock_pss_, HasSyncSetupCompleted()) | 566 EXPECT_CALL(*mock_pss_, HasSyncSetupCompleted()) | 
| 566 .WillRepeatedly(Return(false)); | 567 .WillRepeatedly(Return(false)); | 
| 567 error_ = GoogleServiceAuthError::None(); | 568 error_ = GoogleServiceAuthError::None(); | 
| 568 EXPECT_CALL(*mock_pss_, GetAuthError()).WillRepeatedly(ReturnRef(error_)); | 569 EXPECT_CALL(*mock_pss_, GetAuthError()).WillRepeatedly(ReturnRef(error_)); | 
| 569 // Sync backend is stopped initially, and will start up. | 570 // Sync backend is stopped initially, and will start up. | 
| 570 EXPECT_CALL(*mock_pss_, sync_initialized()) | 571 EXPECT_CALL(*mock_pss_, sync_initialized()) | 
| (...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1259 dictionary, err, false, GoogleServiceAuthError::NONE, "", true, ""); | 1260 dictionary, err, false, GoogleServiceAuthError::NONE, "", true, ""); | 
| 1260 handler_->CloseSyncSetup(); | 1261 handler_->CloseSyncSetup(); | 
| 1261 EXPECT_EQ(NULL, | 1262 EXPECT_EQ(NULL, | 
| 1262 LoginUIServiceFactory::GetForProfile( | 1263 LoginUIServiceFactory::GetForProfile( | 
| 1263 profile_.get())->current_login_ui()); | 1264 profile_.get())->current_login_ui()); | 
| 1264 } | 1265 } | 
| 1265 | 1266 | 
| 1266 INSTANTIATE_TEST_CASE_P(SyncSetupHandlerTestWithParam, | 1267 INSTANTIATE_TEST_CASE_P(SyncSetupHandlerTestWithParam, | 
| 1267 SyncSetupHandlerTest, | 1268 SyncSetupHandlerTest, | 
| 1268 Values(true, false)); | 1269 Values(true, false)); | 
| OLD | NEW |