Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(350)

Side by Side Diff: chrome/browser/favicon/content_favicon_driver_browsertest.cc

Issue 2799273002: Add support to process favicons from Web Manifests (Closed)
Patch Set: Reverted fieldtrial_testing_config.json Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
11 #include "base/scoped_observer.h" 11 #include "base/scoped_observer.h"
12 #include "base/single_thread_task_runner.h" 12 #include "base/single_thread_task_runner.h"
13 #include "base/test/scoped_feature_list.h"
13 #include "base/threading/thread_task_runner_handle.h" 14 #include "base/threading/thread_task_runner_handle.h"
14 #include "chrome/app/chrome_command_ids.h" 15 #include "chrome/app/chrome_command_ids.h"
15 #include "chrome/browser/chrome_notification_types.h" 16 #include "chrome/browser/chrome_notification_types.h"
16 #include "chrome/browser/ui/browser.h" 17 #include "chrome/browser/ui/browser.h"
17 #include "chrome/browser/ui/browser_commands.h" 18 #include "chrome/browser/ui/browser_commands.h"
18 #include "chrome/browser/ui/tabs/tab_strip_model.h" 19 #include "chrome/browser/ui/tabs/tab_strip_model.h"
19 #include "chrome/test/base/in_process_browser_test.h" 20 #include "chrome/test/base/in_process_browser_test.h"
20 #include "chrome/test/base/ui_test_utils.h" 21 #include "chrome/test/base/ui_test_utils.h"
21 #include "components/favicon/core/favicon_driver_observer.h" 22 #include "components/favicon/core/favicon_driver_observer.h"
22 #include "components/favicon/core/favicon_handler.h" 23 #include "components/favicon/core/favicon_handler.h"
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 233
233 // A reload ignoring the cache should refetch the favicon from the website. 234 // A reload ignoring the cache should refetch the favicon from the website.
234 { 235 {
235 PendingTaskWaiter waiter(web_contents(), this); 236 PendingTaskWaiter waiter(web_contents(), this);
236 chrome::ExecuteCommand(browser(), IDC_RELOAD_BYPASSING_CACHE); 237 chrome::ExecuteCommand(browser(), IDC_RELOAD_BYPASSING_CACHE);
237 waiter.Wait(); 238 waiter.Wait();
238 } 239 }
239 ASSERT_TRUE(delegate->was_requested()); 240 ASSERT_TRUE(delegate->was_requested());
240 EXPECT_TRUE(delegate->bypassed_cache()); 241 EXPECT_TRUE(delegate->bypassed_cache());
241 } 242 }
243
244 // Test that loading a page that contains icons only in the Web Manifest causes
245 // those icons to be used..
pkotwicz 2017/05/12 06:13:28 Nit: Just one period
246 IN_PROC_BROWSER_TEST_F(ContentFaviconDriverTest, LoadIconFromWebManifest) {
247 base::test::ScopedFeatureList override_features;
248 override_features.InitAndEnableFeature(favicon::kFaviconsFromWebManifest);
249
250 ASSERT_TRUE(embedded_test_server()->Start());
251 GURL url = embedded_test_server()->GetURL("/favicon/page_with_manifest.html");
252 GURL icon_url = embedded_test_server()->GetURL("/favicon/icon.png");
253
254 std::unique_ptr<TestResourceDispatcherHostDelegate> delegate(
255 new TestResourceDispatcherHostDelegate(icon_url));
256 content::ResourceDispatcherHost::Get()->SetDelegate(delegate.get());
257
258 PendingTaskWaiter waiter(web_contents(), this);
259 ui_test_utils::NavigateToURLWithDisposition(
260 browser(), url, WindowOpenDisposition::CURRENT_TAB,
261 ui_test_utils::BROWSER_TEST_NONE);
262 waiter.Wait();
263
264 EXPECT_TRUE(delegate->was_requested());
265 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698