Chromium Code Reviews| Index: test/cctest/test-serialize.cc |
| diff --git a/test/cctest/test-serialize.cc b/test/cctest/test-serialize.cc |
| index d0cd8670bbb2b2ceef748fa11a8cf506fef22f15..5699f84f6158ac9ffeff6fa2578a9e2c7faa475f 100644 |
| --- a/test/cctest/test-serialize.cc |
| +++ b/test/cctest/test-serialize.cc |
| @@ -2389,15 +2389,29 @@ TEST(SnapshotCreatorIncludeGlobalProxy) { |
| global_template->SetHandler(v8::NamedPropertyHandlerConfiguration( |
| NamedPropertyGetterForSerialization)); |
| global_template->SetAccessor(v8_str("y"), AccessorForSerialization); |
| + v8::Local<v8::Private> priv = |
| + v8::Private::ForApi(isolate, v8_str("cached")); |
| + global_template->SetAccessorProperty( |
| + v8_str("cached"), |
| + v8::FunctionTemplate::NewWithCache(isolate, SerializedCallback, priv, |
| + v8::Local<v8::Value>())); |
| v8::Local<v8::Context> context = |
| v8::Context::New(isolate, &extensions, global_template); |
| v8::Context::Scope context_scope(context); |
| + |
| + // Set hidden property. |
| + CHECK(context->Global() |
|
jochen (gone - plz use gerrit)
2016/12/16 11:43:23
can you also test that setting this after deserial
|
| + ->SetPrivate(context, priv, v8_str("cached string")) |
| + .FromJust()); |
| + |
| ExpectInt32("f()", 42); |
| ExpectInt32("g()", 12); |
| ExpectInt32("h()", 13); |
| ExpectInt32("o.p", 7); |
| ExpectInt32("x", 2016); |
| ExpectInt32("y", 2017); |
| + ExpectString("cached", "cached string"); |
| + |
| CHECK_EQ(0u, creator.AddContext(context)); |
| } |
| blob = creator.CreateBlob(v8::SnapshotCreator::FunctionCodeHandling::kClear, |
| @@ -2453,6 +2467,7 @@ TEST(SnapshotCreatorIncludeGlobalProxy) { |
| ExpectInt32("j()", 25); |
| ExpectInt32("o.p", 8); |
| ExpectInt32("x", 2016); |
| + ExpectString("cached", "cached string"); |
| } |
| v8::Local<v8::Object> global = context->Global(); |
| @@ -2473,6 +2488,7 @@ TEST(SnapshotCreatorIncludeGlobalProxy) { |
| ExpectInt32("j()", 25); |
| ExpectInt32("o.p", 8); |
| ExpectInt32("x", 2016); |
| + ExpectString("cached", "cached string"); |
| } |
| CHECK(context2->Global()->Equals(context2, global).FromJust()); |