| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../http/tests/inspector/console-test.js"></script> | 4 <script src="../../http/tests/inspector/console-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 | 6 |
| 7 function test() | 7 function test() |
| 8 { | 8 { |
| 9 var results = []; |
| 9 var testCases = [ | 10 var testCases = [ |
| 10 "copy('qwerty')", | 11 "copy('qwerty')", |
| 11 "copy(document.querySelector('p'))", | 12 "copy(document.querySelector('p'))", |
| 12 "copy({foo:'bar'})", | 13 "copy({foo:'bar'})", |
| 13 "var a = {}; a.b = a; copy(a)", | 14 "var a = {}; a.b = a; copy(a)", |
| 14 "copy(document.all)", | |
| 15 "copy(NaN)", | 15 "copy(NaN)", |
| 16 "copy(Infinity)", | 16 "copy(Infinity)", |
| 17 "copy(null)", | 17 "copy(null)", |
| 18 "copy(undefined)", | 18 "copy(undefined)", |
| 19 "copy(1)", | 19 "copy(1)", |
| 20 "copy(true)", | 20 "copy(true)", |
| 21 "copy(false)" | 21 "copy(false)", |
| 22 "copy(null)" |
| 22 ]; | 23 ]; |
| 23 | 24 |
| 24 function copyText(text) { | 25 function copyText(text) { |
| 25 InspectorTest.addResult("InspectorFrontendHost.copyText: " + text); | 26 results.push(text); |
| 27 if (results.length === testCases.length) { |
| 28 results.sort(); |
| 29 for (var result of results) |
| 30 InspectorTest.addResult("InspectorFrontendHost.copyText: " + res
ult); |
| 31 InspectorTest.completeTest(); |
| 32 } |
| 26 } | 33 } |
| 27 | 34 |
| 28 InspectorFrontendHost.copyText = copyText; | 35 InspectorFrontendHost.copyText = copyText; |
| 29 | |
| 30 for (var i = 0; i < testCases.length; ++i) | 36 for (var i = 0; i < testCases.length; ++i) |
| 31 InspectorTest.RuntimeAgent.evaluate(testCases[i], "", true); | 37 InspectorTest.RuntimeAgent.evaluate(testCases[i], "", true); |
| 32 | |
| 33 InspectorTest.RuntimeAgent.evaluate("copy(null)", "", true, InspectorTest.co
mpleteTest.bind(InspectorTest)); | |
| 34 } | 38 } |
| 35 | 39 |
| 36 </script> | 40 </script> |
| 37 </head> | 41 </head> |
| 38 | 42 |
| 39 <body onload="runTest()"> | 43 <body onload="runTest()"> |
| 40 <p> | 44 <p> |
| 41 Tests that console's copy command is copying into front-end buffer. | 45 Tests that console's copy command is copying into front-end buffer. |
| 42 </p> | 46 </p> |
| 43 | 47 |
| 44 </body> | 48 </body> |
| 45 </html> | 49 </html> |
| OLD | NEW |