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

Side by Side Diff: chrome/browser/ui/cocoa/passwords/signin_promo_view_controller_unittest.mm

Issue 2617543002: Create Desktop to iOS Promotion skeleton. (Closed)
Patch Set: add cocoa modifications Created 3 years, 11 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #import "chrome/browser/ui/cocoa/passwords/signin_promo_view_controller.h" 5 #import "chrome/browser/ui/cocoa/passwords/signin_promo_view_controller.h"
6 6
7 #include "base/metrics/field_trial.h" 7 #include "base/metrics/field_trial.h"
8 #import "chrome/browser/ui/cocoa/passwords/base_passwords_controller_test.h" 8 #import "chrome/browser/ui/cocoa/passwords/base_passwords_controller_test.h"
9 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller_mock.h" 9 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller_mock.h"
10 #include "components/password_manager/core/browser/password_bubble_experiment.h" 10 #include "components/password_manager/core/browser/password_bubble_experiment.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 void SignInPromoViewControllerTest::SetUpSignInPromoState() { 44 void SignInPromoViewControllerTest::SetUpSignInPromoState() {
45 const char kFakeGroup[] = "FakeGroup"; 45 const char kFakeGroup[] = "FakeGroup";
46 SetUpSavePendingState(false); 46 SetUpSavePendingState(false);
47 ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial( 47 ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial(
48 kChromeSignInPasswordPromoExperimentName, kFakeGroup)); 48 kChromeSignInPasswordPromoExperimentName, kFakeGroup));
49 variations::AssociateVariationParams( 49 variations::AssociateVariationParams(
50 kChromeSignInPasswordPromoExperimentName, kFakeGroup, 50 kChromeSignInPasswordPromoExperimentName, kFakeGroup,
51 {{kChromeSignInPasswordPromoThresholdParam, "3"}}); 51 {{kChromeSignInPasswordPromoThresholdParam, "3"}});
52 GetModelAndCreateIfNull()->OnSaveClicked(); 52 GetModelAndCreateIfNull()->OnSaveClicked();
53 53
54 ASSERT_TRUE(GetModelAndCreateIfNull()->ReplaceToShowSignInPromoIfNeeded()); 54 ASSERT_TRUE(GetModelAndCreateIfNull()->ReplaceToShowPromotionIfNeeded());
55 55
56 [delegate() setModel:GetModelAndCreateIfNull()]; 56 [delegate() setModel:GetModelAndCreateIfNull()];
57 controller_.reset([[SignInPromoViewController alloc] 57 controller_.reset([[SignInPromoViewController alloc]
58 initWithDelegate:delegate()]); 58 initWithDelegate:delegate()]);
59 [controller_ view]; 59 [controller_ view];
60 } 60 }
61 61
62 62
63 TEST_F(SignInPromoViewControllerTest, ClickSignIn) { 63 TEST_F(SignInPromoViewControllerTest, ClickSignIn) {
64 EXPECT_CALL(*ui_controller(), NavigateToChromeSignIn()); 64 EXPECT_CALL(*ui_controller(), NavigateToChromeSignIn());
(...skipping 20 matching lines...) Expand all
85 // A user may press mouse down, some navigation closes the bubble, mouse up 85 // A user may press mouse down, some navigation closes the bubble, mouse up
86 // still sends the action. 86 // still sends the action.
87 EXPECT_CALL(*ui_controller(), NavigateToChromeSignIn()).Times(0); 87 EXPECT_CALL(*ui_controller(), NavigateToChromeSignIn()).Times(0);
88 [delegate() setModel:nil]; 88 [delegate() setModel:nil];
89 [controller().signInButton performClick:nil]; 89 [controller().signInButton performClick:nil];
90 [controller().noButton performClick:nil]; 90 [controller().noButton performClick:nil];
91 [controller().closeButton performClick:nil]; 91 [controller().closeButton performClick:nil];
92 } 92 }
93 93
94 } // namespace 94 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698