OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/user_prefs/tracked/tracked_preferences_migration.h" | 5 #include "components/user_prefs/tracked/tracked_preferences_migration.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 base::Bind(&TrackedPreferencesMigrationTest::GetPrefsBack, | 286 base::Bind(&TrackedPreferencesMigrationTest::GetPrefsBack, |
287 base::Unretained(this), MOCK_PROTECTED_PREF_STORE), | 287 base::Unretained(this), MOCK_PROTECTED_PREF_STORE), |
288 std::move(protected_prefs_)); | 288 std::move(protected_prefs_)); |
289 break; | 289 break; |
290 } | 290 } |
291 } | 291 } |
292 | 292 |
293 bool HasPrefs(MockPrefStoreID store_id) { | 293 bool HasPrefs(MockPrefStoreID store_id) { |
294 switch (store_id) { | 294 switch (store_id) { |
295 case MOCK_UNPROTECTED_PREF_STORE: | 295 case MOCK_UNPROTECTED_PREF_STORE: |
296 return unprotected_prefs_; | 296 return !!unprotected_prefs_; |
297 case MOCK_PROTECTED_PREF_STORE: | 297 case MOCK_PROTECTED_PREF_STORE: |
298 return protected_prefs_; | 298 return !!protected_prefs_; |
299 } | 299 } |
300 NOTREACHED(); | 300 NOTREACHED(); |
301 return false; | 301 return false; |
302 } | 302 } |
303 | 303 |
304 bool StoreModifiedByMigration(MockPrefStoreID store_id) { | 304 bool StoreModifiedByMigration(MockPrefStoreID store_id) { |
305 switch (store_id) { | 305 switch (store_id) { |
306 case MOCK_UNPROTECTED_PREF_STORE: | 306 case MOCK_UNPROTECTED_PREF_STORE: |
307 return migration_modified_unprotected_store_; | 307 return migration_modified_unprotected_store_; |
308 case MOCK_PROTECTED_PREF_STORE: | 308 case MOCK_PROTECTED_PREF_STORE: |
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
897 expected_unprotected_values); | 897 expected_unprotected_values); |
898 | 898 |
899 base::StringPairs expected_protected_values; | 899 base::StringPairs expected_protected_values; |
900 expected_protected_values.push_back(std::make_pair( | 900 expected_protected_values.push_back(std::make_pair( |
901 kProtectedPref, kProtectedPrefValue)); | 901 kProtectedPref, kProtectedPrefValue)); |
902 expected_protected_values.push_back(std::make_pair( | 902 expected_protected_values.push_back(std::make_pair( |
903 kPreviouslyUnprotectedPref, kPreviouslyUnprotectedPrefValue)); | 903 kPreviouslyUnprotectedPref, kPreviouslyUnprotectedPrefValue)); |
904 VerifyValuesStored(MOCK_PROTECTED_PREF_STORE, expected_protected_values); | 904 VerifyValuesStored(MOCK_PROTECTED_PREF_STORE, expected_protected_values); |
905 } | 905 } |
906 } | 906 } |
OLD | NEW |