| 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 "core/dom/CrossThreadTask.h" | 5 #include "core/dom/ExecutionContextTask.h" |
| 6 | 6 |
| 7 #include "platform/heap/Handle.h" | 7 #include "platform/heap/Handle.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 { |
| 11 | 11 |
| 12 class GCObject : public GarbageCollectedFinalized<GCObject> { | 12 class GCObject : public GarbageCollectedFinalized<GCObject> { |
| 13 public: | 13 public: |
| 14 static int s_counter; | 14 static int s_counter; |
| 15 GCObject() { ++s_counter; } | 15 GCObject() { ++s_counter; } |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 | 59 |
| 60 TEST_F(CrossThreadTaskTest, CreateForFunctionWithExecutionContext) | 60 TEST_F(CrossThreadTaskTest, CreateForFunctionWithExecutionContext) |
| 61 { | 61 { |
| 62 std::unique_ptr<ExecutionContextTask> task1 = createCrossThreadTask(&functio
nWithExecutionContext, wrapCrossThreadPersistent(new GCObject)); | 62 std::unique_ptr<ExecutionContextTask> task1 = createCrossThreadTask(&functio
nWithExecutionContext, wrapCrossThreadPersistent(new GCObject)); |
| 63 std::unique_ptr<ExecutionContextTask> task2 = createCrossThreadTask(&functio
nWithExecutionContext, wrapCrossThreadPersistent(new GCObject)); | 63 std::unique_ptr<ExecutionContextTask> task2 = createCrossThreadTask(&functio
nWithExecutionContext, wrapCrossThreadPersistent(new GCObject)); |
| 64 ThreadHeap::collectGarbage(BlinkGC::NoHeapPointersOnStack, BlinkGC::GCWithSw
eep, BlinkGC::ForcedGC); | 64 ThreadHeap::collectGarbage(BlinkGC::NoHeapPointersOnStack, BlinkGC::GCWithSw
eep, BlinkGC::ForcedGC); |
| 65 EXPECT_EQ(2, GCObject::s_counter); | 65 EXPECT_EQ(2, GCObject::s_counter); |
| 66 } | 66 } |
| 67 | 67 |
| 68 } // namespace blink | 68 } // namespace blink |
| OLD | NEW |