OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/dom/DocumentUserGestureToken.h" | 5 #include "core/dom/DocumentUserGestureToken.h" |
6 | 6 |
7 #include "core/testing/DummyPageHolder.h" | 7 #include "core/testing/DummyPageHolder.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 UserGestureToken::kNewGesture); | 43 UserGestureToken::kNewGesture); |
44 EXPECT_TRUE(GetDocument().GetFrame()->HasReceivedUserGesture()); | 44 EXPECT_TRUE(GetDocument().GetFrame()->HasReceivedUserGesture()); |
45 } | 45 } |
46 | 46 |
47 TEST_F(DocumentUserGestureTokenTest, Navigate) { | 47 TEST_F(DocumentUserGestureTokenTest, Navigate) { |
48 DocumentUserGestureToken::Create(&GetDocument()); | 48 DocumentUserGestureToken::Create(&GetDocument()); |
49 ASSERT_TRUE(GetDocument().GetFrame()->HasReceivedUserGesture()); | 49 ASSERT_TRUE(GetDocument().GetFrame()->HasReceivedUserGesture()); |
50 | 50 |
51 // Navigate to a different Document. In the main frame, user gesture state | 51 // Navigate to a different Document. In the main frame, user gesture state |
52 // will get reset. | 52 // will get reset. |
53 GetDocument().GetFrame()->Loader().Load(FrameLoadRequest(nullptr, KURL())); | 53 GetDocument().GetFrame()->Loader().Load( |
| 54 FrameLoadRequest(nullptr, ResourceRequest())); |
54 EXPECT_FALSE(GetDocument().GetFrame()->HasReceivedUserGesture()); | 55 EXPECT_FALSE(GetDocument().GetFrame()->HasReceivedUserGesture()); |
55 } | 56 } |
56 | 57 |
57 } // namespace blink | 58 } // namespace blink |
OLD | NEW |