OLD | NEW |
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/variations_http_header_provider.h" | 5 #include "components/variations/variations_http_header_provider.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 } | 51 } |
52 | 52 |
53 } // namespace | 53 } // namespace |
54 | 54 |
55 class VariationsHttpHeaderProviderTest : public ::testing::Test { | 55 class VariationsHttpHeaderProviderTest : public ::testing::Test { |
56 public: | 56 public: |
57 VariationsHttpHeaderProviderTest() {} | 57 VariationsHttpHeaderProviderTest() {} |
58 | 58 |
59 virtual ~VariationsHttpHeaderProviderTest() {} | 59 virtual ~VariationsHttpHeaderProviderTest() {} |
60 | 60 |
61 virtual void TearDown() OVERRIDE { | 61 virtual void TearDown() override { |
62 testing::ClearAllVariationIDs(); | 62 testing::ClearAllVariationIDs(); |
63 } | 63 } |
64 }; | 64 }; |
65 | 65 |
66 TEST_F(VariationsHttpHeaderProviderTest, ShouldAppendHeaders) { | 66 TEST_F(VariationsHttpHeaderProviderTest, ShouldAppendHeaders) { |
67 struct { | 67 struct { |
68 const char* url; | 68 const char* url; |
69 bool should_append_headers; | 69 bool should_append_headers; |
70 } cases[] = { | 70 } cases[] = { |
71 {"http://google.com", true}, | 71 {"http://google.com", true}, |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 headers.GetHeader("X-Client-Data", &variations); | 231 headers.GetHeader("X-Client-Data", &variations); |
232 | 232 |
233 std::set<VariationID> variation_ids; | 233 std::set<VariationID> variation_ids; |
234 std::set<VariationID> trigger_ids; | 234 std::set<VariationID> trigger_ids; |
235 ASSERT_TRUE(ExtractVariationIds(variations, &variation_ids, &trigger_ids)); | 235 ASSERT_TRUE(ExtractVariationIds(variations, &variation_ids, &trigger_ids)); |
236 EXPECT_TRUE(variation_ids.find(123) != variation_ids.end()); | 236 EXPECT_TRUE(variation_ids.find(123) != variation_ids.end()); |
237 EXPECT_TRUE(trigger_ids.find(456) != trigger_ids.end()); | 237 EXPECT_TRUE(trigger_ids.find(456) != trigger_ids.end()); |
238 } | 238 } |
239 | 239 |
240 } // namespace variations | 240 } // namespace variations |
OLD | NEW |