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