OLD | NEW |
---|---|
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 <deque> | 5 #include <deque> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 1347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1358 } | 1358 } |
1359 | 1359 |
1360 // Checks that the visibility API works. | 1360 // Checks that the visibility API works. |
1361 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderVisibility) { | 1361 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderVisibility) { |
1362 PrerenderTestURL("files/prerender/prerender_visibility.html", | 1362 PrerenderTestURL("files/prerender/prerender_visibility.html", |
1363 FINAL_STATUS_USED, | 1363 FINAL_STATUS_USED, |
1364 1); | 1364 1); |
1365 NavigateToDestURL(); | 1365 NavigateToDestURL(); |
1366 } | 1366 } |
1367 | 1367 |
1368 // Checks that the visibility API works when the prerender is quickly opened | 1368 // Checks that the prerendering of a page is canceled correctly when it is |
1369 // in a new tab before it stops loading. | 1369 // quickly opened in a new tab before it stops loading. |
1370 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderVisibilityQuickSwitch) { | 1370 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderQuickSwitch) { |
1371 PrerenderTestURL("files/prerender/prerender_visibility_quick.html", | 1371 PrerenderTestURL("files/prerender/prerender_page.html", |
1372 FINAL_STATUS_USED, 0); | 1372 FINAL_STATUS_CANCELLED, 0); |
1373 NavigateToDestURL(); | 1373 // Post a task to cancel all the prerenders. |
1374 MessageLoop::current()->PostTask( | |
cbentzel
2013/05/28 18:39:17
I'm confused. I thought what this would test the c
Charlie Reis
2013/05/28 23:22:00
I thought that's what the FINAL_STATUS_CANCELLED l
| |
1375 FROM_HERE, base::Bind(&CancelAllPrerenders, GetPrerenderManager())); | |
1376 content::RunMessageLoop(); | |
1377 EXPECT_TRUE(GetPrerenderContents() == NULL); | |
1374 } | 1378 } |
1375 | 1379 |
1376 // Checks that the prerendering of a page is canceled correctly when a | 1380 // Checks that the prerendering of a page is canceled correctly when a |
1377 // Javascript alert is called. | 1381 // Javascript alert is called. |
1378 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderAlertBeforeOnload) { | 1382 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderAlertBeforeOnload) { |
1379 PrerenderTestURL("files/prerender/prerender_alert_before_onload.html", | 1383 PrerenderTestURL("files/prerender/prerender_alert_before_onload.html", |
1380 FINAL_STATUS_JAVASCRIPT_ALERT, | 1384 FINAL_STATUS_JAVASCRIPT_ALERT, |
1381 1); | 1385 1); |
1382 } | 1386 } |
1383 | 1387 |
(...skipping 1398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2782 // Checks that non-http/https main page redirects cancel the prerender. | 2786 // Checks that non-http/https main page redirects cancel the prerender. |
2783 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, | 2787 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, |
2784 PrerenderCancelMainFrameRedirectUnsupportedScheme) { | 2788 PrerenderCancelMainFrameRedirectUnsupportedScheme) { |
2785 GURL url = test_server()->GetURL( | 2789 GURL url = test_server()->GetURL( |
2786 CreateServerRedirect("invalidscheme://www.google.com/test.html")); | 2790 CreateServerRedirect("invalidscheme://www.google.com/test.html")); |
2787 PrerenderTestURL(url, FINAL_STATUS_UNSUPPORTED_SCHEME, 1); | 2791 PrerenderTestURL(url, FINAL_STATUS_UNSUPPORTED_SCHEME, 1); |
2788 NavigateToDestURL(); | 2792 NavigateToDestURL(); |
2789 } | 2793 } |
2790 | 2794 |
2791 } // namespace prerender | 2795 } // namespace prerender |
OLD | NEW |