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

Unified Diff: third_party/WebKit/Source/web/tests/WebViewTest.cpp

Issue 2616513002: Make sure pages that are closing but not yet closed are still suspended. (Closed)
Patch Set: Created 3 years, 12 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 | « third_party/WebKit/Source/web/tests/ChromeClientImplTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/tests/WebViewTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/WebViewTest.cpp b/third_party/WebKit/Source/web/tests/WebViewTest.cpp
index 3cb8d703df557a0d9e11c8eb3c091be0f6efc834..6ac3a95a5341d8d54bbe75a933a3383802f59d69 100644
--- a/third_party/WebKit/Source/web/tests/WebViewTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebViewTest.cpp
@@ -4220,6 +4220,29 @@ TEST_P(WebViewTest, NestedPageSuspensions) {
EXPECT_FALSE(webView->page()->suspended());
}
+TEST_P(WebViewTest, ClosingPageIsSuspended) {
+ WebViewImpl* webView = m_webViewHelper.initialize();
+ Page* page = m_webViewHelper.webView()->page();
+ EXPECT_FALSE(page->suspended());
+
+ webView->setOpenedByDOM();
+
+ LocalFrame* mainFrame = toLocalFrame(page->mainFrame());
+ EXPECT_FALSE(mainFrame->domWindow()->closed());
+
+ mainFrame->domWindow()->close(nullptr);
+ // The window should be marked closed...
+ EXPECT_TRUE(mainFrame->domWindow()->closed());
+ // EXPECT_TRUE(page->isClosing());
+ // ...but not yet detached.
+ EXPECT_TRUE(mainFrame->host());
+
+ {
+ ScopedPageSuspender suspender;
+ EXPECT_TRUE(page->suspended());
+ }
+}
+
TEST_P(WebViewTest, ForceAndResetViewport) {
URLTestHelpers::registerMockedURLFromBaseURL(
WebString::fromUTF8(m_baseURL.c_str()),
« no previous file with comments | « third_party/WebKit/Source/web/tests/ChromeClientImplTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698