OLD | NEW |
---|---|
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/precache/content/precache_manager.h" | 5 #include "components/precache/content/precache_manager.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
117 return was_on_done_called_; | 117 return was_on_done_called_; |
118 } | 118 } |
119 | 119 |
120 private: | 120 private: |
121 bool was_on_done_called_; | 121 bool was_on_done_called_; |
122 }; | 122 }; |
123 | 123 |
124 class PrecacheManagerTest : public testing::Test { | 124 class PrecacheManagerTest : public testing::Test { |
125 public: | 125 public: |
126 PrecacheManagerTest() | 126 PrecacheManagerTest() |
127 : precache_manager_(&browser_context_), | 127 : precache_manager_(&browser_context_, nullptr /* sync_service */), |
128 factory_(NULL, base::Bind(&TestURLFetcherCallback::CreateURLFetcher, | 128 factory_(NULL, |
bengr
2015/06/23 22:16:19
Mind changing this to nullptr too?
twifkak
2015/06/23 23:54:51
Not at all. Done.
| |
129 base::Unretained(&url_callback_))) {} | 129 base::Bind(&TestURLFetcherCallback::CreateURLFetcher, |
130 base::Unretained(&url_callback_))) {} | |
130 | 131 |
131 protected: | 132 protected: |
132 void SetUp() override { | 133 void SetUp() override { |
133 base::StatisticsRecorder::Initialize(); | 134 base::StatisticsRecorder::Initialize(); |
134 | 135 |
135 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( | 136 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( |
136 switches::kPrecacheConfigSettingsURL, kConfigURL); | 137 switches::kPrecacheConfigSettingsURL, kConfigURL); |
137 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( | 138 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( |
138 switches::kPrecacheManifestURLPrefix, kManifestURLPrefix); | 139 switches::kPrecacheManifestURLPrefix, kManifestURLPrefix); |
139 | 140 |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
360 kCurrentTime, 1000, true); | 361 kCurrentTime, 1000, true); |
361 expected_histogram_count_map["Precache.Saved"] += 2; | 362 expected_histogram_count_map["Precache.Saved"] += 2; |
362 | 363 |
363 base::MessageLoop::current()->RunUntilIdle(); | 364 base::MessageLoop::current()->RunUntilIdle(); |
364 EXPECT_EQ(expected_histogram_count_map, GetHistogramCountMap()); | 365 EXPECT_EQ(expected_histogram_count_map, GetHistogramCountMap()); |
365 } | 366 } |
366 | 367 |
367 } // namespace | 368 } // namespace |
368 | 369 |
369 } // namespace precache | 370 } // namespace precache |
OLD | NEW |