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

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

Issue 495213002: Add tests to make sure copy/paste in an about:blank iframe in a hosted app works. (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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Clipboard permission test for Chrome. 5 // Clipboard permission test for Chrome.
6 // browser_tests.exe --gtest_filter=ClipboardApiTest.Extension 6 // browser_tests.exe --gtest_filter=ClipboardApiTest.Extension
7 7
8 chrome.test.runTests([ 8 chrome.test.runTests([
9 function domCopy() { 9 function domCopy() {
10 if (document.execCommand('copy')) 10 if (document.execCommand('copy'))
11 chrome.test.succeed(); 11 chrome.test.succeed();
12 else 12 else
13 chrome.test.fail('execCommand("copy") failed'); 13 chrome.test.fail('execCommand("copy") failed');
14 }, 14 },
15 function domPaste() { 15 function domPaste() {
16 if (document.execCommand('paste')) 16 if (document.execCommand('paste'))
17 chrome.test.succeed(); 17 chrome.test.succeed();
18 else 18 else
19 chrome.test.fail('execCommand("paste") failed'); 19 chrome.test.fail('execCommand("paste") failed');
20 },
21 function copyInIframe() {
22 var ifr = document.createElement('iframe');
23 document.body.appendChild(ifr);
24 if (ifr.contentDocument.execCommand('copy'))
25 chrome.test.succeed();
26 else
27 chrome.test.fail('execCommand("copy") failed in iframe');
28 },
29 function pasteInIframe() {
30 var ifr = document.createElement('iframe');
31 document.body.appendChild(ifr);
32 if (ifr.contentDocument.execCommand('paste'))
33 chrome.test.succeed();
34 else
35 chrome.test.fail('execCommand("paste") failed in iframe');
not at google - send to devlin 2014/08/21 20:28:11 Another line-saver: I don't know why we don't do:
Marijn Kruisselbrink 2014/08/21 20:50:20 You'd still need chrome.test.succeed() or fail() t
20 } 36 }
21 ]); 37 ]);
22 38
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698