summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-02-01 02:11:44 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-02-01 02:11:44 +0000
commit33c7ade187724c767fff74913cda63de182b0ce2 (patch)
tree7663959549e750f488406d882ed82e5d4479ff54
parent66ce22c6cdb38ca5941c175aea371df92ae9cb8b (diff)
downloadpdfium-33c7ade187724c767fff74913cda63de182b0ce2.tar.xz
Test more context overlap in fxjs/fxjs_v8_embeddertest.cpp
Change-Id: If9ab65019f12244938116e19f717e2092ccae4ff Reviewed-on: https://pdfium-review.googlesource.com/24931 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
-rw-r--r--fxjs/fxjs_v8_embeddertest.cpp31
1 files changed, 26 insertions, 5 deletions
diff --git a/fxjs/fxjs_v8_embeddertest.cpp b/fxjs/fxjs_v8_embeddertest.cpp
index d975264d1d..21e6460b8c 100644
--- a/fxjs/fxjs_v8_embeddertest.cpp
+++ b/fxjs/fxjs_v8_embeddertest.cpp
@@ -51,28 +51,49 @@ TEST_F(FXJSV8EmbedderTest, MultipleEngines) {
CFXJS_Engine engine2(isolate());
engine2.InitializeEngine();
+ v8::Local<v8::Context> context1 = engine1.NewLocalContext();
+ v8::Local<v8::Context> context2 = engine2.NewLocalContext();
+
v8::Context::Scope context_scope(GetV8Context());
ExecuteInCurrentContext(WideString(kScript0));
CheckAssignmentInCurrentContext(kExpected0);
{
- v8::Local<v8::Context> context1 = engine1.NewLocalContext();
v8::Context::Scope context_scope1(context1);
ExecuteInCurrentContext(WideString(kScript1));
CheckAssignmentInCurrentContext(kExpected1);
}
+ {
+ v8::Context::Scope context_scope2(context2);
+ ExecuteInCurrentContext(WideString(kScript2));
+ CheckAssignmentInCurrentContext(kExpected2);
+ }
- engine1.ReleaseEngine();
+ CheckAssignmentInCurrentContext(kExpected0);
{
- v8::Local<v8::Context> context2 = engine2.NewLocalContext();
+ v8::Context::Scope context_scope1(context1);
+ CheckAssignmentInCurrentContext(kExpected1);
+ {
+ v8::Context::Scope context_scope2(context2);
+ CheckAssignmentInCurrentContext(kExpected2);
+ }
+ CheckAssignmentInCurrentContext(kExpected1);
+ }
+ {
v8::Context::Scope context_scope2(context2);
- ExecuteInCurrentContext(WideString(kScript2));
+ CheckAssignmentInCurrentContext(kExpected2);
+ {
+ v8::Context::Scope context_scope1(context1);
+ CheckAssignmentInCurrentContext(kExpected1);
+ }
CheckAssignmentInCurrentContext(kExpected2);
}
- engine2.ReleaseEngine();
CheckAssignmentInCurrentContext(kExpected0);
+
+ engine1.ReleaseEngine();
+ engine2.ReleaseEngine();
}
TEST_F(FXJSV8EmbedderTest, EmptyLocal) {