3 <script src=
"../../http/tests/inspector/inspector-test.js"></script>
6 var object1
= { get foo() { return 1; }, set foo(value
) { } };
7 var object2
= { get foo() { return 1; } };
13 function dumpProperties(next
, properties
)
15 for (var i
= 0; i
< properties
.length
; ++i
)
16 dumpProperty(properties
[i
]);
20 InspectorTest
.runTestSuite([
21 function testSetUp(next
)
23 InspectorTest
.evaluateInPage("dumpObjects('Initial')", step0
);
27 InspectorTest
.RuntimeAgent
.evaluate("object1", step1
);
30 function step1(error
, result
, wasThrown
)
32 obj1
= InspectorTest
.runtimeModel
.createRemoteObject(result
);
33 InspectorTest
.RuntimeAgent
.evaluate("object2", step2
);
36 function step2(error
, result
, wasThrown
)
38 obj2
= InspectorTest
.runtimeModel
.createRemoteObject(result
);
43 function testGetterAndSetter(next
)
45 obj1
.getOwnProperties(dumpProperties
.bind(this, next
));
48 function testGetterOnly(next
)
50 obj2
.getOwnProperties(dumpProperties
.bind(this, next
));
54 function convertPropertyValueForTest(propertyObject
, fieldName
)
56 var value
= propertyObject
[fieldName
];
58 propertyObject
[fieldName
] = { type
: value
.type
, description
: value
.description
.replace("function foo", "function "), objectId
: value
.objectId
};
61 function dumpProperty(property
)
63 if (property
.name
=== "__proto__")
66 convertPropertyValueForTest(property
, "value");
67 convertPropertyValueForTest(property
, "getter");
68 convertPropertyValueForTest(property
, "setter");
69 InspectorTest
.dump(property
, { objectId
: "formatAsTypeName" });
76 <body onload=
"runTest()">
78 Tests RemoteObject.getProperties.