| OLD | NEW |
| 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 "components/password_manager/core/browser/password_bubble_experiment.h" | 5 #include "components/password_manager/core/browser/password_bubble_experiment.h" |
| 6 | 6 |
| 7 #include <ostream> | 7 #include <ostream> |
| 8 | 8 |
| 9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 return os; | 58 return os; |
| 59 } | 59 } |
| 60 | 60 |
| 61 struct ShouldShowSavePromptFirstRunExperienceTestcase { | 61 struct ShouldShowSavePromptFirstRunExperienceTestcase { |
| 62 CustomPassphraseState passphrase_state; | 62 CustomPassphraseState passphrase_state; |
| 63 syncer::ModelType type; | 63 syncer::ModelType type; |
| 64 bool pref_value; | 64 bool pref_value; |
| 65 SavePromptFirstRunExperience first_run_experience; | 65 SavePromptFirstRunExperience first_run_experience; |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 class TestSyncService : public syncer::FakeSyncService { | 68 class TestSyncService : public sync_driver::FakeSyncService { |
| 69 public: | 69 public: |
| 70 // FakeSyncService overrides. | 70 // FakeSyncService overrides. |
| 71 bool IsSyncAllowed() const override { return is_sync_allowed_; } | 71 bool IsSyncAllowed() const override { return is_sync_allowed_; } |
| 72 | 72 |
| 73 bool IsFirstSetupComplete() const override { | 73 bool IsFirstSetupComplete() const override { |
| 74 return is_first_setup_complete_; | 74 return is_first_setup_complete_; |
| 75 } | 75 } |
| 76 | 76 |
| 77 bool IsSyncActive() const override { | 77 bool IsSyncActive() const override { |
| 78 return is_sync_allowed_ && is_first_setup_complete_; | 78 return is_sync_allowed_ && is_first_setup_complete_; |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 kChromeSignInPasswordPromoExperimentName, kFakeGroup, | 356 kChromeSignInPasswordPromoExperimentName, kFakeGroup, |
| 357 {{kChromeSignInPasswordPromoThresholdParam, | 357 {{kChromeSignInPasswordPromoThresholdParam, |
| 358 base::IntToString(test_case.experiment_threshold)}}); | 358 base::IntToString(test_case.experiment_threshold)}}); |
| 359 | 359 |
| 360 EXPECT_EQ(test_case.result, | 360 EXPECT_EQ(test_case.result, |
| 361 ShouldShowChromeSignInPasswordPromo(prefs(), sync_service())); | 361 ShouldShowChromeSignInPasswordPromo(prefs(), sync_service())); |
| 362 } | 362 } |
| 363 } | 363 } |
| 364 | 364 |
| 365 } // namespace password_bubble_experiment | 365 } // namespace password_bubble_experiment |
| OLD | NEW |