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

Side by Side Diff: components/variations/variations_http_header_provider_unittest.cc

Issue 658993002: Convert ARRAYSIZE_UNSAFE -> arraysize in components/. (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
« no previous file with comments | « components/variations/study_filtering_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/variations/variations_http_header_provider.h" 5 #include "components/variations/variations_http_header_provider.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 {"http://a.b.googleadservices.com", true}, 146 {"http://a.b.googleadservices.com", true},
147 {"http://a.b.googleapis.com", true}, 147 {"http://a.b.googleapis.com", true},
148 {"http://a.b.googlesyndication.com", true}, 148 {"http://a.b.googlesyndication.com", true},
149 {"http://a.b.googleusercontent.com", true}, 149 {"http://a.b.googleusercontent.com", true},
150 {"http://a.b.googlevideo.com", true}, 150 {"http://a.b.googlevideo.com", true},
151 {"http://ssl.gstatic.com", true}, 151 {"http://ssl.gstatic.com", true},
152 {"http://a.b.gstatic.com", true}, 152 {"http://a.b.gstatic.com", true},
153 {"http://a.b.ytimg.com", true}, 153 {"http://a.b.ytimg.com", true},
154 }; 154 };
155 155
156 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(cases); ++i) { 156 for (size_t i = 0; i < arraysize(cases); ++i) {
157 const GURL url(cases[i].url); 157 const GURL url(cases[i].url);
158 EXPECT_EQ(cases[i].should_append_headers, 158 EXPECT_EQ(cases[i].should_append_headers,
159 VariationsHttpHeaderProvider::ShouldAppendHeaders(url)) 159 VariationsHttpHeaderProvider::ShouldAppendHeaders(url))
160 << url; 160 << url;
161 } 161 }
162 } 162 }
163 163
164 TEST_F(VariationsHttpHeaderProviderTest, SetDefaultVariationIds_Valid) { 164 TEST_F(VariationsHttpHeaderProviderTest, SetDefaultVariationIds_Valid) {
165 base::MessageLoop loop; 165 base::MessageLoop loop;
166 VariationsHttpHeaderProvider provider; 166 VariationsHttpHeaderProvider provider;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 headers.GetHeader("X-Client-Data", &variations); 231 headers.GetHeader("X-Client-Data", &variations);
232 232
233 std::set<VariationID> variation_ids; 233 std::set<VariationID> variation_ids;
234 std::set<VariationID> trigger_ids; 234 std::set<VariationID> trigger_ids;
235 ASSERT_TRUE(ExtractVariationIds(variations, &variation_ids, &trigger_ids)); 235 ASSERT_TRUE(ExtractVariationIds(variations, &variation_ids, &trigger_ids));
236 EXPECT_TRUE(variation_ids.find(123) != variation_ids.end()); 236 EXPECT_TRUE(variation_ids.find(123) != variation_ids.end());
237 EXPECT_TRUE(trigger_ids.find(456) != trigger_ids.end()); 237 EXPECT_TRUE(trigger_ids.find(456) != trigger_ids.end());
238 } 238 }
239 239
240 } // namespace variations 240 } // namespace variations
OLDNEW
« no previous file with comments | « components/variations/study_filtering_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698