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

Unified Diff: chrome/test/data/extensions/api_test/clipboard/extension_no_permission/test.js

Issue 501513002: Change these tests to actually trigger the execCommand from the iframe context. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/data/extensions/api_test/clipboard/extension_no_permission/iframe.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/api_test/clipboard/extension_no_permission/test.js
diff --git a/chrome/test/data/extensions/api_test/clipboard/extension_no_permission/test.js b/chrome/test/data/extensions/api_test/clipboard/extension_no_permission/test.js
index 544c6ed2853333a27d38f2b87b3bb383ded76013..a068b2d08e9c173414424dab0a97e811b99270dd 100644
--- a/chrome/test/data/extensions/api_test/clipboard/extension_no_permission/test.js
+++ b/chrome/test/data/extensions/api_test/clipboard/extension_no_permission/test.js
@@ -21,17 +21,21 @@ chrome.test.runTests([
function copyInIframe() {
var ifr = document.createElement('iframe');
document.body.appendChild(ifr);
- if (ifr.contentDocument.execCommand('copy'))
- chrome.test.succeed();
- else
- chrome.test.fail('execCommand("copy") failed in iframe');
+ window.command = 'copy';
+ ifr.contentDocument.write('<script src="iframe.js"></script>');
},
function pasteInIframe() {
var ifr = document.createElement('iframe');
document.body.appendChild(ifr);
- if (ifr.contentDocument.execCommand('paste'))
- chrome.test.fail('execCommand("paste") succeeded in iframe');
- else
- chrome.test.succeed();
+ window.command = 'paste';
+ ifr.contentDocument.write('<script src="iframe.js"></script>');
}
]);
+
+function testDone(result) {
+ if (window.command === 'paste') result = !result;
not at google - send to devlin 2014/08/22 17:21:35 I find it hard to parse this out of context (bounc
+ if (result)
+ chrome.test.succeed();
+ else
+ chrome.test.fail();
+}
« no previous file with comments | « chrome/test/data/extensions/api_test/clipboard/extension_no_permission/iframe.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698