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 InspectorTest.runTestSuite([
14 function testSetUp(next)
16 InspectorTest.evaluateInPage("dumpObjects('Initial')", step0);
20 RuntimeAgent.evaluate("object1", step1);
23 function step1(error, result, wasThrown)
25 obj1 = WebInspector.runtimeModel.createRemoteObject(result);
26 RuntimeAgent.evaluate("object2", step2);
29 function step2(error, result, wasThrown)
31 obj2 = WebInspector.runtimeModel.createRemoteObject(result);
36 function testGetterAndSetter(next)
38 obj1.getOwnProperties(step1);
40 function step1(properties)
42 for (var i = 0; i < properties.length; ++i)
43 dumpProperty(properties[i]);
49 function testGetterOnly(next)
51 obj2.getOwnProperties(step1);
53 function step1(properties)
55 for (var i = 0; i < properties.length; ++i)
56 dumpProperty(properties[i]);
63 function convertPropertyValueForTest(propertyObject, fieldName)
65 var value = propertyObject[fieldName];
67 propertyObject[fieldName] = { type: value.type, description: value.description.replace("function foo", "function "), objectId: value.objectId };
70 function dumpProperty(property)
72 if (property.name === "__proto__")
75 convertPropertyValueForTest(property, "value");
76 convertPropertyValueForTest(property, "getter");
77 convertPropertyValueForTest(property, "setter");
78 InspectorTest.dump(property, { objectId: "formatAsTypeName" });
85 <body onload="runTest()">
87 Tests RemoteObject.getProperties.