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 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 2034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2045 // FINAL_STATUS_WOULD_HAVE_BEEN_USED. | 2045 // FINAL_STATUS_WOULD_HAVE_BEEN_USED. |
2046 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, MatchCompleteDummy) { | 2046 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, MatchCompleteDummy) { |
2047 std::deque<FinalStatus> expected_final_status_queue; | 2047 std::deque<FinalStatus> expected_final_status_queue; |
2048 expected_final_status_queue.push_back(FINAL_STATUS_JAVASCRIPT_ALERT); | 2048 expected_final_status_queue.push_back(FINAL_STATUS_JAVASCRIPT_ALERT); |
2049 expected_final_status_queue.push_back(FINAL_STATUS_WOULD_HAVE_BEEN_USED); | 2049 expected_final_status_queue.push_back(FINAL_STATUS_WOULD_HAVE_BEEN_USED); |
2050 PrerenderTestURL("files/prerender/prerender_alert_before_onload.html", | 2050 PrerenderTestURL("files/prerender/prerender_alert_before_onload.html", |
2051 expected_final_status_queue, 1); | 2051 expected_final_status_queue, 1); |
2052 NavigateToDestURL(); | 2052 NavigateToDestURL(); |
2053 } | 2053 } |
2054 | 2054 |
| 2055 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, ContentLengthTooLargeHTML) { |
| 2056 const GURL url = test_server()->GetURL( |
| 2057 "files/content_length/content_length_too_large.html"); |
| 2058 const string16 expected_title = ASCIIToUTF16("Too Long Content Length"); |
| 2059 ui_test_utils::TitleWatcher title_watcher( |
| 2060 browser()->GetSelectedWebContents(), |
| 2061 expected_title); |
| 2062 ui_test_utils::NavigateToURL(browser(), url); |
| 2063 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle()); |
| 2064 } |
| 2065 |
| 2066 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, ContentLengthTooLargeTextPlain) { |
| 2067 const GURL url = test_server()->GetURL( |
| 2068 "files/content_length/content_length_too_large_text_plain.html"); |
| 2069 const string16 expected_title = ASCIIToUTF16("Missing Content Length"); |
| 2070 ui_test_utils::NavigateToURL(browser(), url); |
| 2071 } |
| 2072 |
2055 class PrerenderBrowserTestWithNaCl : public PrerenderBrowserTest { | 2073 class PrerenderBrowserTestWithNaCl : public PrerenderBrowserTest { |
2056 public: | 2074 public: |
2057 PrerenderBrowserTestWithNaCl() {} | 2075 PrerenderBrowserTestWithNaCl() {} |
2058 virtual ~PrerenderBrowserTestWithNaCl() {} | 2076 virtual ~PrerenderBrowserTestWithNaCl() {} |
2059 | 2077 |
2060 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 2078 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
2061 PrerenderBrowserTest::SetUpCommandLine(command_line); | 2079 PrerenderBrowserTest::SetUpCommandLine(command_line); |
2062 command_line->AppendSwitch(switches::kEnableNaCl); | 2080 command_line->AppendSwitch(switches::kEnableNaCl); |
2063 } | 2081 } |
2064 }; | 2082 }; |
(...skipping 11 matching lines...) Expand all Loading... |
2076 WebContents* web_contents = browser()->GetSelectedWebContents(); | 2094 WebContents* web_contents = browser()->GetSelectedWebContents(); |
2077 bool display_test_result = false; | 2095 bool display_test_result = false; |
2078 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( | 2096 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( |
2079 web_contents->GetRenderViewHost(), L"", | 2097 web_contents->GetRenderViewHost(), L"", |
2080 L"DidDisplayReallyPass()", | 2098 L"DidDisplayReallyPass()", |
2081 &display_test_result)); | 2099 &display_test_result)); |
2082 ASSERT_TRUE(display_test_result); | 2100 ASSERT_TRUE(display_test_result); |
2083 } | 2101 } |
2084 | 2102 |
2085 } // namespace prerender | 2103 } // namespace prerender |
OLD | NEW |