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

Side by Side Diff: chrome/browser/ui/webui/settings/people_handler_unittest.cc

Issue 2097533003: Settings People Revamp: Fix CloseUI CRASH from unusual signin flow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: enhance a test Created 4 years, 6 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
« no previous file with comments | « chrome/browser/ui/webui/settings/people_handler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 content::TestWebUI web_ui_; 310 content::TestWebUI web_ui_;
311 std::unique_ptr<TestingPeopleHandler> handler_; 311 std::unique_ptr<TestingPeopleHandler> handler_;
312 }; 312 };
313 313
314 class PeopleHandlerFirstSigninTest : public PeopleHandlerTest { 314 class PeopleHandlerFirstSigninTest : public PeopleHandlerTest {
315 std::string GetTestUser() override { return std::string(); } 315 std::string GetTestUser() override { return std::string(); }
316 }; 316 };
317 317
318 #if !defined(OS_CHROMEOS) 318 #if !defined(OS_CHROMEOS)
319 TEST_F(PeopleHandlerFirstSigninTest, DisplayBasicLogin) { 319 TEST_F(PeopleHandlerFirstSigninTest, DisplayBasicLogin) {
320 // Test that the HandleStartSignin call enables JavaScript.
321 handler_->DisallowJavascript();
322
320 EXPECT_CALL(*mock_pss_, CanSyncStart()).WillRepeatedly(Return(false)); 323 EXPECT_CALL(*mock_pss_, CanSyncStart()).WillRepeatedly(Return(false));
321 EXPECT_CALL(*mock_pss_, IsFirstSetupComplete()).WillRepeatedly(Return(false)); 324 EXPECT_CALL(*mock_pss_, IsFirstSetupComplete()).WillRepeatedly(Return(false));
322 // Ensure that the user is not signed in before calling |HandleStartSignin()|. 325 // Ensure that the user is not signed in before calling |HandleStartSignin()|.
323 SigninManager* manager = static_cast<SigninManager*>(mock_signin_); 326 SigninManager* manager = static_cast<SigninManager*>(mock_signin_);
324 manager->SignOut(signin_metrics::SIGNOUT_TEST, 327 manager->SignOut(signin_metrics::SIGNOUT_TEST,
325 signin_metrics::SignoutDelete::IGNORE_METRIC); 328 signin_metrics::SignoutDelete::IGNORE_METRIC);
326 base::ListValue list_args; 329 base::ListValue list_args;
327 handler_->HandleStartSignin(&list_args); 330 handler_->HandleStartSignin(&list_args);
328 331
329 // Sync setup hands off control to the gaia login tab. 332 // Sync setup hands off control to the gaia login tab.
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
904 SetupInitializedProfileSyncService(); 907 SetupInitializedProfileSyncService();
905 EXPECT_CALL(*mock_pss_, IsEncryptEverythingAllowed()) 908 EXPECT_CALL(*mock_pss_, IsEncryptEverythingAllowed())
906 .WillRepeatedly(Return(false)); 909 .WillRepeatedly(Return(false));
907 EXPECT_CALL(*mock_pss_, EnableEncryptEverything()).Times(0); 910 EXPECT_CALL(*mock_pss_, EnableEncryptEverything()).Times(0);
908 handler_->HandleSetEncryption(&list_args); 911 handler_->HandleSetEncryption(&list_args);
909 912
910 ExpectPageStatusResponse(PeopleHandler::kConfigurePageStatus); 913 ExpectPageStatusResponse(PeopleHandler::kConfigurePageStatus);
911 } 914 }
912 915
913 } // namespace settings 916 } // namespace settings
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/settings/people_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698