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 "base/location.h" | 7 #include "base/location.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 std::unique_ptr<TestResourceDispatcherHostDelegate> delegate( | 272 std::unique_ptr<TestResourceDispatcherHostDelegate> delegate( |
273 new TestResourceDispatcherHostDelegate(icon_url)); | 273 new TestResourceDispatcherHostDelegate(icon_url)); |
274 content::ResourceDispatcherHost::Get()->SetDelegate(delegate.get()); | 274 content::ResourceDispatcherHost::Get()->SetDelegate(delegate.get()); |
275 | 275 |
276 PendingTaskWaiter waiter(web_contents(), this); | 276 PendingTaskWaiter waiter(web_contents(), this); |
277 ui_test_utils::NavigateToURLWithDisposition( | 277 ui_test_utils::NavigateToURLWithDisposition( |
278 browser(), url, WindowOpenDisposition::CURRENT_TAB, | 278 browser(), url, WindowOpenDisposition::CURRENT_TAB, |
279 ui_test_utils::BROWSER_TEST_NONE); | 279 ui_test_utils::BROWSER_TEST_NONE); |
280 waiter.Wait(); | 280 waiter.Wait(); |
281 | 281 |
282 #if defined(OS_ANDROID) || defined(OS_IOS) | 282 #if defined(OS_ANDROID) |
283 EXPECT_TRUE(delegate->was_requested()); | 283 EXPECT_TRUE(delegate->was_requested()); |
284 #else | 284 #else |
285 EXPECT_FALSE(delegate->was_requested()); | 285 EXPECT_FALSE(delegate->was_requested()); |
286 #endif | 286 #endif |
287 } | 287 } |
288 | 288 |
289 // Test that loading a page that contains a Web Manifest without icons and a | 289 // Test that loading a page that contains a Web Manifest without icons and a |
290 // regular favicon in the HTML reports the icon. The regular icon is initially | 290 // regular favicon in the HTML reports the icon. The regular icon is initially |
291 // cached in the Favicon database. | 291 // cached in the Favicon database. |
292 IN_PROC_BROWSER_TEST_F(ContentFaviconDriverTest, | 292 IN_PROC_BROWSER_TEST_F(ContentFaviconDriverTest, |
(...skipping 22 matching lines...) Expand all Loading... |
315 { | 315 { |
316 PendingTaskWaiter waiter(web_contents(), this); | 316 PendingTaskWaiter waiter(web_contents(), this); |
317 ui_test_utils::NavigateToURLWithDisposition( | 317 ui_test_utils::NavigateToURLWithDisposition( |
318 browser(), url, WindowOpenDisposition::CURRENT_TAB, | 318 browser(), url, WindowOpenDisposition::CURRENT_TAB, |
319 ui_test_utils::BROWSER_TEST_NONE); | 319 ui_test_utils::BROWSER_TEST_NONE); |
320 waiter.Wait(); | 320 waiter.Wait(); |
321 } | 321 } |
322 | 322 |
323 EXPECT_NE(nullptr, GetFaviconForPageURL(url).bitmap_data); | 323 EXPECT_NE(nullptr, GetFaviconForPageURL(url).bitmap_data); |
324 } | 324 } |
OLD | NEW |