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

Unified Diff: test/cctest/wasm/test-managed.cc

Issue 2676513008: [wasm] Managed<T> ensures T's lifetime does not leak past Isolate's (Closed)
Patch Set: renamed to ManagedObjectFinalizer, and using "finalizer"` Created 3 years, 10 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
« no previous file with comments | « test/cctest/test-managed.cc ('k') | test/cctest/wasm/wasm-run-utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/wasm/test-managed.cc
diff --git a/test/cctest/wasm/test-managed.cc b/test/cctest/wasm/test-managed.cc
deleted file mode 100644
index 55f8c121aef4c7fc0fe06ee5147ae166465a11f2..0000000000000000000000000000000000000000
--- a/test/cctest/wasm/test-managed.cc
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright 2016 the V8 project 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 <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "src/wasm/managed.h"
-
-#include "src/objects-inl.h"
-#include "test/cctest/cctest.h"
-#include "test/common/wasm/test-signatures.h"
-
-using namespace v8::base;
-using namespace v8::internal;
-
-class DeleteRecorder {
- public:
- explicit DeleteRecorder(bool* deleted) : deleted_(deleted) {
- *deleted_ = false;
- }
- ~DeleteRecorder() { *deleted_ = true; }
-
- private:
- bool* deleted_;
-};
-
-TEST(ManagedCollect) {
- Isolate* isolate = CcTest::InitIsolateOnce();
- bool deleted = false;
- DeleteRecorder* d = new DeleteRecorder(&deleted);
-
- {
- HandleScope scope(isolate);
- auto handle = Managed<DeleteRecorder>::New(isolate, d);
- USE(handle);
- }
-
- CcTest::CollectAllAvailableGarbage();
-
- CHECK(deleted);
-}
-
-TEST(ManagedCollectNoDelete) {
- Isolate* isolate = CcTest::InitIsolateOnce();
- bool deleted = false;
- DeleteRecorder* d = new DeleteRecorder(&deleted);
-
- {
- HandleScope scope(isolate);
- auto handle = Managed<DeleteRecorder>::New(isolate, d, false);
- USE(handle);
- }
-
- CcTest::CollectAllAvailableGarbage();
-
- CHECK(!deleted);
- delete d;
-}
« no previous file with comments | « test/cctest/test-managed.cc ('k') | test/cctest/wasm/wasm-run-utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698