Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Side by Side Diff: chrome/test/data/extensions/api_test/clipboard/test.js

Issue 6480106: Add IPCs to check web copy/cut/paste for extensions with the appropriate permission bit. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome
Patch Set: . Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/data/extensions/api_test/clipboard/manifest.json ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 });
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/api_test/clipboard/manifest.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698