| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // MediaGalleriesPreferences unit tests. | 5 // MediaGalleriesPreferences unit tests. |
| 6 | 6 |
| 7 #include "chrome/browser/media_galleries/media_galleries_preferences.h" | 7 #include "chrome/browser/media_galleries/media_galleries_preferences.h" |
| 8 | 8 |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 PrefService* prefs = profile_->GetPrefs(); | 184 PrefService* prefs = profile_->GetPrefs(); |
| 185 std::unique_ptr<ListPrefUpdate> update( | 185 std::unique_ptr<ListPrefUpdate> update( |
| 186 new ListPrefUpdate(prefs, prefs::kMediaGalleriesRememberedGalleries)); | 186 new ListPrefUpdate(prefs, prefs::kMediaGalleriesRememberedGalleries)); |
| 187 base::ListValue* list = update->Get(); | 187 base::ListValue* list = update->Get(); |
| 188 | 188 |
| 189 for (base::ListValue::iterator iter = list->begin(); | 189 for (base::ListValue::iterator iter = list->begin(); |
| 190 iter != list->end(); | 190 iter != list->end(); |
| 191 ++iter) { | 191 ++iter) { |
| 192 base::DictionaryValue* dict; | 192 base::DictionaryValue* dict; |
| 193 | 193 |
| 194 if (iter->GetAsDictionary(&dict)) { | 194 if ((*iter)->GetAsDictionary(&dict)) { |
| 195 // Setting the prefs version to 2 which is the version before | 195 // Setting the prefs version to 2 which is the version before |
| 196 // default_gallery_type was added. | 196 // default_gallery_type was added. |
| 197 dict->SetInteger(kMediaGalleriesPrefsVersionKey, 2); | 197 dict->SetInteger(kMediaGalleriesPrefsVersionKey, 2); |
| 198 dict->Remove(kMediaGalleriesDefaultGalleryTypeKey, NULL); | 198 dict->Remove(kMediaGalleriesDefaultGalleryTypeKey, NULL); |
| 199 } | 199 } |
| 200 } | 200 } |
| 201 update.reset(); | 201 update.reset(); |
| 202 } | 202 } |
| 203 | 203 |
| 204 void Verify() { | 204 void Verify() { |
| (...skipping 1322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1527 MediaGalleryPrefInfo::DefaultGalleryType::kNotDefault) { | 1527 MediaGalleryPrefInfo::DefaultGalleryType::kNotDefault) { |
| 1528 found_user_added = true; | 1528 found_user_added = true; |
| 1529 } | 1529 } |
| 1530 } | 1530 } |
| 1531 | 1531 |
| 1532 EXPECT_TRUE(found_music); | 1532 EXPECT_TRUE(found_music); |
| 1533 EXPECT_TRUE(found_pictures); | 1533 EXPECT_TRUE(found_pictures); |
| 1534 EXPECT_TRUE(found_videos); | 1534 EXPECT_TRUE(found_videos); |
| 1535 EXPECT_TRUE(found_user_added); | 1535 EXPECT_TRUE(found_user_added); |
| 1536 } | 1536 } |
| OLD | NEW |