Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "base/json/json_writer.h" | 5 #include "base/json/json_writer.h" |
| 6 #include "base/macros.h" | 6 #include "base/macros.h" |
| 7 #include "base/metrics/field_trial.h" | 7 #include "base/metrics/field_trial.h" |
| 8 #include "base/test/histogram_tester.h" | 8 #include "base/test/histogram_tester.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 306 {ON, ON, EMPTY, OFF, false, N1L1, I11F00}, | 306 {ON, ON, EMPTY, OFF, false, N1L1, I11F00}, |
| 307 {ON, ON, EMPTY, ON, true, N1L1, I11F11}, | 307 {ON, ON, EMPTY, ON, true, N1L1, I11F11}, |
| 308 {ON, ON, OFF, EMPTY, false, N1L1, I11F00}, | 308 {ON, ON, OFF, EMPTY, false, N1L1, I11F00}, |
| 309 {ON, ON, OFF, OFF, false, N1L1, I11F00}, | 309 {ON, ON, OFF, OFF, false, N1L1, I11F00}, |
| 310 {ON, ON, OFF, ON, false, N1L1, I11F00}, | 310 {ON, ON, OFF, ON, false, N1L1, I11F00}, |
| 311 {ON, ON, ON, EMPTY, true, N1L1, I11F11}, | 311 {ON, ON, ON, EMPTY, true, N1L1, I11F11}, |
| 312 {ON, ON, ON, OFF, false, N1L1, I11F00}, | 312 {ON, ON, ON, OFF, false, N1L1, I11F00}, |
| 313 {ON, ON, ON, ON, true, N1L1, I11F11}, | 313 {ON, ON, ON, ON, true, N1L1, I11F11}, |
| 314 #endif | 314 #endif |
| 315 }; | 315 }; |
| 316 | |
|
raymes
2016/06/16 03:23:51
nit: this isn't needed
lshang
2016/06/20 01:34:22
Done.
| |
| 317 for (const auto& test_case : kTestingTable) { | 316 for (const auto& test_case : kTestingTable) { |
| 318 SetupPreferenceMigrationEnvironment(); | 317 SetupPreferenceMigrationEnvironment(); |
| 319 EnforcePasswordManagerSettingMigrationExperiment(kEnabledGroupName); | 318 EnforcePasswordManagerSettingMigrationExperiment(kEnabledGroupName); |
| 320 SCOPED_TRACE(testing::Message("Local data = ") | 319 SCOPED_TRACE(testing::Message("Local data = ") |
| 321 << test_case.new_pref_local_value << " " | 320 << test_case.new_pref_local_value << " " |
| 322 << test_case.old_pref_local_value); | 321 << test_case.old_pref_local_value); |
| 323 SCOPED_TRACE(testing::Message("Sync data = ") | 322 SCOPED_TRACE(testing::Message("Sync data = ") |
| 324 << test_case.new_pref_sync_value << " " | 323 << test_case.new_pref_sync_value << " " |
| 325 << test_case.old_pref_sync_value); | 324 << test_case.old_pref_sync_value); |
| 326 SetupLocalPrefState(prefs::kPasswordManagerSavingEnabled, | 325 SetupLocalPrefState(prefs::kPasswordManagerSavingEnabled, |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 453 ASSERT_EQ(prefs()->GetBoolean(prefs::kCredentialsEnableService), true); | 452 ASSERT_EQ(prefs()->GetBoolean(prefs::kCredentialsEnableService), true); |
| 454 profile_sync_service()->SetCanSyncStart(false); | 453 profile_sync_service()->SetCanSyncStart(false); |
| 455 base::HistogramTester tester; | 454 base::HistogramTester tester; |
| 456 NotifyProfileAdded(); | 455 NotifyProfileAdded(); |
| 457 ExpectValuesForBothPrefValues(true, true); | 456 ExpectValuesForBothPrefValues(true, true); |
| 458 EXPECT_THAT(tester.GetAllSamples(kInitialAndFinalValuesHistogramName), | 457 EXPECT_THAT(tester.GetAllSamples(kInitialAndFinalValuesHistogramName), |
| 459 testing::ElementsAre(base::Bucket(I11F11, 1))); | 458 testing::ElementsAre(base::Bucket(I11F11, 1))); |
| 460 } | 459 } |
| 461 | 460 |
| 462 } // namespace password_manager | 461 } // namespace password_manager |
| OLD | NEW |