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

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

Issue 421663003: Move variations component code to variations namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fix Created 6 years, 4 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 | Annotate | Revision Log
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/study_filtering.h" 5 #include "components/variations/study_filtering.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/strings/string_split.h" 9 #include "base/strings/string_split.h"
10 #include "components/variations/processed_study.h" 10 #include "components/variations/processed_study.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 namespace chrome_variations { 13 namespace variations {
14 14
15 namespace { 15 namespace {
16 16
17 // Converts |time| to Study proto format. 17 // Converts |time| to Study proto format.
18 int64 TimeToProtoTime(const base::Time& time) { 18 int64 TimeToProtoTime(const base::Time& time) {
19 return (time - base::Time::UnixEpoch()).InSeconds(); 19 return (time - base::Time::UnixEpoch()).InSeconds();
20 } 20 }
21 21
22 // Adds an experiment to |study| with the specified |name| and |probability|. 22 // Adds an experiment to |study| with the specified |name| and |probability|.
23 Study_Experiment* AddExperiment(const std::string& name, int probability, 23 Study_Experiment* AddExperiment(const std::string& name, int probability,
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 EXPECT_FALSE(processed_study.Init(&study, false)); 469 EXPECT_FALSE(processed_study.Init(&study, false));
470 470
471 default_group->set_name("def"); 471 default_group->set_name("def");
472 EXPECT_TRUE(processed_study.Init(&study, false)); 472 EXPECT_TRUE(processed_study.Init(&study, false));
473 Study_Experiment* repeated_group = study.add_experiment(); 473 Study_Experiment* repeated_group = study.add_experiment();
474 repeated_group->set_name("abc"); 474 repeated_group->set_name("abc");
475 repeated_group->set_probability_weight(1); 475 repeated_group->set_probability_weight(1);
476 EXPECT_FALSE(processed_study.Init(&study, false)); 476 EXPECT_FALSE(processed_study.Init(&study, false));
477 } 477 }
478 478
479 } // namespace chrome_variations 479 } // namespace variations
OLDNEW
« no previous file with comments | « components/variations/study_filtering.cc ('k') | components/variations/variations_associated_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698