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

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

Issue 2171063002: Notify the Blink client synchronously if the initial doc is accessed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comments. Created 4 years, 5 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/core/page/ScopedPageLoadDeferrer.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/WebFrameTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
index 142b51a4ca8140cb6d43336340496d05578b9ac5..722a3a33becd9c6c359477b6f1a6ace9b09f0896 100644
--- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -5543,13 +5543,13 @@ TEST_P(ParameterizedWebFrameTest, DidAccessInitialDocumentBodyBeforeModalDialog)
runPendingTasks();
EXPECT_FALSE(webFrameClient.m_didAccessInitialDocument);
- // Access the initial document by modifying the body. We normally set a
- // timer to notify the client.
+ // Access the initial document by modifying the body.
newView->mainFrame()->executeScript(
WebScriptSource("window.opener.document.body.innerHTML += 'Modified';"));
- EXPECT_FALSE(webFrameClient.m_didAccessInitialDocument);
+ EXPECT_TRUE(webFrameClient.m_didAccessInitialDocument);
- // Make sure that a modal dialog forces us to notify right away.
+ // Run a modal dialog, which used to run a nested message loop and require
+ // a special case for notifying about the access.
newView->mainFrame()->executeScript(
WebScriptSource("window.opener.confirm('Modal');"));
EXPECT_TRUE(webFrameClient.m_didAccessInitialDocument);
@@ -5583,13 +5583,13 @@ TEST_P(ParameterizedWebFrameTest, DidWriteToInitialDocumentBeforeModalDialog)
EXPECT_FALSE(webFrameClient.m_didAccessInitialDocument);
// Access the initial document with document.write, which moves us past the
- // initial empty document state of the state machine. We normally set a
- // timer to notify the client.
+ // initial empty document state of the state machine.
newView->mainFrame()->executeScript(
WebScriptSource("window.opener.document.write('Modified'); window.opener.document.close();"));
- EXPECT_FALSE(webFrameClient.m_didAccessInitialDocument);
+ EXPECT_TRUE(webFrameClient.m_didAccessInitialDocument);
- // Make sure that a modal dialog forces us to notify right away.
+ // Run a modal dialog, which used to run a nested message loop and require
+ // a special case for notifying about the access.
newView->mainFrame()->executeScript(
WebScriptSource("window.opener.confirm('Modal');"));
EXPECT_TRUE(webFrameClient.m_didAccessInitialDocument);
« no previous file with comments | « third_party/WebKit/Source/core/page/ScopedPageLoadDeferrer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698