diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-02-12 21:49:04 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-02-12 21:49:04 +0000 |
commit | 3e5fac8169987afe652752ca5c7b9350ffabce0d (patch) | |
tree | be0a898268dc0366af721216db03744f1ec6cb75 /fxjs/cfxjs_engine_embeddertest.cpp | |
parent | ad905158b86269686f94ea76d1b700f68ea377d5 (diff) | |
download | pdfium-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/cfxjs_engine_embeddertest.cpp')
-rw-r--r-- | fxjs/cfxjs_engine_embeddertest.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/fxjs/cfxjs_engine_embeddertest.cpp b/fxjs/cfxjs_engine_embeddertest.cpp index f25bfbe060..bcd4183de0 100644 --- a/fxjs/cfxjs_engine_embeddertest.cpp +++ b/fxjs/cfxjs_engine_embeddertest.cpp @@ -22,15 +22,20 @@ const wchar_t kScript2[] = L"fred = 8"; class CFXJSEngineEmbedderTest : public JSEmbedderTest { public: void ExecuteInCurrentContext(const WideString& script) { + auto* current_engine = + CFXJS_Engine::EngineFromIsolateCurrentContext(isolate()); FXJSErr error; - int sts = engine()->Execute(script, &error); + int sts = current_engine->Execute(script, &error); EXPECT_EQ(0, sts); } void CheckAssignmentInCurrentContext(double expected) { - v8::Local<v8::Object> This = engine()->GetThisObj(); - v8::Local<v8::Value> fred = engine()->GetObjectProperty(This, L"fred"); + auto* current_engine = + CFXJS_Engine::EngineFromIsolateCurrentContext(isolate()); + v8::Local<v8::Object> This = current_engine->GetThisObj(); + v8::Local<v8::Value> fred = + current_engine->GetObjectProperty(This, L"fred"); EXPECT_TRUE(fred->IsNumber()); - EXPECT_EQ(expected, engine()->ToDouble(fred)); + EXPECT_EQ(expected, current_engine->ToDouble(fred)); } }; |