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

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

Issue 412943002: Move variations component code to variations namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 5 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 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 "components/variations/variations_seed_processor.h" 5 #include "components/variations/variations_seed_processor.h"
6 6
7 #include <map> 7 #include <map>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/strings/string_split.h" 12 #include "base/strings/string_split.h"
13 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
14 #include "components/variations/processed_study.h" 14 #include "components/variations/processed_study.h"
15 #include "components/variations/variations_associated_data.h" 15 #include "components/variations/variations_associated_data.h"
16 #include "testing/gtest/include/gtest/gtest.h" 16 #include "testing/gtest/include/gtest/gtest.h"
17 17
18 namespace chrome_variations { 18 namespace variations {
19 19
20 namespace { 20 namespace {
21 21
22 // Converts |time| to Study proto format. 22 // Converts |time| to Study proto format.
23 int64 TimeToProtoTime(const base::Time& time) { 23 int64 TimeToProtoTime(const base::Time& time) {
24 return (time - base::Time::UnixEpoch()).InSeconds(); 24 return (time - base::Time::UnixEpoch()).InSeconds();
25 } 25 }
26 26
27 // Constants for testing associating command line flags with trial groups. 27 // Constants for testing associating command line flags with trial groups.
28 const char kFlagStudyName[] = "flag_test_trial"; 28 const char kFlagStudyName[] = "flag_test_trial";
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 Study study = CreateStudyWithFlagGroups(100, 0, 0); 456 Study study = CreateStudyWithFlagGroups(100, 0, 0);
457 study.set_activation_type(Study_ActivationType_ACTIVATION_AUTO); 457 study.set_activation_type(Study_ActivationType_ACTIVATION_AUTO);
458 458
459 EXPECT_TRUE(CreateTrialFromStudy(&study)); 459 EXPECT_TRUE(CreateTrialFromStudy(&study));
460 EXPECT_TRUE(IsFieldTrialActive(kFlagStudyName)); 460 EXPECT_TRUE(IsFieldTrialActive(kFlagStudyName));
461 461
462 EXPECT_EQ(kFlagGroup1Name, 462 EXPECT_EQ(kFlagGroup1Name,
463 base::FieldTrialList::FindFullName(kFlagStudyName)); 463 base::FieldTrialList::FindFullName(kFlagStudyName));
464 } 464 }
465 465
466 } // namespace chrome_variations 466 } // namespace variations
OLDNEW
« no previous file with comments | « components/variations/variations_seed_processor.cc ('k') | components/variations/variations_seed_simulator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698