Chromium Code Reviews| 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 InspectorTest.evaluateInConsole("copy('qwerty')"); | 9 var testCases = [ |
| 10 InspectorFrontendHost.copyText = copyText; | 10 "copy('qwerty')", |
| 11 "copy(document.querySelector('p'))", | |
| 12 "copy({foo:'bar'})", | |
| 13 "var a = {}; a.b = a; copy(a)", | |
| 14 "copy(document.all)", | |
| 15 "copy(NaN)", | |
| 16 "copy(Infinity)", | |
| 17 "copy(null)", | |
| 18 "copy(undefined)", | |
| 19 "copy(1)", | |
| 20 "copy(true)", | |
| 21 "copy(false)" | |
| 22 ]; | |
| 11 | 23 |
| 12 function copyText(text) { | 24 function copyText(text) { |
| 13 InspectorTest.addResult("InspectorFrontendHost.copyText: " + text); | 25 InspectorTest.addResult("InspectorFrontendHost.copyText: " + text); |
| 14 InspectorTest.completeTest(); | |
| 15 } | 26 } |
| 27 | |
| 28 InspectorFrontendHost.copyText = copyText; | |
| 29 | |
| 30 for (var i = 0; i < testCases.length; ++i) | |
| 31 RuntimeAgent.evaluate(testCases[i], "", true); | |
| 32 | |
| 33 RuntimeAgent.evaluate("copy(null)", "", true, InspectorTest.completeTest.bind (InspectorTest)); | |
|
aandrey
2013/12/06 11:08:01
wrong indent
Dmitry Zvorygin
2013/12/06 11:28:28
Done.
| |
| 16 } | 34 } |
| 17 | 35 |
| 18 </script> | 36 </script> |
| 19 </head> | 37 </head> |
| 20 | 38 |
| 21 <body onload="runTest()"> | 39 <body onload="runTest()"> |
| 22 <p> | 40 <p> |
| 23 Tests that console's copy command is copying into front-end buffer. | 41 Tests that console's copy command is copying into front-end buffer. |
| 24 </p> | 42 </p> |
| 25 | 43 |
| 26 </body> | 44 </body> |
| 27 </html> | 45 </html> |
| OLD | NEW |