| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto
r-protocol-test.js"></script> | 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto
r-protocol-test.js"></script> |
| 4 <script> | 4 <script> |
| 5 | 5 |
| 6 function test() | 6 function test() |
| 7 { | 7 { |
| 8 // A general-purpose engine for sending a sequence of protocol commands. | 8 // A general-purpose engine for sending a sequence of protocol commands. |
| 9 // The clients provide requests and response handlers, while the engine catc
hes | 9 // The clients provide requests and response handlers, while the engine catc
hes |
| 10 // errors and makes sure that once there's nothing to do completeTest() is c
alled. | 10 // errors and makes sure that once there's nothing to do completeTest() is c
alled. |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 logGetPropertiesResult("Object(5)", result); | 84 logGetPropertiesResult("Object(5)", result); |
| 85 return { callback: callbackStartNotOwn }; | 85 return { callback: callbackStartNotOwn }; |
| 86 } | 86 } |
| 87 | 87 |
| 88 | 88 |
| 89 // 'Not own' section -- check all properties of the object, including ones f
rom it prototype chain. | 89 // 'Not own' section -- check all properties of the object, including ones f
rom it prototype chain. |
| 90 | 90 |
| 91 function callbackStartNotOwn() | 91 function callbackStartNotOwn() |
| 92 { | 92 { |
| 93 // Create an wrapper object with additional property. | 93 // Create an wrapper object with additional property. |
| 94 var expression = "({ a: 2, set b() {}, get b() {return 5;}, __proto__: {
a: 3, c: 4, get d() {return 6;} }})"; | 94 var expression = "({ a: 2, set b(_) {}, get b() {return 5;}, __proto__:
{ a: 3, c: 4, get d() {return 6;} }})"; |
| 95 | 95 |
| 96 return { command: "Runtime.evaluate", params: {expression: expression},
callback: callbackEvalNotOwn }; | 96 return { command: "Runtime.evaluate", params: {expression: expression},
callback: callbackEvalNotOwn }; |
| 97 } | 97 } |
| 98 function callbackEvalNotOwn(result) | 98 function callbackEvalNotOwn(result) |
| 99 { | 99 { |
| 100 var id = result.result.objectId; | 100 var id = result.result.objectId; |
| 101 if (id === undefined) | 101 if (id === undefined) |
| 102 throw new Error("objectId is expected"); | 102 throw new Error("objectId is expected"); |
| 103 return { | 103 return { |
| 104 command: "Runtime.getProperties", params: {objectId: id, ownProperti
es: false}, callback: callbackPropertiesNotOwn | 104 command: "Runtime.getProperties", params: {objectId: id, ownProperti
es: false}, callback: callbackPropertiesNotOwn |
| 105 }; | 105 }; |
| 106 } | 106 } |
| 107 function callbackPropertiesNotOwn(result) | 107 function callbackPropertiesNotOwn(result) |
| 108 { | 108 { |
| 109 logGetPropertiesResult("Not own properties", result); | 109 logGetPropertiesResult("Not own properties", result); |
| 110 return { callback: callbackStartAccessorsOnly }; | 110 return { callback: callbackStartAccessorsOnly }; |
| 111 } | 111 } |
| 112 | 112 |
| 113 | 113 |
| 114 // 'Accessors only' section -- check only accessor properties of the object. | 114 // 'Accessors only' section -- check only accessor properties of the object. |
| 115 | 115 |
| 116 function callbackStartAccessorsOnly() | 116 function callbackStartAccessorsOnly() |
| 117 { | 117 { |
| 118 // Create an wrapper object with additional property. | 118 // Create an wrapper object with additional property. |
| 119 var expression = "({ a: 2, set b() {}, get b() {return 5;}, c: 'c', set
d(){} })"; | 119 var expression = "({ a: 2, set b(_) {}, get b() {return 5;}, c: 'c', set
d(_){} })"; |
| 120 | 120 |
| 121 return { command: "Runtime.evaluate", params: {expression: expression},
callback: callbackEvalAccessorsOnly }; | 121 return { command: "Runtime.evaluate", params: {expression: expression},
callback: callbackEvalAccessorsOnly }; |
| 122 } | 122 } |
| 123 function callbackEvalAccessorsOnly(result) | 123 function callbackEvalAccessorsOnly(result) |
| 124 { | 124 { |
| 125 var id = result.result.objectId; | 125 var id = result.result.objectId; |
| 126 if (id === undefined) | 126 if (id === undefined) |
| 127 throw new Error("objectId is expected"); | 127 throw new Error("objectId is expected"); |
| 128 return { | 128 return { |
| 129 command: "Runtime.getProperties", params: {objectId: id, ownProperti
es: true, accessorPropertiesOnly: true}, callback: callbackPropertiesAccessorsOn
ly | 129 command: "Runtime.getProperties", params: {objectId: id, ownProperti
es: true, accessorPropertiesOnly: true}, callback: callbackPropertiesAccessorsOn
ly |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 { | 221 { |
| 222 return o1.name === o2.name ? 0 : (o1.name < o2.name ? -1 : 1); | 222 return o1.name === o2.name ? 0 : (o1.name < o2.name ? -1 : 1); |
| 223 } | 223 } |
| 224 } | 224 } |
| 225 } | 225 } |
| 226 </script> | 226 </script> |
| 227 </head> | 227 </head> |
| 228 <body onLoad="runTest();"> | 228 <body onLoad="runTest();"> |
| 229 </body> | 229 </body> |
| 230 </html> | 230 </html> |
| OLD | NEW |