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/ResizeObserver.h" | 5 #include "core/dom/ResizeObserver.h" |
6 | 6 |
7 #include "bindings/core/v8/ScriptController.h" | 7 #include "bindings/core/v8/ScriptController.h" |
8 #include "bindings/core/v8/ScriptSourceCode.h" | 8 #include "bindings/core/v8/ScriptSourceCode.h" |
9 #include "bindings/core/v8/V8GCController.h" | 9 #include "bindings/core/v8/V8GCController.h" |
10 #include "core/dom/ResizeObservation.h" | 10 #include "core/dom/ResizeObservation.h" |
11 #include "core/dom/ResizeObserverCallback.h" | 11 #include "core/dom/ResizeObserverCallback.h" |
12 #include "core/dom/ResizeObserverController.h" | 12 #include "core/dom/ResizeObserverController.h" |
13 #include "platform/testing/UnitTestHelpers.h" | 13 #include "platform/testing/UnitTestHelpers.h" |
| 14 #include "platform/wtf/CurrentTime.h" |
14 #include "public/web/WebHeap.h" | 15 #include "public/web/WebHeap.h" |
15 #include "web/WebViewImpl.h" | 16 #include "web/WebViewImpl.h" |
16 #include "web/tests/sim/SimCompositor.h" | 17 #include "web/tests/sim/SimCompositor.h" |
17 #include "web/tests/sim/SimDisplayItemList.h" | 18 #include "web/tests/sim/SimDisplayItemList.h" |
18 #include "web/tests/sim/SimRequest.h" | 19 #include "web/tests/sim/SimRequest.h" |
19 #include "web/tests/sim/SimTest.h" | 20 #include "web/tests/sim/SimTest.h" |
20 #include "wtf/CurrentTime.h" | |
21 | 21 |
22 namespace blink { | 22 namespace blink { |
23 | 23 |
24 namespace { | 24 namespace { |
25 | 25 |
26 class TestResizeObserverCallback : public ResizeObserverCallback { | 26 class TestResizeObserverCallback : public ResizeObserverCallback { |
27 public: | 27 public: |
28 TestResizeObserverCallback(Document& document) | 28 TestResizeObserverCallback(Document& document) |
29 : m_document(document), m_callCount(0) {} | 29 : m_document(document), m_callCount(0) {} |
30 void handleEvent(const HeapVector<Member<ResizeObserverEntry>>& entries, | 30 void handleEvent(const HeapVector<Member<ResizeObserverEntry>>& entries, |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 ASSERT_EQ(observers.size(), 1U); | 138 ASSERT_EQ(observers.size(), 1U); |
139 script.executeScriptInMainWorldAndReturnValue( | 139 script.executeScriptInMainWorldAndReturnValue( |
140 ScriptSourceCode("el = undefined;"), | 140 ScriptSourceCode("el = undefined;"), |
141 ScriptController::ExecuteScriptWhenScriptsDisabled); | 141 ScriptController::ExecuteScriptWhenScriptsDisabled); |
142 V8GCController::collectAllGarbageForTesting(v8::Isolate::GetCurrent()); | 142 V8GCController::collectAllGarbageForTesting(v8::Isolate::GetCurrent()); |
143 WebHeap::collectAllGarbageForTesting(); | 143 WebHeap::collectAllGarbageForTesting(); |
144 ASSERT_EQ(observers.isEmpty(), true); | 144 ASSERT_EQ(observers.isEmpty(), true); |
145 } | 145 } |
146 | 146 |
147 } // namespace blink | 147 } // namespace blink |
OLD | NEW |