Lines Matching defs:experiment
28 Experiment::SINGLE_VALUE, command_line_switch, switch_value, NULL, 0
32 Experiment::MULTI_VALUE, "", "", choices, arraysize(choices)
46 // The first line of the experiment is the internal name. If you'd like to
64 // To add a new experiment add to the end of kExperiments. There are two
66 // . SINGLE_VALUE: experiment is either on or off. Use the SINGLE_VALUE_TYPE
70 // this type of experiment use the macro MULTI_VALUE_TYPE supplying it the
72 // See the documentation of Experiment for details on the fields.
75 const Experiment kExperiments[] = {
300 const Experiment* experiments = kExperiments;
362 std::string NameForChoice(const Experiment& e, int index) {
363 DCHECK_EQ(Experiment::MULTI_VALUE, e.type);
369 // Adds the internal names for the specified experiment to |names|.
370 void AddInternalName(const Experiment& e, std::set<std::string>* names) {
371 if (e.type == Experiment::SINGLE_VALUE) {
374 DCHECK_EQ(Experiment::MULTI_VALUE, e.type);
380 // Confirms that an experiment is valid, used in a DCHECK in
382 bool ValidateExperiment(const Experiment& e) {
384 case Experiment::SINGLE_VALUE:
388 case Experiment::MULTI_VALUE:
453 // Returns the Value representing the choice data in the specified experiment.
454 Value* CreateChoiceData(const Experiment& experiment,
456 DCHECK_EQ(Experiment::MULTI_VALUE, experiment.type);
458 for (int i = 0; i < experiment.num_choices; ++i) {
459 const Experiment::Choice& choice = experiment.choices[i];
461 std::string name = NameForChoice(experiment, i);
485 const Experiment& experiment = experiments[i];
486 if (!(experiment.supported_platforms & current_platform))
490 experiment.internal_name);
492 l10n_util::GetStringUTF16(experiment.visible_name_id));
495 experiment.visible_description_id));
497 switch (experiment.type) {
498 case Experiment::SINGLE_VALUE:
501 enabled_experiments.count(experiment.internal_name) > 0);
503 case Experiment::MULTI_VALUE:
504 data->Set("choices", CreateChoiceData(experiment, enabled_experiments));
577 const Experiment& e = experiments[i];
578 if (e.type == Experiment::SINGLE_VALUE) {
630 // We're being asked to enable a multi-choice experiment. Disable the
649 const Experiment* e = NULL;
658 if (e->type == Experiment::SINGLE_VALUE) {
675 // experiment for this choice was enabled.
709 void SetExperiments(const Experiment* e, size_t count) {
719 const Experiment* GetExperiments(size_t* count) {