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

Unified Diff: test/unittests/value-serializer-unittest.cc

Issue 2741683004: [rename] Rename internal field to embedder field. (Closed)
Patch Set: DEPRECATE_SOON(GetInternalField) Created 3 years, 9 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
« include/v8-experimental.h ('K') | « test/cctest/wasm/test-run-wasm-module.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/value-serializer-unittest.cc
diff --git a/test/unittests/value-serializer-unittest.cc b/test/unittests/value-serializer-unittest.cc
index c0037efb01709e9c401992d89292422494bf18c1..3327b428602905f44a1ca4b1adafa214b8595cbf 100644
--- a/test/unittests/value-serializer-unittest.cc
+++ b/test/unittests/value-serializer-unittest.cc
@@ -31,19 +31,19 @@ class ValueSerializerTest : public TestWithIsolate {
// serialization/deserialization delegates below.
Local<FunctionTemplate> function_template = v8::FunctionTemplate::New(
isolate(), [](const FunctionCallbackInfo<Value>& args) {
- args.Holder()->SetInternalField(0, args[0]);
- args.Holder()->SetInternalField(1, args[1]);
+ args.Holder()->SetEmbedderField(0, args[0]);
+ args.Holder()->SetEmbedderField(1, args[1]);
});
- function_template->InstanceTemplate()->SetInternalFieldCount(2);
+ function_template->InstanceTemplate()->SetEmbedderFieldCount(2);
function_template->InstanceTemplate()->SetAccessor(
StringFromUtf8("value"),
[](Local<String> property, const PropertyCallbackInfo<Value>& args) {
- args.GetReturnValue().Set(args.Holder()->GetInternalField(0));
+ args.GetReturnValue().Set(args.Holder()->GetEmbedderField(0));
});
function_template->InstanceTemplate()->SetAccessor(
StringFromUtf8("value2"),
[](Local<String> property, const PropertyCallbackInfo<Value>& args) {
- args.GetReturnValue().Set(args.Holder()->GetInternalField(1));
+ args.GetReturnValue().Set(args.Holder()->GetEmbedderField(1));
});
for (Local<Context> context :
{serialization_context_, deserialization_context_}) {
@@ -2379,7 +2379,7 @@ TEST_F(ValueSerializerTestWithHostObject, RoundTripUint32) {
EXPECT_CALL(serializer_delegate_, WriteHostObject(isolate(), _))
.WillRepeatedly(Invoke([this](Isolate*, Local<Object> object) {
uint32_t value = 0;
- EXPECT_TRUE(object->GetInternalField(0)
+ EXPECT_TRUE(object->GetEmbedderField(0)
->Uint32Value(serialization_context())
.To(&value));
WriteExampleHostObjectTag();
@@ -2396,7 +2396,7 @@ TEST_F(ValueSerializerTestWithHostObject, RoundTripUint32) {
}));
RoundTripTest("new ExampleHostObject(42)", [this](Local<Value> value) {
ASSERT_TRUE(value->IsObject());
- ASSERT_TRUE(Object::Cast(*value)->InternalFieldCount());
+ ASSERT_TRUE(Object::Cast(*value)->EmbedderFieldCount());
EXPECT_TRUE(EvaluateScriptForResultBool(
"Object.getPrototypeOf(result) === ExampleHostObject.prototype"));
EXPECT_TRUE(EvaluateScriptForResultBool("result.value === 42"));
@@ -2412,10 +2412,10 @@ TEST_F(ValueSerializerTestWithHostObject, RoundTripUint64) {
EXPECT_CALL(serializer_delegate_, WriteHostObject(isolate(), _))
.WillRepeatedly(Invoke([this](Isolate*, Local<Object> object) {
uint32_t value = 0, value2 = 0;
- EXPECT_TRUE(object->GetInternalField(0)
+ EXPECT_TRUE(object->GetEmbedderField(0)
->Uint32Value(serialization_context())
.To(&value));
- EXPECT_TRUE(object->GetInternalField(1)
+ EXPECT_TRUE(object->GetEmbedderField(1)
->Uint32Value(serialization_context())
.To(&value2));
WriteExampleHostObjectTag();
@@ -2436,7 +2436,7 @@ TEST_F(ValueSerializerTestWithHostObject, RoundTripUint64) {
}));
RoundTripTest("new ExampleHostObject(42, 0)", [this](Local<Value> value) {
ASSERT_TRUE(value->IsObject());
- ASSERT_TRUE(Object::Cast(*value)->InternalFieldCount());
+ ASSERT_TRUE(Object::Cast(*value)->EmbedderFieldCount());
EXPECT_TRUE(EvaluateScriptForResultBool(
"Object.getPrototypeOf(result) === ExampleHostObject.prototype"));
EXPECT_TRUE(EvaluateScriptForResultBool("result.value === 42"));
@@ -2456,7 +2456,7 @@ TEST_F(ValueSerializerTestWithHostObject, RoundTripDouble) {
EXPECT_CALL(serializer_delegate_, WriteHostObject(isolate(), _))
.WillRepeatedly(Invoke([this](Isolate*, Local<Object> object) {
double value = 0;
- EXPECT_TRUE(object->GetInternalField(0)
+ EXPECT_TRUE(object->GetEmbedderField(0)
->NumberValue(serialization_context())
.To(&value));
WriteExampleHostObjectTag();
@@ -2473,7 +2473,7 @@ TEST_F(ValueSerializerTestWithHostObject, RoundTripDouble) {
}));
RoundTripTest("new ExampleHostObject(-3.5)", [this](Local<Value> value) {
ASSERT_TRUE(value->IsObject());
- ASSERT_TRUE(Object::Cast(*value)->InternalFieldCount());
+ ASSERT_TRUE(Object::Cast(*value)->EmbedderFieldCount());
EXPECT_TRUE(EvaluateScriptForResultBool(
"Object.getPrototypeOf(result) === ExampleHostObject.prototype"));
EXPECT_TRUE(EvaluateScriptForResultBool("result.value === -3.5"));
@@ -2516,7 +2516,7 @@ TEST_F(ValueSerializerTestWithHostObject, RoundTripRawBytes) {
}));
RoundTripTest("new ExampleHostObject()", [this](Local<Value> value) {
ASSERT_TRUE(value->IsObject());
- ASSERT_TRUE(Object::Cast(*value)->InternalFieldCount());
+ ASSERT_TRUE(Object::Cast(*value)->EmbedderFieldCount());
EXPECT_TRUE(EvaluateScriptForResultBool(
"Object.getPrototypeOf(result) === ExampleHostObject.prototype"));
});
« include/v8-experimental.h ('K') | « test/cctest/wasm/test-run-wasm-module.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698