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

Unified Diff: testing/embedder_test_shared_isolate_delegate.h

Issue 1377293004: Run FXJS_V8 embedder tests against a shared isolate. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Alphabetize Created 5 years, 2 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
« fpdfsdk/src/jsapi/fxjs_v8_embeddertest.cpp ('K') | « testing/embedder_test.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/embedder_test_shared_isolate_delegate.h
diff --git a/testing/embedder_test_shared_isolate_delegate.h b/testing/embedder_test_shared_isolate_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..10a0d2d8657f5f5509acb846823172111a6d7973
--- /dev/null
+++ b/testing/embedder_test_shared_isolate_delegate.h
@@ -0,0 +1,35 @@
+// Copyright 2015 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 TESTING_EMBEDDER_TEST_SHARED_ISOLATE_DELEGATE_H_
+#define TESTING_EMBEDDER_TEST_SHARED_ISOLATE_DELEGATE_H_
+
+#include <map>
+#include <utility>
+
+#include "../fpdfsdk/include/jsapi/fxjs_v8.h"
+#include "../third_party/base/nonstd_unique_ptr.h"
+#include "embedder_test.h"
+#include "embedder_test_timer_handling_delegate.h"
+
+class EmbedderTestSharedIsolateDelegate
+ : public EmbedderTestTimerHandlingDelegate {
+ public:
+ EmbedderTestSharedIsolateDelegate()
+ : m_pArrayBufferAllocator(new FXJS_ArrayBufferAllocator) {
+ v8::Isolate::CreateParams params;
+ params.array_buffer_allocator = m_pArrayBufferAllocator.get();
+ m_pIsolate = v8::Isolate::New(params);
+ }
+
+ ~EmbedderTestSharedIsolateDelegate() { m_pIsolate->Dispose(); }
+
+ v8::Isolate* GetSharedIsolate() const override { return m_pIsolate; }
+
+ protected:
+ nonstd::unique_ptr<FXJS_ArrayBufferAllocator> m_pArrayBufferAllocator;
+ v8::Isolate* m_pIsolate;
+};
+
+#endif // TESTING_EMBEDDER_TEST_SHARED_ISOLATE_DELEGATE_H_
« fpdfsdk/src/jsapi/fxjs_v8_embeddertest.cpp ('K') | « testing/embedder_test.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698