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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 using ::testing::Pair; | 45 using ::testing::Pair; |
46 using ::testing::SaveArg; | 46 using ::testing::SaveArg; |
47 | 47 |
48 const char kConfigURL[] = "http://config-url.com"; | 48 const char kConfigURL[] = "http://config-url.com"; |
49 const char kManifestURLPrefix[] = "http://manifest-url-prefix.com/"; | 49 const char kManifestURLPrefix[] = "http://manifest-url-prefix.com/"; |
50 const char kGoodManifestURL[] = | 50 const char kGoodManifestURL[] = |
51 "http://manifest-url-prefix.com/good-manifest.com"; | 51 "http://manifest-url-prefix.com/good-manifest.com"; |
52 | 52 |
53 class TestURLFetcherCallback { | 53 class TestURLFetcherCallback { |
54 public: | 54 public: |
55 scoped_ptr<net::FakeURLFetcher> CreateURLFetcher( | 55 std::unique_ptr<net::FakeURLFetcher> CreateURLFetcher( |
56 const GURL& url, net::URLFetcherDelegate* delegate, | 56 const GURL& url, |
57 const std::string& response_data, net::HttpStatusCode response_code, | 57 net::URLFetcherDelegate* delegate, |
| 58 const std::string& response_data, |
| 59 net::HttpStatusCode response_code, |
58 net::URLRequestStatus::Status status) { | 60 net::URLRequestStatus::Status status) { |
59 scoped_ptr<net::FakeURLFetcher> fetcher(new net::FakeURLFetcher( | 61 std::unique_ptr<net::FakeURLFetcher> fetcher(new net::FakeURLFetcher( |
60 url, delegate, response_data, response_code, status)); | 62 url, delegate, response_data, response_code, status)); |
61 | 63 |
62 requested_urls_.insert(url); | 64 requested_urls_.insert(url); |
63 return fetcher; | 65 return fetcher; |
64 } | 66 } |
65 | 67 |
66 const std::multiset<GURL>& requested_urls() const { | 68 const std::multiset<GURL>& requested_urls() const { |
67 return requested_urls_; | 69 return requested_urls_; |
68 } | 70 } |
69 | 71 |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 expected_histogram_count_map["Precache.Saved"] += 2; | 440 expected_histogram_count_map["Precache.Saved"] += 2; |
439 | 441 |
440 base::MessageLoop::current()->RunUntilIdle(); | 442 base::MessageLoop::current()->RunUntilIdle(); |
441 EXPECT_THAT(histograms_.GetTotalCountsForPrefix("Precache."), | 443 EXPECT_THAT(histograms_.GetTotalCountsForPrefix("Precache."), |
442 ContainerEq(expected_histogram_count_map)); | 444 ContainerEq(expected_histogram_count_map)); |
443 } | 445 } |
444 | 446 |
445 } // namespace | 447 } // namespace |
446 | 448 |
447 } // namespace precache | 449 } // namespace precache |
OLD | NEW |