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 "base/prefs/pref_service.h" | 5 #include "base/prefs/pref_service.h" |
6 #include "base/prefs/scoped_user_pref_update.h" | 6 #include "base/prefs/scoped_user_pref_update.h" |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 signin::SOURCE_UNKNOWN, GURL(), process()->GetID(), | 666 signin::SOURCE_UNKNOWN, GURL(), process()->GetID(), |
667 rvh()->GetRoutingID()); | 667 rvh()->GetRoutingID()); |
668 } | 668 } |
669 | 669 |
670 // Checks that the state of OneClickSigninHelper is cleaned when there is a | 670 // Checks that the state of OneClickSigninHelper is cleaned when there is a |
671 // navigation away from the sign in flow that is not triggered by the | 671 // navigation away from the sign in flow that is not triggered by the |
672 // web contents. | 672 // web contents. |
673 TEST_F(OneClickSigninHelperTest, CleanTransientStateOnNavigate) { | 673 TEST_F(OneClickSigninHelperTest, CleanTransientStateOnNavigate) { |
674 content::WebContents* contents = web_contents(); | 674 content::WebContents* contents = web_contents(); |
675 | 675 |
676 OneClickSigninHelper::CreateForWebContentsWithPasswordManager(contents, NULL); | 676 OneClickSigninHelper::CreateForWebContents(contents); |
677 OneClickSigninHelper* helper = | 677 OneClickSigninHelper* helper = |
678 OneClickSigninHelper::FromWebContents(contents); | 678 OneClickSigninHelper::FromWebContents(contents); |
679 helper->SetDoNotClearPendingEmailForTesting(); | 679 helper->SetDoNotClearPendingEmailForTesting(); |
680 helper->auto_accept_ = OneClickSigninHelper::AUTO_ACCEPT_EXPLICIT; | 680 helper->auto_accept_ = OneClickSigninHelper::AUTO_ACCEPT_EXPLICIT; |
681 | 681 |
682 content::LoadCommittedDetails details; | 682 content::LoadCommittedDetails details; |
683 content::FrameNavigateParams params; | 683 content::FrameNavigateParams params; |
684 params.url = GURL("http://crbug.com"); | 684 params.url = GURL("http://crbug.com"); |
685 params.transition = ui::PAGE_TRANSITION_TYPED; | 685 params.transition = ui::PAGE_TRANSITION_TYPED; |
686 helper->DidNavigateMainFrame(details, params); | 686 helper->DidNavigateMainFrame(details, params); |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
975 args.email = "foo@gmail.com"; | 975 args.email = "foo@gmail.com"; |
976 args.profile = profile(); | 976 args.profile = profile(); |
977 MockStarterWrapper* wrapper = new MockStarterWrapper( | 977 MockStarterWrapper* wrapper = new MockStarterWrapper( |
978 args, OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS); | 978 args, OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS); |
979 SetCookie("LSID=1234; domain=google.com; secure; httponly"); | 979 SetCookie("LSID=1234; domain=google.com; secure; httponly"); |
980 | 980 |
981 EXPECT_CALL(*wrapper, DisplayErrorBubble(_)); | 981 EXPECT_CALL(*wrapper, DisplayErrorBubble(_)); |
982 wrapper->Start(); | 982 wrapper->Start(); |
983 base::RunLoop().RunUntilIdle(); | 983 base::RunLoop().RunUntilIdle(); |
984 } | 984 } |
OLD | NEW |