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

Side by Side Diff: chrome/browser/prerender/prerender_browsertest.cc

Issue 2732653002: Add favicon integration tests for FaviconDriverImpl (Closed)
Patch Set: Added verification of color Created 3 years, 9 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
« no previous file with comments | « no previous file | components/favicon/content/content_favicon_driver.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <stddef.h> 5 #include <stddef.h>
6 #include <deque> 6 #include <deque>
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <unordered_map> 9 #include <unordered_map>
10 #include <utility> 10 #include <utility>
(...skipping 2418 matching lines...) Expand 10 before | Expand all | Expand 10 after
2429 } 2429 }
2430 2430
2431 // Checks that the favicon is properly loaded on prerender. 2431 // Checks that the favicon is properly loaded on prerender.
2432 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderFavicon) { 2432 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderFavicon) {
2433 std::unique_ptr<TestPrerender> prerender = PrerenderTestURL( 2433 std::unique_ptr<TestPrerender> prerender = PrerenderTestURL(
2434 "/prerender/prerender_favicon.html", FINAL_STATUS_USED, 1); 2434 "/prerender/prerender_favicon.html", FINAL_STATUS_USED, 1);
2435 NavigateToDestURL(); 2435 NavigateToDestURL();
2436 2436
2437 favicon::FaviconDriver* favicon_driver = 2437 favicon::FaviconDriver* favicon_driver =
2438 favicon::ContentFaviconDriver::FromWebContents(GetActiveWebContents()); 2438 favicon::ContentFaviconDriver::FromWebContents(GetActiveWebContents());
2439 if (!favicon_driver->FaviconIsValid()) { 2439 if (favicon_driver->GetFavicon().IsEmpty()) {
2440 // If the favicon has not been set yet, wait for it to be. 2440 // If the favicon has not been set yet, wait for it to be.
2441 FaviconUpdateWatcher favicon_update_watcher(GetActiveWebContents()); 2441 FaviconUpdateWatcher favicon_update_watcher(GetActiveWebContents());
2442 favicon_update_watcher.Wait(); 2442 favicon_update_watcher.Wait();
2443 } 2443 }
2444 EXPECT_TRUE(favicon_driver->FaviconIsValid()); 2444 EXPECT_FALSE(favicon_driver->GetFavicon().IsEmpty());
2445 } 2445 }
2446 2446
2447 // Checks that when prerendered page is swapped in and the referring page 2447 // Checks that when prerendered page is swapped in and the referring page
2448 // neither had set an unload nor it had set a beforeunload handler, the old 2448 // neither had set an unload nor it had set a beforeunload handler, the old
2449 // WebContents will not leak. 2449 // WebContents will not leak.
2450 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderOldWebContentsDeleted) { 2450 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderOldWebContentsDeleted) {
2451 PrerenderTestURL("/prerender/prerender_page.html", FINAL_STATUS_USED, 1); 2451 PrerenderTestURL("/prerender/prerender_page.html", FINAL_STATUS_USED, 1);
2452 WebContentsDestructionObserver destruction_observer(GetActiveWebContents()); 2452 WebContentsDestructionObserver destruction_observer(GetActiveWebContents());
2453 NavigateToDestURL(); 2453 NavigateToDestURL();
2454 destruction_observer.Wait(); 2454 destruction_observer.Wait();
(...skipping 1356 matching lines...) Expand 10 before | Expand all | Expand 10 after
3811 browser()->tab_strip_model()->GetActiveWebContents(); 3811 browser()->tab_strip_model()->GetActiveWebContents();
3812 bool display_test_result = false; 3812 bool display_test_result = false;
3813 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(web_contents, 3813 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(web_contents,
3814 "DidDisplayReallyPass()", 3814 "DidDisplayReallyPass()",
3815 &display_test_result)); 3815 &display_test_result));
3816 ASSERT_TRUE(display_test_result); 3816 ASSERT_TRUE(display_test_result);
3817 } 3817 }
3818 #endif // !defined(DISABLE_NACL) 3818 #endif // !defined(DISABLE_NACL)
3819 3819
3820 } // namespace prerender 3820 } // namespace prerender
OLDNEW
« no previous file with comments | « no previous file | components/favicon/content/content_favicon_driver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698