Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: chrome/browser/media_galleries/media_galleries_permissions_unittest.cc

Issue 655413002: Convert ARRAYSIZE_UNSAFE -> arraysize in chrome/browser/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "base/run_loop.h" 6 #include "base/run_loop.h"
7 #include "chrome/browser/extensions/./extension_prefs_unittest.h" 7 #include "chrome/browser/extensions/./extension_prefs_unittest.h"
8 #include "chrome/browser/extensions/extension_service.h" 8 #include "chrome/browser/extensions/extension_service.h"
9 #include "chrome/browser/media_galleries/media_galleries_preferences.h" 9 #include "chrome/browser/media_galleries/media_galleries_preferences.h"
10 #include "chrome/browser/media_galleries/media_galleries_test_util.h" 10 #include "chrome/browser/media_galleries/media_galleries_test_util.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 virtual void Verify() override { 113 virtual void Verify() override {
114 struct TestData { 114 struct TestData {
115 std::string* id; 115 std::string* id;
116 std::vector<MediaGalleryPermission>* expectation; 116 std::vector<MediaGalleryPermission>* expectation;
117 }; 117 };
118 118
119 const TestData test_data[] = {{&extension1_id_, &extension1_expectation_}, 119 const TestData test_data[] = {{&extension1_id_, &extension1_expectation_},
120 {&extension2_id_, &extension2_expectation_}, 120 {&extension2_id_, &extension2_expectation_},
121 {&extension3_id_, &extension3_expectation_}, 121 {&extension3_id_, &extension3_expectation_},
122 {&extension4_id_, &extension4_expectation_}}; 122 {&extension4_id_, &extension4_expectation_}};
123 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_data); i++) { 123 for (size_t i = 0; i < arraysize(test_data); i++) {
124 std::vector<MediaGalleryPermission> actual = 124 std::vector<MediaGalleryPermission> actual =
125 gallery_prefs_->GetGalleryPermissionsFromPrefs(*test_data[i].id); 125 gallery_prefs_->GetGalleryPermissionsFromPrefs(*test_data[i].id);
126 EXPECT_EQ(test_data[i].expectation->size(), actual.size()); 126 EXPECT_EQ(test_data[i].expectation->size(), actual.size());
127 for (size_t permission_entry = 0; 127 for (size_t permission_entry = 0;
128 permission_entry < test_data[i].expectation->size() && 128 permission_entry < test_data[i].expectation->size() &&
129 permission_entry < actual.size(); 129 permission_entry < actual.size();
130 permission_entry++) { 130 permission_entry++) {
131 EXPECT_EQ(test_data[i].expectation->at(permission_entry).pref_id, 131 EXPECT_EQ(test_data[i].expectation->at(permission_entry).pref_id,
132 actual[permission_entry].pref_id); 132 actual[permission_entry].pref_id);
133 EXPECT_EQ(test_data[i].expectation->at(permission_entry).has_permission, 133 EXPECT_EQ(test_data[i].expectation->at(permission_entry).has_permission,
(...skipping 14 matching lines...) Expand all
148 148
149 // Needed for |gallery_prefs_| to initialize correctly. 149 // Needed for |gallery_prefs_| to initialize correctly.
150 EnsureMediaDirectoriesExists ensure_media_directories_exists_; 150 EnsureMediaDirectoriesExists ensure_media_directories_exists_;
151 content::TestBrowserThread file_thread_; 151 content::TestBrowserThread file_thread_;
152 152
153 scoped_ptr<TestingProfile> profile_; 153 scoped_ptr<TestingProfile> profile_;
154 scoped_ptr<MediaGalleriesPreferences> gallery_prefs_; 154 scoped_ptr<MediaGalleriesPreferences> gallery_prefs_;
155 }; 155 };
156 156
157 TEST_F(MediaGalleriesPermissionsTest, MediaGalleries) {} 157 TEST_F(MediaGalleriesPermissionsTest, MediaGalleries) {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698