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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 NotifyProfileAdded(); | 257 NotifyProfileAdded(); |
258 base::HistogramTester tester; | 258 base::HistogramTester tester; |
259 prefs()->SetBoolean(test_case.pref_name, test_case.pref_value); | 259 prefs()->SetBoolean(test_case.pref_name, test_case.pref_value); |
260 ExpectValuesForBothPrefValues(test_case.expected_new_pref_value, | 260 ExpectValuesForBothPrefValues(test_case.expected_new_pref_value, |
261 test_case.expected_old_pref_value); | 261 test_case.expected_old_pref_value); |
262 EXPECT_THAT(tester.GetAllSamples(kInitialValuesHistogramName), | 262 EXPECT_THAT(tester.GetAllSamples(kInitialValuesHistogramName), |
263 testing::IsEmpty()); | 263 testing::IsEmpty()); |
264 } | 264 } |
265 } | 265 } |
266 | 266 |
| 267 // TODO(crbug.com/604721): original CL never compiled this file with gyp and |
| 268 // thus the test was never run on iOS and is now failing. Disabled until the |
| 269 // bug is fixed to unblock conversion to gn. |
| 270 #if !defined(OS_IOS) |
| 271 #define MAYBE_ReconcileWhenWhenBothPrefsTypesArrivesFromSync \ |
| 272 ReconcileWhenWhenBothPrefsTypesArrivesFromSync |
| 273 #else |
| 274 #define MAYBE_ReconcileWhenWhenBothPrefsTypesArrivesFromSync \ |
| 275 DISABLED_ReconcileWhenWhenBothPrefsTypesArrivesFromSync |
| 276 #endif |
| 277 |
267 TEST_F(PasswordManagerSettingMigratorServiceTest, | 278 TEST_F(PasswordManagerSettingMigratorServiceTest, |
268 ReconcileWhenWhenBothPrefsTypesArrivesFromSync) { | 279 MAYBE_ReconcileWhenWhenBothPrefsTypesArrivesFromSync) { |
269 const struct { | 280 const struct { |
270 BooleanPrefState new_pref_local_value; | 281 BooleanPrefState new_pref_local_value; |
271 BooleanPrefState old_pref_local_value; | 282 BooleanPrefState old_pref_local_value; |
272 BooleanPrefState new_pref_sync_value; | 283 BooleanPrefState new_pref_sync_value; |
273 BooleanPrefState old_pref_sync_value; | 284 BooleanPrefState old_pref_sync_value; |
274 bool result_value; | 285 bool result_value; |
275 PasswordManagerPreferencesInitialValues histogram_initial_value; | 286 PasswordManagerPreferencesInitialValues histogram_initial_value; |
276 PasswordManagerPreferencesInitialAndFinalValues histogram_initial_and_final; | 287 PasswordManagerPreferencesInitialAndFinalValues histogram_initial_and_final; |
277 } kTestingTable[] = { | 288 } kTestingTable[] = { |
278 #if defined(OS_ANDROID) | 289 #if defined(OS_ANDROID) |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 ASSERT_EQ(prefs()->GetBoolean(prefs::kCredentialsEnableService), true); | 464 ASSERT_EQ(prefs()->GetBoolean(prefs::kCredentialsEnableService), true); |
454 profile_sync_service()->SetCanSyncStart(false); | 465 profile_sync_service()->SetCanSyncStart(false); |
455 base::HistogramTester tester; | 466 base::HistogramTester tester; |
456 NotifyProfileAdded(); | 467 NotifyProfileAdded(); |
457 ExpectValuesForBothPrefValues(true, true); | 468 ExpectValuesForBothPrefValues(true, true); |
458 EXPECT_THAT(tester.GetAllSamples(kInitialAndFinalValuesHistogramName), | 469 EXPECT_THAT(tester.GetAllSamples(kInitialAndFinalValuesHistogramName), |
459 testing::ElementsAre(base::Bucket(I11F11, 1))); | 470 testing::ElementsAre(base::Bucket(I11F11, 1))); |
460 } | 471 } |
461 | 472 |
462 } // namespace password_manager | 473 } // namespace password_manager |
OLD | NEW |