| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="console-test.js"></script> | 3 <script src="console-test.js"></script> |
| 4 <script src="inspector-test.js"></script> | 4 <script src="inspector-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 | 6 |
| 7 window.counter = 0; | 7 window.counter = 0; |
| 8 var handler = { | 8 var handler = { |
| 9 get: function(target, name){ | 9 get: function(target, name){ |
| 10 window.counter++; | 10 window.counter++; |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 function requestMyClassWithMixinCompletions() | 137 function requestMyClassWithMixinCompletions() |
| 138 { | 138 { |
| 139 InspectorTest.changeExecutionContext("top"); | 139 InspectorTest.changeExecutionContext("top"); |
| 140 WebInspector.context.flavor(WebInspector.ExecutionContext).completionsFo
rExpression("window.x.", "window.x.", 0, "", false, checkMyClassWithMixinComplet
ions.bind(this)); | 140 WebInspector.context.flavor(WebInspector.ExecutionContext).completionsFo
rExpression("window.x.", "window.x.", 0, "", false, checkMyClassWithMixinComplet
ions.bind(this)); |
| 141 } | 141 } |
| 142 | 142 |
| 143 function checkMyClassWithMixinCompletions(completions) | 143 function checkMyClassWithMixinCompletions(completions) |
| 144 { | 144 { |
| 145 InspectorTest.addResult("MyClass with mixin completions:") | 145 InspectorTest.addResult("MyClass with mixin completions:") |
| 146 dumpCompletions(completions, ["myMethod"]); | 146 dumpCompletions(completions, ["myMethod"]); |
| 147 requestObjectCompletions(); |
| 148 } |
| 149 |
| 150 |
| 151 function requestObjectCompletions() |
| 152 { |
| 153 InspectorTest.changeExecutionContext("top"); |
| 154 WebInspector.context.flavor(WebInspector.ExecutionContext).completionsFo
rExpression("Object.", "Object.", 0, "", false, checkObjectCompletions.bind(this
)); |
| 155 } |
| 156 |
| 157 function checkObjectCompletions(completions) |
| 158 { |
| 159 InspectorTest.addResult("Object completions:") |
| 160 dumpCompletions(completions, ["getOwnPropertyNames", "getOwnPropertyDesc
riptor", "keys"]); |
| 147 InspectorTest.dumpConsoleMessages(); | 161 InspectorTest.dumpConsoleMessages(); |
| 148 InspectorTest.completeTest(); | 162 InspectorTest.completeTest(); |
| 149 } | 163 } |
| 150 | 164 |
| 151 | 165 |
| 152 function dumpCompletions(completions, expected) | 166 function dumpCompletions(completions, expected) |
| 153 { | 167 { |
| 154 var completionSet = new Set(completions); | 168 var completionSet = new Set(completions); |
| 155 for (var completion of expected) { | 169 for (var completion of expected) { |
| 156 if (completionSet.has(completion)) | 170 if (completionSet.has(completion)) |
| (...skipping 11 matching lines...) Expand all Loading... |
| 168 <p> | 182 <p> |
| 169 Test that completions in the context of an iframe with a different origin will | 183 Test that completions in the context of an iframe with a different origin will |
| 170 result in names of its global variables. Test passes if all global variables | 184 result in names of its global variables. Test passes if all global variables |
| 171 are found among completions AND there are NO console messages. | 185 are found among completions AND there are NO console messages. |
| 172 <a href="https://bugs.webkit.org/show_bug.cgi?id=65457">Bug 65457.</a> | 186 <a href="https://bugs.webkit.org/show_bug.cgi?id=65457">Bug 65457.</a> |
| 173 </p> | 187 </p> |
| 174 <iframe name="myIFrame" src="http://localhost:8000/inspector/resources/console-c
d-completions-iframe.html" onload="runTest()"></iframe> | 188 <iframe name="myIFrame" src="http://localhost:8000/inspector/resources/console-c
d-completions-iframe.html" onload="runTest()"></iframe> |
| 175 | 189 |
| 176 </body> | 190 </body> |
| 177 </html> | 191 </html> |
| OLD | NEW |