summaryrefslogtreecommitdiffstats
path: root/gin/test
diff options
context:
space:
mode:
authorbaixo <baixo@chromium.org>2014-10-28 04:52:21 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-28 11:52:42 +0000
commit3a3c88a61fc3fc5b001e7bae70e6335d3cf7c997 (patch)
tree0840a2647c5c2eda9a92ad9ffd2a45adbed9379e /gin/test
parentfb8875c804337e452e7f799bc3960b912100e5a9 (diff)
downloadchromium_src-3a3c88a61fc3fc5b001e7bae70e6335d3cf7c997.zip
chromium_src-3a3c88a61fc3fc5b001e7bae70e6335d3cf7c997.tar.gz
chromium_src-3a3c88a61fc3fc5b001e7bae70e6335d3cf7c997.tar.bz2
Infrastructure for enabling V8's initial snapshot to be loaded from external files as opposed to being statically linked to the binary.
This is not currently supported on any architecture. BUG=421063 Review URL: https://codereview.chromium.org/594603003 Cr-Commit-Position: refs/heads/master@{#301595}
Diffstat (limited to 'gin/test')
-rw-r--r--gin/test/file_runner.cc8
-rw-r--r--gin/test/v8_test.cc7
2 files changed, 15 insertions, 0 deletions
diff --git a/gin/test/file_runner.cc b/gin/test/file_runner.cc
index 83228d6..b639d06 100644
--- a/gin/test/file_runner.cc
+++ b/gin/test/file_runner.cc
@@ -19,6 +19,10 @@
#include "gin/try_catch.h"
#include "testing/gtest/include/gtest/gtest.h"
+#ifdef V8_USE_EXTERNAL_STARTUP_DATA
+#include "gin/public/isolate_holder.h"
+#endif
+
namespace gin {
namespace {
@@ -58,6 +62,10 @@ void RunTestFromFile(const base::FilePath& path, FileRunnerDelegate* delegate,
base::MessageLoop message_loop;
+#ifdef V8_USE_EXTERNAL_STARTUP_DATA
+ gin::IsolateHolder::LoadV8Snapshot();
+#endif
+
gin::IsolateHolder::Initialize(gin::IsolateHolder::kStrictMode,
gin::ArrayBufferAllocator::SharedInstance());
gin::IsolateHolder instance;
diff --git a/gin/test/v8_test.cc b/gin/test/v8_test.cc
index cb6d573..a022511 100644
--- a/gin/test/v8_test.cc
+++ b/gin/test/v8_test.cc
@@ -7,6 +7,10 @@
#include "gin/array_buffer.h"
#include "gin/public/isolate_holder.h"
+#ifdef V8_USE_EXTERNAL_STARTUP_DATA
+#include "gin/public/isolate_holder.h"
+#endif
+
using v8::Context;
using v8::Local;
using v8::HandleScope;
@@ -20,6 +24,9 @@ V8Test::~V8Test() {
}
void V8Test::SetUp() {
+#ifdef V8_USE_EXTERNAL_STARTUP_DATA
+ gin::IsolateHolder::LoadV8Snapshot();
+#endif
gin::IsolateHolder::Initialize(gin::IsolateHolder::kStrictMode,
gin::ArrayBufferAllocator::SharedInstance());
instance_.reset(new gin::IsolateHolder);