Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Side by Side Diff: content/renderer/render_view_browsertest.cc

Issue 2448543002: Remove dead paint flush tracking code. (Closed)
Patch Set: rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/public/renderer/document_state.h ('k') | content/renderer/render_view_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 886 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 const IPC::Message* frame_navigate_msg = 897 const IPC::Message* frame_navigate_msg =
898 render_thread_->sink().GetUniqueMessageMatching( 898 render_thread_->sink().GetUniqueMessageMatching(
899 FrameHostMsg_DidCommitProvisionalLoad::ID); 899 FrameHostMsg_DidCommitProvisionalLoad::ID);
900 EXPECT_FALSE(frame_navigate_msg); 900 EXPECT_FALSE(frame_navigate_msg);
901 901
902 // Detach the provisional frame to clean it up. Normally, the browser 902 // Detach the provisional frame to clean it up. Normally, the browser
903 // process would trigger this via FrameMsg_Delete. 903 // process would trigger this via FrameMsg_Delete.
904 provisional_frame->GetWebFrame()->detach(); 904 provisional_frame->GetWebFrame()->detach();
905 } 905 }
906 906
907 // Verify that DidFlushPaint doesn't crash if called after a RenderView is
908 // swapped out. See https://crbug.com/513552.
909 TEST_F(RenderViewImplTest, PaintAfterSwapOut) {
910 // Create a new main frame RenderFrame so that we don't interfere with the
911 // shutdown of frame() in RenderViewTest.TearDown.
912 blink::WebURLRequest popup_request(GURL("http://foo.com"));
913 blink::WebView* new_web_view = view()->createView(
914 GetMainFrame(), popup_request, blink::WebWindowFeatures(), "foo",
915 blink::WebNavigationPolicyNewForegroundTab, false);
916 RenderViewImpl* new_view = RenderViewImpl::FromWebView(new_web_view);
917
918 // Respond to a swap out request.
919 TestRenderFrame* new_main_frame =
920 static_cast<TestRenderFrame*>(new_view->GetMainRenderFrame());
921 new_main_frame->SwapOut(
922 kProxyRoutingId, true,
923 ReconstructReplicationStateForTesting(new_main_frame));
924
925 // Simulate getting painted after swapping out.
926 new_view->DidFlushPaint();
927
928 CloseRenderView(new_view);
929 }
930
931 // Verify that the renderer process doesn't crash when device scale factor 907 // Verify that the renderer process doesn't crash when device scale factor
932 // changes after a cross-process navigation has commited. 908 // changes after a cross-process navigation has commited.
933 // See https://crbug.com/571603. 909 // See https://crbug.com/571603.
934 TEST_F(RenderViewImplTest, SetZoomLevelAfterCrossProcessNavigation) { 910 TEST_F(RenderViewImplTest, SetZoomLevelAfterCrossProcessNavigation) {
935 // This test should only run with out-of-process iframes enabled. 911 // This test should only run with out-of-process iframes enabled.
936 if (!SiteIsolationPolicy::AreCrossProcessFramesPossible()) 912 if (!SiteIsolationPolicy::AreCrossProcessFramesPossible())
937 return; 913 return;
938 914
939 // The bug reproduces if zoom is used for devices scale factor. 915 // The bug reproduces if zoom is used for devices scale factor.
940 base::CommandLine::ForCurrentProcess()->AppendSwitch( 916 base::CommandLine::ForCurrentProcess()->AppendSwitch(
(...skipping 1572 matching lines...) Expand 10 before | Expand all | Expand 10 after
2513 ExpectPauseAndResume(3); 2489 ExpectPauseAndResume(3);
2514 blink::WebScriptSource source2( 2490 blink::WebScriptSource source2(
2515 WebString::fromUTF8("function func2() { func1(); }; func2();")); 2491 WebString::fromUTF8("function func2() { func1(); }; func2();"));
2516 frame()->GetWebFrame()->executeScriptInIsolatedWorld(17, &source2, 1, 1); 2492 frame()->GetWebFrame()->executeScriptInIsolatedWorld(17, &source2, 1, 1);
2517 2493
2518 EXPECT_FALSE(IsPaused()); 2494 EXPECT_FALSE(IsPaused());
2519 Detach(); 2495 Detach();
2520 } 2496 }
2521 2497
2522 } // namespace content 2498 } // namespace content
OLDNEW
« no previous file with comments | « content/public/renderer/document_state.h ('k') | content/renderer/render_view_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698