| 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/IntersectionObserver.h" | 5 #include "core/dom/IntersectionObserver.h" |
| 6 | 6 |
| 7 #include "core/dom/IntersectionObserverCallback.h" | 7 #include "core/dom/IntersectionObserverCallback.h" |
| 8 #include "core/dom/IntersectionObserverInit.h" | 8 #include "core/dom/IntersectionObserverInit.h" |
| 9 #include "core/exported/WebViewBase.h" |
| 9 #include "core/frame/FrameView.h" | 10 #include "core/frame/FrameView.h" |
| 10 #include "platform/testing/UnitTestHelpers.h" | 11 #include "platform/testing/UnitTestHelpers.h" |
| 11 #include "platform/wtf/CurrentTime.h" | 12 #include "platform/wtf/CurrentTime.h" |
| 12 #include "web/WebViewImpl.h" | |
| 13 #include "web/tests/sim/SimCompositor.h" | 13 #include "web/tests/sim/SimCompositor.h" |
| 14 #include "web/tests/sim/SimDisplayItemList.h" | 14 #include "web/tests/sim/SimDisplayItemList.h" |
| 15 #include "web/tests/sim/SimRequest.h" | 15 #include "web/tests/sim/SimRequest.h" |
| 16 #include "web/tests/sim/SimTest.h" | 16 #include "web/tests/sim/SimTest.h" |
| 17 | 17 |
| 18 namespace blink { | 18 namespace blink { |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 class TestIntersectionObserverCallback : public IntersectionObserverCallback { | 22 class TestIntersectionObserverCallback : public IntersectionObserverCallback { |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 // those notifications should be discarded. | 156 // those notifications should be discarded. |
| 157 GetDocument().View()->LayoutViewportScrollableArea()->SetScrollOffset( | 157 GetDocument().View()->LayoutViewportScrollableArea()->SetScrollOffset( |
| 158 ScrollOffset(0, 300), kProgrammaticScroll); | 158 ScrollOffset(0, 300), kProgrammaticScroll); |
| 159 Compositor().BeginFrame(); | 159 Compositor().BeginFrame(); |
| 160 observer->disconnect(); | 160 observer->disconnect(); |
| 161 testing::RunPendingTasks(); | 161 testing::RunPendingTasks(); |
| 162 EXPECT_EQ(observer_callback->CallCount(), 1); | 162 EXPECT_EQ(observer_callback->CallCount(), 1); |
| 163 } | 163 } |
| 164 | 164 |
| 165 } // namespace blink | 165 } // namespace blink |
| OLD | NEW |