| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "config.h" | 5 #include "config.h" |
| 6 #include "core/page/scrolling/ScrollState.h" | 6 #include "core/page/scrolling/ScrollState.h" |
| 7 | 7 |
| 8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
| 9 #include "core/dom/Element.h" | 9 #include "core/dom/Element.h" |
| 10 #include <gtest/gtest.h> | 10 #include <gtest/gtest.h> |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 { | 56 { |
| 57 RefPtrWillBeRawPtr<ScrollState> scrollState = | 57 RefPtrWillBeRawPtr<ScrollState> scrollState = |
| 58 ScrollState::create(0, 0, 0, 0, 0, false, false); | 58 ScrollState::create(0, 0, 0, 0, 0, false, false); |
| 59 RefPtrWillBeRawPtr<Element> element = Element::create( | 59 RefPtrWillBeRawPtr<Element> element = Element::create( |
| 60 QualifiedName::null(), Document::create().get()); | 60 QualifiedName::null(), Document::create().get()); |
| 61 scrollState->setCurrentNativeScrollingElement(element.get()); | 61 scrollState->setCurrentNativeScrollingElement(element.get()); |
| 62 | 62 |
| 63 EXPECT_EQ(element, scrollState->currentNativeScrollingElement()); | 63 EXPECT_EQ(element, scrollState->currentNativeScrollingElement()); |
| 64 } | 64 } |
| 65 | 65 |
| 66 TEST_F(ScrollStateTest, FullyConsumed) |
| 67 { |
| 68 RefPtrWillBeRawPtr<ScrollState> scrollStateBegin = |
| 69 ScrollState::create(0, 0, 0, 0, 0, false, true, false); |
| 70 RefPtrWillBeRawPtr<ScrollState> scrollState = |
| 71 ScrollState::create(0, 0, 0, 0, 0, false, false, false); |
| 72 RefPtrWillBeRawPtr<ScrollState> scrollStateEnd = |
| 73 ScrollState::create(0, 0, 0, 0, 0, false, false, true); |
| 74 EXPECT_FALSE(scrollStateBegin->fullyConsumed()); |
| 75 EXPECT_TRUE(scrollState->fullyConsumed()); |
| 76 EXPECT_FALSE(scrollStateEnd->fullyConsumed()); |
| 66 } | 77 } |
| 78 |
| 79 } |
| OLD | NEW |