| 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 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "components/favicon/core/favicon_client.h" | 10 #include "components/favicon/core/favicon_client.h" |
| 11 #include "components/favicon/core/favicon_handler.h" | 11 #include "components/favicon/core/favicon_handler.h" |
| 12 #include "components/favicon/core/favicon_service.h" | 12 #include "components/favicon/core/favicon_service.h" |
| 13 #include "components/image_fetcher/image_fetcher.h" |
| 13 #include "content/public/browser/web_contents_observer.h" | 14 #include "content/public/browser/web_contents_observer.h" |
| 14 #include "content/public/common/favicon_url.h" | 15 #include "content/public/common/favicon_url.h" |
| 15 #include "content/public/test/test_renderer_host.h" | 16 #include "content/public/test/test_renderer_host.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
| 17 #include "third_party/skia/include/core/SkBitmap.h" | 18 #include "third_party/skia/include/core/SkBitmap.h" |
| 18 #include "ui/gfx/favicon_size.h" | 19 #include "ui/gfx/favicon_size.h" |
| 19 | 20 |
| 20 namespace favicon { | 21 namespace favicon { |
| 21 namespace { | 22 namespace { |
| 22 | 23 |
| 23 class ContentFaviconDriverTest : public content::RenderViewHostTestHarness { | 24 class ContentFaviconDriverTest : public content::RenderViewHostTestHarness { |
| 24 public: | 25 public: |
| 25 ContentFaviconDriverTest() {} | 26 ContentFaviconDriverTest() {} |
| 26 | 27 |
| 27 ~ContentFaviconDriverTest() override {} | 28 ~ContentFaviconDriverTest() override {} |
| 28 | 29 |
| 29 // content::RenderViewHostTestHarness: | 30 // content::RenderViewHostTestHarness: |
| 30 void SetUp() override { | 31 void SetUp() override { |
| 31 RenderViewHostTestHarness::SetUp(); | 32 RenderViewHostTestHarness::SetUp(); |
| 32 | 33 |
| 33 favicon_service_.reset(new FaviconService(nullptr, nullptr)); | 34 favicon_service_.reset(new FaviconService(nullptr, nullptr, nullptr)); |
| 34 ContentFaviconDriver::CreateForWebContents( | 35 ContentFaviconDriver::CreateForWebContents( |
| 35 web_contents(), favicon_service(), nullptr, nullptr); | 36 web_contents(), favicon_service(), nullptr, nullptr); |
| 36 } | 37 } |
| 37 | 38 |
| 38 FaviconService* favicon_service() { | 39 FaviconService* favicon_service() { |
| 39 return favicon_service_.get(); | 40 return favicon_service_.get(); |
| 40 } | 41 } |
| 41 | 42 |
| 42 private: | 43 private: |
| 43 std::unique_ptr<FaviconService> favicon_service_; | 44 std::unique_ptr<FaviconService> favicon_service_; |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 favicon::ContentFaviconDriver::FromWebContents(web_contents()); | 124 favicon::ContentFaviconDriver::FromWebContents(web_contents()); |
| 124 static_cast<content::WebContentsObserver*>(driver) | 125 static_cast<content::WebContentsObserver*>(driver) |
| 125 ->DidUpdateFaviconURL(favicon_urls); | 126 ->DidUpdateFaviconURL(favicon_urls); |
| 126 | 127 |
| 127 // Test that ContentFaviconDriver ignored the favicon url update. | 128 // Test that ContentFaviconDriver ignored the favicon url update. |
| 128 EXPECT_TRUE(driver->favicon_urls().empty()); | 129 EXPECT_TRUE(driver->favicon_urls().empty()); |
| 129 } | 130 } |
| 130 | 131 |
| 131 } // namespace | 132 } // namespace |
| 132 } // namespace favicon | 133 } // namespace favicon |
| OLD | NEW |