| OLD | NEW |
| 1 // Clipboard API test for Chrome. | 1 // Clipboard API test for Chrome. |
| 2 // browser_tests.exe --gtest_filter=ExtensionApiTest.Clipboard | 2 // browser_tests.exe --gtest_filter=ExtensionApiTest.Clipboard |
| 3 | 3 |
| 4 const TEST_URL_TMPL = "http://localhost:PORT/files/extensions/test_file.html"; | 4 const TEST_URL_TMPL = "http://localhost:PORT/files/extensions/test_file.html"; |
| 5 | 5 |
| 6 chrome.test.getConfig(function(config) { | 6 chrome.test.getConfig(function(config) { |
| 7 | 7 |
| 8 var TEST_URL = TEST_URL_TMPL.replace(/PORT/, config.testServer.port); | 8 var TEST_URL = TEST_URL_TMPL.replace(/PORT/, config.testServer.port); |
| 9 | 9 |
| 10 function setupWindow(callback) { | 10 function setupWindow(callback) { |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 chrome.test.callbackPass()); | 58 chrome.test.callbackPass()); |
| 59 } else if (request == "paste event") { | 59 } else if (request == "paste event") { |
| 60 onRequestCompleted(); | 60 onRequestCompleted(); |
| 61 } else { | 61 } else { |
| 62 chrome.test.fail("Unexpected request: " + JSON.stringify(request)); | 62 chrome.test.fail("Unexpected request: " + JSON.stringify(request)); |
| 63 } | 63 } |
| 64 } | 64 } |
| 65 ); | 65 ); |
| 66 setupWindow(); | 66 setupWindow(); |
| 67 }, | 67 }, |
| 68 function domCopy() { |
| 69 document.body.addEventListener('copy', chrome.test.callbackPass()); |
| 70 document.execCommand('copy'); |
| 71 }, |
| 68 function domPaste() { | 72 function domPaste() { |
| 69 document.body.addEventListener('paste', chrome.test.callbackPass()); | 73 document.body.addEventListener('paste', chrome.test.callbackPass()); |
| 70 document.execCommand('paste'); | 74 document.execCommand('paste'); |
| 71 } | 75 } |
| 72 ]); | 76 ]); |
| 73 }); | 77 }); |
| OLD | NEW |