| 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 void Verify() { | 204 void Verify() { |
| 205 const MediaGalleriesPrefInfoMap& known_galleries = | 205 const MediaGalleriesPrefInfoMap& known_galleries = |
| 206 gallery_prefs_->known_galleries(); | 206 gallery_prefs_->known_galleries(); |
| 207 EXPECT_EQ(expected_galleries_.size(), known_galleries.size()); | 207 EXPECT_EQ(expected_galleries_.size(), known_galleries.size()); |
| 208 for (MediaGalleriesPrefInfoMap::const_iterator it = known_galleries.begin(); | 208 for (MediaGalleriesPrefInfoMap::const_iterator it = known_galleries.begin(); |
| 209 it != known_galleries.end(); | 209 it != known_galleries.end(); |
| 210 ++it) { | 210 ++it) { |
| 211 VerifyGalleryInfo(it->second, it->first); | 211 VerifyGalleryInfo(it->second, it->first); |
| 212 if (it->second.type != MediaGalleryPrefInfo::kAutoDetected && | 212 if (it->second.type != MediaGalleryPrefInfo::kAutoDetected && |
| 213 it->second.type != MediaGalleryPrefInfo::kBlackListed) { | 213 it->second.type != MediaGalleryPrefInfo::kBlackListed) { |
| 214 if (!ContainsKey(expected_galleries_for_all, it->first) && | 214 if (!base::ContainsKey(expected_galleries_for_all, it->first) && |
| 215 !ContainsKey(expected_galleries_for_regular, it->first)) { | 215 !base::ContainsKey(expected_galleries_for_regular, it->first)) { |
| 216 EXPECT_FALSE(gallery_prefs_->NonAutoGalleryHasPermission(it->first)); | 216 EXPECT_FALSE(gallery_prefs_->NonAutoGalleryHasPermission(it->first)); |
| 217 } else { | 217 } else { |
| 218 EXPECT_TRUE(gallery_prefs_->NonAutoGalleryHasPermission(it->first)); | 218 EXPECT_TRUE(gallery_prefs_->NonAutoGalleryHasPermission(it->first)); |
| 219 } | 219 } |
| 220 } | 220 } |
| 221 } | 221 } |
| 222 | 222 |
| 223 for (DeviceIdPrefIdsMap::const_iterator it = expected_device_map.begin(); | 223 for (DeviceIdPrefIdsMap::const_iterator it = expected_device_map.begin(); |
| 224 it != expected_device_map.end(); | 224 it != expected_device_map.end(); |
| 225 ++it) { | 225 ++it) { |
| (...skipping 1301 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 |