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. |