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

Side by Side Diff: chrome/browser/about_flags_unittest.cc

Issue 2036193002: Allow overriding variation parameter via chrome://flags. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor polish #3 + Adding a unittest Created 4 years, 6 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/about_flags.h" 5 #include "chrome/browser/about_flags.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 testing::GetFeatureEntries(&num_entries); 177 testing::GetFeatureEntries(&num_entries);
178 178
179 for (size_t i = 0; i < num_entries; ++i) { 179 for (size_t i = 0; i < num_entries; ++i) {
180 const flags_ui::FeatureEntry& entry = entries[i]; 180 const flags_ui::FeatureEntry& entry = entries[i];
181 switch (entry.type) { 181 switch (entry.type) {
182 case flags_ui::FeatureEntry::SINGLE_VALUE: 182 case flags_ui::FeatureEntry::SINGLE_VALUE:
183 case flags_ui::FeatureEntry::SINGLE_DISABLE_VALUE: 183 case flags_ui::FeatureEntry::SINGLE_DISABLE_VALUE:
184 result.insert(entry.command_line_switch); 184 result.insert(entry.command_line_switch);
185 break; 185 break;
186 case flags_ui::FeatureEntry::MULTI_VALUE: 186 case flags_ui::FeatureEntry::MULTI_VALUE:
187 for (int j = 0; j < entry.num_choices; ++j) { 187 for (int j = 0; j < entry.num_options; ++j) {
188 result.insert(entry.choices[j].command_line_switch); 188 result.insert(entry.choices[j].command_line_switch);
Alexei Svitkine (slow) 2016/06/08 18:54:35 Iterating num_options times but uses the choices a
jkrcal 2016/06/09 09:55:15 I did not rename choices to options because I want
Alexei Svitkine (slow) 2016/06/10 15:46:48 Adding the function sounds good to me.
189 } 189 }
190 break; 190 break;
191 case flags_ui::FeatureEntry::ENABLE_DISABLE_VALUE: 191 case flags_ui::FeatureEntry::ENABLE_DISABLE_VALUE:
192 result.insert(entry.command_line_switch); 192 result.insert(entry.command_line_switch);
193 result.insert(entry.disable_command_line_switch); 193 result.insert(entry.disable_command_line_switch);
194 break; 194 break;
195 case flags_ui::FeatureEntry::FEATURE_VALUE: 195 case flags_ui::FeatureEntry::FEATURE_VALUE:
196 break; 196 break;
197 } 197 }
198 } 198 }
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 EXPECT_TRUE(enum_entry != histograms_xml_switches_ids.end() && 301 EXPECT_TRUE(enum_entry != histograms_xml_switches_ids.end() &&
302 enum_entry->first == flag) 302 enum_entry->first == flag)
303 << "histograms.xml enum LoginCustomFlags doesn't contain switch '" 303 << "histograms.xml enum LoginCustomFlags doesn't contain switch '"
304 << flag << "' (value=" << uma_id 304 << flag << "' (value=" << uma_id
305 << " expected). Consider adding entry:\n" 305 << " expected). Consider adding entry:\n"
306 << " " << GetHistogramEnumEntryText(flag, uma_id); 306 << " " << GetHistogramEnumEntryText(flag, uma_id);
307 } 307 }
308 } 308 }
309 309
310 } // namespace about_flags 310 } // namespace about_flags
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698