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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 #include <tuple> | 7 #include <tuple> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 1880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1891 // Start a load that will reach provisional state synchronously, | 1891 // Start a load that will reach provisional state synchronously, |
1892 // but won't complete synchronously. | 1892 // but won't complete synchronously. |
1893 CommonNavigationParams common_params; | 1893 CommonNavigationParams common_params; |
1894 common_params.navigation_type = FrameMsg_Navigate_Type::NORMAL; | 1894 common_params.navigation_type = FrameMsg_Navigate_Type::NORMAL; |
1895 common_params.url = GURL("data:text/html,test data"); | 1895 common_params.url = GURL("data:text/html,test data"); |
1896 TestRenderFrame* main_frame = static_cast<TestRenderFrame*>(frame()); | 1896 TestRenderFrame* main_frame = static_cast<TestRenderFrame*>(frame()); |
1897 main_frame->Navigate(common_params, StartNavigationParams(), | 1897 main_frame->Navigate(common_params, StartNavigationParams(), |
1898 RequestNavigationParams()); | 1898 RequestNavigationParams()); |
1899 | 1899 |
1900 // Emulate a 4xx/5xx main resource response with an empty body. | 1900 // Emulate a 4xx/5xx main resource response with an empty body. |
1901 main_frame->didReceiveResponse(1, response); | 1901 main_frame->didReceiveResponse(response); |
1902 main_frame->didFinishDocumentLoad(web_frame); | 1902 main_frame->didFinishDocumentLoad(web_frame); |
1903 main_frame->runScriptsAtDocumentReady(web_frame, true); | 1903 main_frame->runScriptsAtDocumentReady(web_frame, true); |
1904 | 1904 |
1905 // The error page itself is loaded asynchronously. | 1905 // The error page itself is loaded asynchronously. |
1906 FrameLoadWaiter(main_frame).Wait(); | 1906 FrameLoadWaiter(main_frame).Wait(); |
1907 const int kMaxOutputCharacters = 22; | 1907 const int kMaxOutputCharacters = 22; |
1908 EXPECT_EQ("A suffusion of yellow.", | 1908 EXPECT_EQ("A suffusion of yellow.", |
1909 base::UTF16ToASCII( | 1909 base::UTF16ToASCII( |
1910 base::StringPiece16(WebFrameContentDumper::dumpWebViewAsText( | 1910 base::StringPiece16(WebFrameContentDumper::dumpWebViewAsText( |
1911 view()->GetWebView(), kMaxOutputCharacters)))); | 1911 view()->GetWebView(), kMaxOutputCharacters)))); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1992 GetMainFrame()->dataSource()->request().getExtraData()); | 1992 GetMainFrame()->dataSource()->request().getExtraData()); |
1993 ASSERT_TRUE(extra_data); | 1993 ASSERT_TRUE(extra_data); |
1994 EXPECT_EQ(extra_data->service_worker_provider_id(), | 1994 EXPECT_EQ(extra_data->service_worker_provider_id(), |
1995 provider->provider_id()); | 1995 provider->provider_id()); |
1996 | 1996 |
1997 // See that subresource requests are also tagged with the provider's id. | 1997 // See that subresource requests are also tagged with the provider's id. |
1998 EXPECT_EQ(frame(), RenderFrameImpl::FromWebFrame(GetMainFrame())); | 1998 EXPECT_EQ(frame(), RenderFrameImpl::FromWebFrame(GetMainFrame())); |
1999 blink::WebURLRequest request(GURL("http://foo.com")); | 1999 blink::WebURLRequest request(GURL("http://foo.com")); |
2000 request.setRequestContext(blink::WebURLRequest::RequestContextSubresource); | 2000 request.setRequestContext(blink::WebURLRequest::RequestContextSubresource); |
2001 blink::WebURLResponse redirect_response; | 2001 blink::WebURLResponse redirect_response; |
2002 frame()->willSendRequest(GetMainFrame(), 0, request, redirect_response); | 2002 frame()->willSendRequest(GetMainFrame(), request); |
2003 extra_data = static_cast<RequestExtraData*>(request.getExtraData()); | 2003 extra_data = static_cast<RequestExtraData*>(request.getExtraData()); |
2004 ASSERT_TRUE(extra_data); | 2004 ASSERT_TRUE(extra_data); |
2005 EXPECT_EQ(extra_data->service_worker_provider_id(), | 2005 EXPECT_EQ(extra_data->service_worker_provider_id(), |
2006 provider->provider_id()); | 2006 provider->provider_id()); |
2007 } | 2007 } |
2008 | 2008 |
2009 TEST_F(RenderViewImplTest, OnSetAccessibilityMode) { | 2009 TEST_F(RenderViewImplTest, OnSetAccessibilityMode) { |
2010 ASSERT_EQ(AccessibilityModeOff, frame()->accessibility_mode()); | 2010 ASSERT_EQ(AccessibilityModeOff, frame()->accessibility_mode()); |
2011 ASSERT_FALSE(frame()->render_accessibility()); | 2011 ASSERT_FALSE(frame()->render_accessibility()); |
2012 | 2012 |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2480 ExpectPauseAndResume(3); | 2480 ExpectPauseAndResume(3); |
2481 blink::WebScriptSource source2( | 2481 blink::WebScriptSource source2( |
2482 WebString::fromUTF8("function func2() { func1(); }; func2();")); | 2482 WebString::fromUTF8("function func2() { func1(); }; func2();")); |
2483 frame()->GetWebFrame()->executeScriptInIsolatedWorld(17, &source2, 1, 1); | 2483 frame()->GetWebFrame()->executeScriptInIsolatedWorld(17, &source2, 1, 1); |
2484 | 2484 |
2485 EXPECT_FALSE(IsPaused()); | 2485 EXPECT_FALSE(IsPaused()); |
2486 Detach(); | 2486 Detach(); |
2487 } | 2487 } |
2488 | 2488 |
2489 } // namespace content | 2489 } // namespace content |
OLD | NEW |