| 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/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 2963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2974 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, | 2974 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, |
| 2975 DISABLED_PrerenderSessionStorage) { | 2975 DISABLED_PrerenderSessionStorage) { |
| 2976 set_loader_path("files/prerender/prerender_loader_with_session_storage.html"); | 2976 set_loader_path("files/prerender/prerender_loader_with_session_storage.html"); |
| 2977 PrerenderTestURL(GetCrossDomainTestUrl("files/prerender/prerender_page.html"), | 2977 PrerenderTestURL(GetCrossDomainTestUrl("files/prerender/prerender_page.html"), |
| 2978 FINAL_STATUS_USED, | 2978 FINAL_STATUS_USED, |
| 2979 1); | 2979 1); |
| 2980 NavigateToDestURL(); | 2980 NavigateToDestURL(); |
| 2981 GoBackToPageBeforePrerender(); | 2981 GoBackToPageBeforePrerender(); |
| 2982 } | 2982 } |
| 2983 | 2983 |
| 2984 #if defined(OS_MACOSX) | 2984 // Checks that the control group works. An XHR PUT cannot be detected in the |
| 2985 // http://crbug.com/142535 - Times out on Chrome Mac release builder | |
| 2986 #define MAYBE_ControlGroup DISABLED_ControlGroup | |
| 2987 #else | |
| 2988 #define MAYBE_ControlGroup ControlGroup | |
| 2989 #endif | |
| 2990 // Checks that the control group works. A JS alert cannot be detected in the | |
| 2991 // control group. | 2985 // control group. |
| 2992 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, MAYBE_ControlGroup) { | 2986 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, ControlGroup) { |
| 2993 RestorePrerenderMode restore_prerender_mode; | 2987 RestorePrerenderMode restore_prerender_mode; |
| 2994 PrerenderManager::SetMode( | 2988 PrerenderManager::SetMode( |
| 2995 PrerenderManager::PRERENDER_MODE_EXPERIMENT_CONTROL_GROUP); | 2989 PrerenderManager::PRERENDER_MODE_EXPERIMENT_CONTROL_GROUP); |
| 2996 DisableJavascriptCalls(); | 2990 DisableJavascriptCalls(); |
| 2997 PrerenderTestURL("files/prerender/prerender_alert_before_onload.html", | 2991 PrerenderTestURL("files/prerender/prerender_xhr_put.html", |
| 2998 FINAL_STATUS_WOULD_HAVE_BEEN_USED, 0); | 2992 FINAL_STATUS_WOULD_HAVE_BEEN_USED, 0); |
| 2999 NavigateToDestURL(); | 2993 NavigateToDestURL(); |
| 3000 } | 2994 } |
| 3001 | 2995 |
| 3002 // Make sure that the MatchComplete dummy works in the normal case. Once | 2996 // Make sure that the MatchComplete dummy works in the normal case. Once |
| 3003 // a prerender is cancelled because of a script, a dummy must be created to | 2997 // a prerender is cancelled because of a script, a dummy must be created to |
| 3004 // account for the MatchComplete case, and it must have a final status of | 2998 // account for the MatchComplete case, and it must have a final status of |
| 3005 // FINAL_STATUS_WOULD_HAVE_BEEN_USED. | 2999 // FINAL_STATUS_WOULD_HAVE_BEEN_USED. |
| 3006 #if defined(OS_MACOSX) | 3000 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, MatchCompleteDummy) { |
| 3007 // http://crbug.com/142912 - Times out on Chrome Mac release builder | |
| 3008 #define MAYBE_MatchCompleteDummy DISABLED_MatchCompleteDummy | |
| 3009 #else | |
| 3010 #define MAYBE_MatchCompleteDummy MatchCompleteDummy | |
| 3011 #endif | |
| 3012 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, MAYBE_MatchCompleteDummy) { | |
| 3013 std::deque<FinalStatus> expected_final_status_queue; | 3001 std::deque<FinalStatus> expected_final_status_queue; |
| 3014 expected_final_status_queue.push_back(FINAL_STATUS_JAVASCRIPT_ALERT); | 3002 expected_final_status_queue.push_back(FINAL_STATUS_INVALID_HTTP_METHOD); |
| 3015 expected_final_status_queue.push_back(FINAL_STATUS_WOULD_HAVE_BEEN_USED); | 3003 expected_final_status_queue.push_back(FINAL_STATUS_WOULD_HAVE_BEEN_USED); |
| 3016 PrerenderTestURL("files/prerender/prerender_alert_before_onload.html", | 3004 PrerenderTestURL("files/prerender/prerender_xhr_put.html", |
| 3017 expected_final_status_queue, 0); | 3005 expected_final_status_queue, 1); |
| 3018 NavigateToDestURL(); | 3006 NavigateToDestURL(); |
| 3019 } | 3007 } |
| 3020 | 3008 |
| 3021 class PrerenderBrowserTestWithNaCl : public PrerenderBrowserTest { | 3009 class PrerenderBrowserTestWithNaCl : public PrerenderBrowserTest { |
| 3022 public: | 3010 public: |
| 3023 PrerenderBrowserTestWithNaCl() {} | 3011 PrerenderBrowserTestWithNaCl() {} |
| 3024 virtual ~PrerenderBrowserTestWithNaCl() {} | 3012 virtual ~PrerenderBrowserTestWithNaCl() {} |
| 3025 | 3013 |
| 3026 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 3014 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 3027 PrerenderBrowserTest::SetUpCommandLine(command_line); | 3015 PrerenderBrowserTest::SetUpCommandLine(command_line); |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3470 const NavigationController& controller = web_contents->GetController(); | 3458 const NavigationController& controller = web_contents->GetController(); |
| 3471 // First entry is about:blank, second is prerender_page.html. | 3459 // First entry is about:blank, second is prerender_page.html. |
| 3472 EXPECT_TRUE(controller.GetPendingEntry() == NULL); | 3460 EXPECT_TRUE(controller.GetPendingEntry() == NULL); |
| 3473 EXPECT_EQ(2, controller.GetEntryCount()); | 3461 EXPECT_EQ(2, controller.GetEntryCount()); |
| 3474 EXPECT_EQ(GURL(content::kAboutBlankURL), | 3462 EXPECT_EQ(GURL(content::kAboutBlankURL), |
| 3475 controller.GetEntryAtIndex(0)->GetURL()); | 3463 controller.GetEntryAtIndex(0)->GetURL()); |
| 3476 EXPECT_EQ(dest_url(), controller.GetEntryAtIndex(1)->GetURL()); | 3464 EXPECT_EQ(dest_url(), controller.GetEntryAtIndex(1)->GetURL()); |
| 3477 } | 3465 } |
| 3478 | 3466 |
| 3479 } // namespace prerender | 3467 } // namespace prerender |
| OLD | NEW |