| 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 "modules/csspaint/PaintWorklet.h" | 5 #include "modules/csspaint/PaintWorklet.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 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 "bindings/core/v8/WorkerOrWorkletScriptController.h" | 10 #include "bindings/core/v8/WorkerOrWorkletScriptController.h" |
| 11 #include "core/frame/LocalFrame.h" | 11 #include "core/frame/LocalFrame.h" |
| 12 #include "core/testing/DummyPageHolder.h" | 12 #include "core/testing/DummyPageHolder.h" |
| 13 #include "modules/csspaint/CSSPaintDefinition.h" | 13 #include "modules/csspaint/CSSPaintDefinition.h" |
| 14 #include "modules/csspaint/PaintWorkletGlobalScope.h" | 14 #include "modules/csspaint/PaintWorkletGlobalScope.h" |
| 15 #include "modules/csspaint/PaintWorkletGlobalScopeProxy.h" | 15 #include "modules/csspaint/PaintWorkletGlobalScopeProxy.h" |
| 16 #include "modules/csspaint/WindowPaintWorklet.h" | 16 #include "modules/csspaint/WindowPaintWorklet.h" |
| 17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
| 18 | 18 |
| 19 namespace blink { | 19 namespace blink { |
| 20 | 20 |
| 21 class PaintWorkletTest : public testing::Test { | 21 class PaintWorkletTest : public ::testing::Test { |
| 22 public: | 22 public: |
| 23 PaintWorkletTest() : page_(DummyPageHolder::Create()) {} | 23 PaintWorkletTest() : page_(DummyPageHolder::Create()) {} |
| 24 | 24 |
| 25 void SetUp() override { proxy_ = GetPaintWorklet()->CreateGlobalScope(); } | 25 void SetUp() override { proxy_ = GetPaintWorklet()->CreateGlobalScope(); } |
| 26 | 26 |
| 27 PaintWorklet* GetPaintWorklet() { | 27 PaintWorklet* GetPaintWorklet() { |
| 28 return WindowPaintWorklet::From(*page_->GetFrame().DomWindow()) | 28 return WindowPaintWorklet::From(*page_->GetFrame().DomWindow()) |
| 29 .paintWorklet(); | 29 .paintWorklet(); |
| 30 } | 30 } |
| 31 | 31 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 // Delete the page & associated objects. | 74 // Delete the page & associated objects. |
| 75 Terminate(); | 75 Terminate(); |
| 76 | 76 |
| 77 // Run a GC, the persistent should have been collected. | 77 // Run a GC, the persistent should have been collected. |
| 78 ThreadState::Current()->CollectAllGarbage(); | 78 ThreadState::Current()->CollectAllGarbage(); |
| 79 V8GCController::CollectAllGarbageForTesting(isolate); | 79 V8GCController::CollectAllGarbageForTesting(isolate); |
| 80 DCHECK(handle.IsEmpty()); | 80 DCHECK(handle.IsEmpty()); |
| 81 } | 81 } |
| 82 | 82 |
| 83 } // namespace blink | 83 } // namespace blink |
| OLD | NEW |