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

Unified Diff: content/browser/frame_host/navigator_impl_unittest.cc

Issue 2499313003: Set user_gesture bit at NavigationHandle creation time. (Closed)
Patch Set: remove gesture dcheck Created 4 years, 1 month 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
Index: content/browser/frame_host/navigator_impl_unittest.cc
diff --git a/content/browser/frame_host/navigator_impl_unittest.cc b/content/browser/frame_host/navigator_impl_unittest.cc
index 5cbcfc1bc2199b14f7cbf9d6ddfb9a40698f62ab..292d0b750c9316e6c7abeb629478d8f974620b40 100644
--- a/content/browser/frame_host/navigator_impl_unittest.cc
+++ b/content/browser/frame_host/navigator_impl_unittest.cc
@@ -184,7 +184,7 @@ TEST_F(NavigatorTestWithBrowserSideNavigation,
// The navigation is immediately started as there's no need to wait for
// beforeUnload to be executed.
EXPECT_EQ(NavigationRequest::STARTED, request->state());
- EXPECT_FALSE(request->begin_params().has_user_gesture);
+ EXPECT_EQ(NavigationGestureAuto, request->begin_params().gesture);
EXPECT_EQ(kUrl2, request->common_params().url);
EXPECT_FALSE(request->browser_initiated());
EXPECT_FALSE(GetSpeculativeRenderFrameHost(node));
@@ -229,7 +229,7 @@ TEST_F(NavigatorTestWithBrowserSideNavigation,
// The navigation is immediately started as there's no need to wait for
// beforeUnload to be executed.
EXPECT_EQ(NavigationRequest::STARTED, request->state());
- EXPECT_FALSE(request->begin_params().has_user_gesture);
+ EXPECT_EQ(NavigationGestureAuto, request->begin_params().gesture);
EXPECT_EQ(kUrl2, request->common_params().url);
EXPECT_FALSE(request->browser_initiated());
if (SiteIsolationPolicy::AreCrossProcessFramesPossible()) {
@@ -619,7 +619,7 @@ TEST_F(NavigatorTestWithBrowserSideNavigation,
ASSERT_TRUE(request2);
EXPECT_EQ(kUrl2, request2->common_params().url);
EXPECT_FALSE(request2->browser_initiated());
- EXPECT_TRUE(request2->begin_params().has_user_gesture);
+ EXPECT_EQ(NavigationGestureUser, request2->begin_params().gesture);
// Confirm that the first loader got destroyed.
EXPECT_FALSE(loader1);
@@ -671,7 +671,7 @@ TEST_F(NavigatorTestWithBrowserSideNavigation,
ASSERT_TRUE(request1);
EXPECT_EQ(kUrl1, request1->common_params().url);
EXPECT_FALSE(request1->browser_initiated());
- EXPECT_TRUE(request1->begin_params().has_user_gesture);
+ EXPECT_EQ(NavigationGestureUser, request1->begin_params().gesture);
if (SiteIsolationPolicy::AreCrossProcessFramesPossible()) {
EXPECT_TRUE(GetSpeculativeRenderFrameHost(node));
} else {
@@ -686,7 +686,7 @@ TEST_F(NavigatorTestWithBrowserSideNavigation,
EXPECT_EQ(request1, request2);
EXPECT_EQ(kUrl1, request2->common_params().url);
EXPECT_FALSE(request2->browser_initiated());
- EXPECT_TRUE(request2->begin_params().has_user_gesture);
+ EXPECT_EQ(NavigationGestureUser, request2->begin_params().gesture);
if (SiteIsolationPolicy::AreCrossProcessFramesPossible()) {
EXPECT_TRUE(GetSpeculativeRenderFrameHost(node));
} else {
@@ -777,7 +777,7 @@ TEST_F(NavigatorTestWithBrowserSideNavigation,
ASSERT_TRUE(request1);
EXPECT_EQ(kUrl1, request1->common_params().url);
EXPECT_FALSE(request1->browser_initiated());
- EXPECT_FALSE(request1->begin_params().has_user_gesture);
+ EXPECT_EQ(NavigationGestureAuto, request1->begin_params().gesture);
if (SiteIsolationPolicy::AreCrossProcessFramesPossible()) {
EXPECT_TRUE(GetSpeculativeRenderFrameHost(node));
} else {
@@ -792,7 +792,7 @@ TEST_F(NavigatorTestWithBrowserSideNavigation,
NavigationRequest* request2 = node->navigation_request();
EXPECT_EQ(kUrl2, request2->common_params().url);
EXPECT_FALSE(request2->browser_initiated());
- EXPECT_FALSE(request2->begin_params().has_user_gesture);
+ EXPECT_EQ(NavigationGestureAuto, request2->begin_params().gesture);
if (SiteIsolationPolicy::AreCrossProcessFramesPossible()) {
EXPECT_TRUE(GetSpeculativeRenderFrameHost(node));
} else {

Powered by Google App Engine
This is Rietveld 408576698