OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Tests for the Variations Helpers. | 5 // Tests for the Variations Helpers. |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
11 #include "base/metrics/field_trial.h" | 11 #include "base/metrics/field_trial.h" |
12 #include "base/time.h" | 12 #include "base/time.h" |
13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
14 #include "chrome/common/metrics/variations_util.h" | 14 #include "chrome/common/metrics/variations/variations_util.h" |
15 #include "content/public/test/test_browser_thread.h" | 15 #include "content/public/test/test_browser_thread.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 chrome_variations { |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 // Convenience helper to retrieve the chrome_variations::VariationID for a | 22 // Convenience helper to retrieve the chrome_variations::VariationID for a |
23 // FieldTrial. Note that this will do the group assignment in |trial| if not | 23 // FieldTrial. Note that this will do the group assignment in |trial| if not |
24 // already done. | 24 // already done. |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 | 267 |
268 std::vector<string16> chunks; | 268 std::vector<string16> chunks; |
269 GenerateVariationChunks(experiments, &chunks); | 269 GenerateVariationChunks(experiments, &chunks); |
270 ASSERT_EQ(cases[i].expected_chunks_length, chunks.size()); | 270 ASSERT_EQ(cases[i].expected_chunks_length, chunks.size()); |
271 for (size_t j = 0; j < chunks.size(); ++j) | 271 for (size_t j = 0; j < chunks.size(); ++j) |
272 EXPECT_EQ(UTF8ToUTF16(cases[i].expected_chunks[j]), chunks[j]); | 272 EXPECT_EQ(UTF8ToUTF16(cases[i].expected_chunks[j]), chunks[j]); |
273 } | 273 } |
274 } | 274 } |
275 | 275 |
276 } // namespace chrome_variations | 276 } // namespace chrome_variations |
OLD | NEW |