summaryrefslogtreecommitdiff
path: root/fxjs/cfx_v8_unittest.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-02-12 21:49:04 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-02-12 21:49:04 +0000
commit3e5fac8169987afe652752ca5c7b9350ffabce0d (patch)
treebe0a898268dc0366af721216db03744f1ec6cb75 /fxjs/cfx_v8_unittest.h
parentad905158b86269686f94ea76d1b700f68ea377d5 (diff)
downloadpdfium-3e5fac8169987afe652752ca5c7b9350ffabce0d.tar.xz
Test if GC'd FXJS objects have their C-side counterparts cleaned up.
Small correctness fix in other engine embeddertest. Change-Id: I6c2721921a659eef1b2f155ea1797722d37209d0 Reviewed-on: https://pdfium-review.googlesource.com/26270 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fxjs/cfx_v8_unittest.h')
-rw-r--r--fxjs/cfx_v8_unittest.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/fxjs/cfx_v8_unittest.h b/fxjs/cfx_v8_unittest.h
new file mode 100644
index 0000000000..196a10f3ff
--- /dev/null
+++ b/fxjs/cfx_v8_unittest.h
@@ -0,0 +1,34 @@
+// Copyright 2018 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef FXJS_CFX_V8_UNITTEST_H_
+#define FXJS_CFX_V8_UNITTEST_H_
+
+#include "fxjs/cfx_v8.h"
+
+#include <memory>
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+class FXV8UnitTest : public ::testing::Test {
+ public:
+ struct V8IsolateDeleter {
+ void operator()(v8::Isolate* ptr) const;
+ };
+
+ FXV8UnitTest();
+ ~FXV8UnitTest() override;
+
+ void SetUp() override;
+
+ v8::Isolate* isolate() const { return isolate_.get(); }
+ CFX_V8* cfx_v8() const { return cfx_v8_.get(); }
+
+ protected:
+ std::unique_ptr<CFX_V8ArrayBufferAllocator> array_buffer_allocator_;
+ std::unique_ptr<v8::Isolate, V8IsolateDeleter> isolate_;
+ std::unique_ptr<CFX_V8> cfx_v8_;
+};
+
+#endif // FXJS_CFX_V8_UNITTEST_H_