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

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

Issue 2499313003: Set user_gesture bit at NavigationHandle creation time. (Closed)
Patch Set: rebase Created 4 years 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 | « content/browser/frame_host/navigator_impl.cc ('k') | content/browser/frame_host/render_frame_host_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..5f681a91590c3f0db244a0789861736e5b464f2d 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->common_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->common_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->common_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->common_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->common_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->common_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->common_params().gesture);
if (SiteIsolationPolicy::AreCrossProcessFramesPossible()) {
EXPECT_TRUE(GetSpeculativeRenderFrameHost(node));
} else {
« no previous file with comments | « content/browser/frame_host/navigator_impl.cc ('k') | content/browser/frame_host/render_frame_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698