Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Unified Diff: third_party/WebKit/Source/core/dom/ExecutionContextTaskTest.cpp

Issue 2856773003: Remove deprecated ExecutionContextTask (Closed)
Patch Set: restore private / rebase Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/ExecutionContextTaskTest.cpp
diff --git a/third_party/WebKit/Source/core/dom/ExecutionContextTaskTest.cpp b/third_party/WebKit/Source/core/dom/ExecutionContextTaskTest.cpp
deleted file mode 100644
index fda9540b9cc2f4aa754165b52434e6977b4b656f..0000000000000000000000000000000000000000
--- a/third_party/WebKit/Source/core/dom/ExecutionContextTaskTest.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "core/dom/ExecutionContextTask.h"
-
-#include "platform/heap/Handle.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace blink {
-
-class GCObject : public GarbageCollectedFinalized<GCObject> {
- public:
- static int counter_;
- GCObject() { ++counter_; }
- ~GCObject() { --counter_; }
- DEFINE_INLINE_TRACE() {}
- void Run(GCObject*) {}
-};
-
-int GCObject::counter_ = 0;
-
-static void FunctionWithGarbageCollected(GCObject*) {}
-
-static void FunctionWithExecutionContext(GCObject*, ExecutionContext*) {}
-
-class CrossThreadTaskTest : public testing::Test {
- protected:
- void SetUp() override { GCObject::counter_ = 0; }
- void TearDown() override {
- ThreadState::Current()->CollectGarbage(BlinkGC::kNoHeapPointersOnStack,
- BlinkGC::kGCWithSweep,
- BlinkGC::kForcedGC);
- ASSERT_EQ(0, GCObject::counter_);
- }
-};
-
-TEST_F(CrossThreadTaskTest, CreateForGarbageCollectedMethod) {
- std::unique_ptr<ExecutionContextTask> task1 = CreateCrossThreadTask(
- &GCObject::Run, WrapCrossThreadPersistent(new GCObject),
- WrapCrossThreadPersistent(new GCObject));
- std::unique_ptr<ExecutionContextTask> task2 = CreateCrossThreadTask(
- &GCObject::Run, WrapCrossThreadPersistent(new GCObject),
- WrapCrossThreadPersistent(new GCObject));
- ThreadState::Current()->CollectGarbage(BlinkGC::kNoHeapPointersOnStack,
- BlinkGC::kGCWithSweep,
- BlinkGC::kForcedGC);
- EXPECT_EQ(4, GCObject::counter_);
-}
-
-TEST_F(CrossThreadTaskTest, CreateForFunctionWithGarbageCollected) {
- std::unique_ptr<ExecutionContextTask> task1 = CreateCrossThreadTask(
- &FunctionWithGarbageCollected, WrapCrossThreadPersistent(new GCObject));
- std::unique_ptr<ExecutionContextTask> task2 = CreateCrossThreadTask(
- &FunctionWithGarbageCollected, WrapCrossThreadPersistent(new GCObject));
- ThreadState::Current()->CollectGarbage(BlinkGC::kNoHeapPointersOnStack,
- BlinkGC::kGCWithSweep,
- BlinkGC::kForcedGC);
- EXPECT_EQ(2, GCObject::counter_);
-}
-
-TEST_F(CrossThreadTaskTest, CreateForFunctionWithExecutionContext) {
- std::unique_ptr<ExecutionContextTask> task1 = CreateCrossThreadTask(
- &FunctionWithExecutionContext, WrapCrossThreadPersistent(new GCObject));
- std::unique_ptr<ExecutionContextTask> task2 = CreateCrossThreadTask(
- &FunctionWithExecutionContext, WrapCrossThreadPersistent(new GCObject));
- ThreadState::Current()->CollectGarbage(BlinkGC::kNoHeapPointersOnStack,
- BlinkGC::kGCWithSweep,
- BlinkGC::kForcedGC);
- EXPECT_EQ(2, GCObject::counter_);
-}
-
-} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698