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

Unified Diff: third_party/WebKit/Source/core/dom/DocumentUserGestureTokenTest.cpp

Issue 2721423003: Reset Frame::m_hasReceivedUserGesture for main frames on navigation (Closed)
Patch Set: One bit, reset for main frames on commit Created 3 years, 9 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 | « no previous file | third_party/WebKit/Source/core/frame/LocalFrame.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/DocumentUserGestureTokenTest.cpp
diff --git a/third_party/WebKit/Source/core/dom/DocumentUserGestureTokenTest.cpp b/third_party/WebKit/Source/core/dom/DocumentUserGestureTokenTest.cpp
index 012498fd4910732bfe87f415a45de1d69ee8adf1..cda87076f0951bef2ed302be46118df2e8bcbcfc 100644
--- a/third_party/WebKit/Source/core/dom/DocumentUserGestureTokenTest.cpp
+++ b/third_party/WebKit/Source/core/dom/DocumentUserGestureTokenTest.cpp
@@ -43,4 +43,14 @@ TEST_F(DocumentUserGestureTokenTest, NewGesture) {
EXPECT_TRUE(document().frame()->hasReceivedUserGesture());
}
+TEST_F(DocumentUserGestureTokenTest, Navigate) {
+ DocumentUserGestureToken::create(&document());
+ ASSERT_TRUE(document().frame()->hasReceivedUserGesture());
+
+ // Navigate to a different Document. In the main frame, user gesture state
+ // will get reset.
+ document().frame()->loader().load(FrameLoadRequest(nullptr, KURL()));
+ EXPECT_FALSE(document().frame()->hasReceivedUserGesture());
+}
+
} // namespace blink
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/LocalFrame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698