OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/metrics/net/net_metrics_log_uploader.h" | 5 #include "components/metrics/net/net_metrics_log_uploader.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/macros.h" |
8 #include "net/url_request/test_url_fetcher_factory.h" | 9 #include "net/url_request/test_url_fetcher_factory.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
10 | 11 |
11 namespace metrics { | 12 namespace metrics { |
12 | 13 |
13 class NetMetricsLogUploaderTest : public testing::Test { | 14 class NetMetricsLogUploaderTest : public testing::Test { |
14 public: | 15 public: |
15 NetMetricsLogUploaderTest() : on_upload_complete_count_(0) { | 16 NetMetricsLogUploaderTest() : on_upload_complete_count_(0) { |
16 } | 17 } |
17 | 18 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 fetcher->delegate()->OnURLFetchComplete(fetcher); | 50 fetcher->delegate()->OnURLFetchComplete(fetcher); |
50 | 51 |
51 // Mimic the second fetcher callback. | 52 // Mimic the second fetcher callback. |
52 fetcher = factory.GetFetcherByID(0); | 53 fetcher = factory.GetFetcherByID(0); |
53 fetcher->delegate()->OnURLFetchComplete(fetcher); | 54 fetcher->delegate()->OnURLFetchComplete(fetcher); |
54 | 55 |
55 EXPECT_EQ(on_upload_complete_count(), 2); | 56 EXPECT_EQ(on_upload_complete_count(), 2); |
56 } | 57 } |
57 | 58 |
58 } // namespace metrics | 59 } // namespace metrics |
OLD | NEW |