| 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/favicon/content/content_favicon_driver.h" | 5 #include "components/favicon/content/content_favicon_driver.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 ON_CALL(favicon_service_, GetFaviconForPageURL(_, _, _, _, _)) | 43 ON_CALL(favicon_service_, GetFaviconForPageURL(_, _, _, _, _)) |
| 44 .WillByDefault(PostReply<5>(kEmptyRawBitmapResult)); | 44 .WillByDefault(PostReply<5>(kEmptyRawBitmapResult)); |
| 45 } | 45 } |
| 46 | 46 |
| 47 ~ContentFaviconDriverTest() override {} | 47 ~ContentFaviconDriverTest() override {} |
| 48 | 48 |
| 49 // content::RenderViewHostTestHarness: | 49 // content::RenderViewHostTestHarness: |
| 50 void SetUp() override { | 50 void SetUp() override { |
| 51 RenderViewHostTestHarness::SetUp(); | 51 RenderViewHostTestHarness::SetUp(); |
| 52 | 52 |
| 53 ContentFaviconDriver::CreateForWebContents( | 53 ContentFaviconDriver::CreateForWebContents(web_contents(), |
| 54 web_contents(), &favicon_service_, nullptr, nullptr); | 54 &favicon_service_, nullptr); |
| 55 } | 55 } |
| 56 | 56 |
| 57 content::WebContentsTester* web_contents_tester() { | 57 content::WebContentsTester* web_contents_tester() { |
| 58 return content::WebContentsTester::For(web_contents()); | 58 return content::WebContentsTester::For(web_contents()); |
| 59 } | 59 } |
| 60 | 60 |
| 61 void TestFetchFaviconForPage( | 61 void TestFetchFaviconForPage( |
| 62 const GURL& page_url, | 62 const GURL& page_url, |
| 63 const std::vector<content::FaviconURL>& candidates) { | 63 const std::vector<content::FaviconURL>& candidates) { |
| 64 ContentFaviconDriver* favicon_driver = | 64 ContentFaviconDriver* favicon_driver = |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 base::Bucket(/*min=*/3, /*count=*/2))); | 175 base::Bucket(/*min=*/3, /*count=*/2))); |
| 176 EXPECT_THAT(tester.GetAllSamples("Favicons.CandidatesWithDefinedSizesCount"), | 176 EXPECT_THAT(tester.GetAllSamples("Favicons.CandidatesWithDefinedSizesCount"), |
| 177 ElementsAre(base::Bucket(/*min=*/1, /*count=*/3))); | 177 ElementsAre(base::Bucket(/*min=*/1, /*count=*/3))); |
| 178 EXPECT_THAT(tester.GetAllSamples("Favicons.CandidatesWithTouchIconsCount"), | 178 EXPECT_THAT(tester.GetAllSamples("Favicons.CandidatesWithTouchIconsCount"), |
| 179 ElementsAre(base::Bucket(/*min=*/0, /*count=*/1), | 179 ElementsAre(base::Bucket(/*min=*/0, /*count=*/1), |
| 180 base::Bucket(/*min=*/2, /*count=*/2))); | 180 base::Bucket(/*min=*/2, /*count=*/2))); |
| 181 } | 181 } |
| 182 | 182 |
| 183 } // namespace | 183 } // namespace |
| 184 } // namespace favicon | 184 } // namespace favicon |
| OLD | NEW |