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

Unified Diff: Source/web/tests/PinchViewportTest.cpp

Issue 1052993006: Refactor frame navigation/detach state cleanup to be more sane. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Minor test cleanup Created 5 years, 8 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/web/tests/FrameTestHelpers.cpp ('k') | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/tests/PinchViewportTest.cpp
diff --git a/Source/web/tests/PinchViewportTest.cpp b/Source/web/tests/PinchViewportTest.cpp
index bdda29f434c3b1a0a5a681d81ccf81430bcc19a3..25c1be74dce5fa2b6b576da0cbd3637b62953309 100644
--- a/Source/web/tests/PinchViewportTest.cpp
+++ b/Source/web/tests/PinchViewportTest.cpp
@@ -1547,10 +1547,15 @@ TEST_F(PinchViewportTest, TestMainFrameInitializationSizing)
navigateTo(m_baseURL + "content-width-1000-min-scale.html");
WebLocalFrameImpl* localFrame = webViewImpl()->mainFrameImpl();
+ // The prepareForDestruction() and prepareForDetach() calls are a hack to
+ // prevent createView() from violating invariants about frame state during
+ // navigation/detach.
+ localFrame->frame()->document()->prepareForDestruction();
localFrame->createFrameView();
FrameView& frameView = *localFrame->frameView();
EXPECT_SIZE_EQ(IntSize(200, 400), frameView.frameRect().size());
+ frameView.prepareForDetach();
}
// Tests that the maximum scroll offset of the viewport can be fractional.
« no previous file with comments | « Source/web/tests/FrameTestHelpers.cpp ('k') | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698