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

Side by Side Diff: LayoutTests/fast/events/clipboard-clearData.html

Issue 26023003: Get rid of custom code for clipboard.clearData() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../js/resources/js-test-pre.js"></script>
5 <script>
6 var testDataTransfer;
7 function copy(event)
8 {
9 event.preventDefault();
10
11 testDataTransfer = event.clipboardData;
12 testDataTransfer.setData('text', 'sample');
13 testDataTransfer.setData('url', 'http://www.google.com/');
14 testDataTransfer.setData('text/html', '<em>Markup</em>');
15 testDataTransfer.setData('custom-data', 'hello world');
16
17 shouldNotThrow('testDataTransfer.clearData(null)'); // Gets converted to "nu ll" string.
18 shouldNotThrow('testDataTransfer.clearData(undefined)'); // Gets converted t o "undefined" string.
19
20 shouldBeEqualToString('testDataTransfer.getData("text")', 'sample');
21 shouldBeEqualToString('testDataTransfer.getData("url")', 'http://www.google. com/');
22 shouldBeEqualToString('testDataTransfer.getData("text/html")', '<em>Markup</ em>');
23 shouldBeEqualToString('testDataTransfer.getData("custom-data")', 'hello worl d');
24
25 shouldNotThrow('testDataTransfer.clearData("custom-data")');
26 shouldBeEqualToString('testDataTransfer.getData("text")', 'sample');
27 shouldBeEqualToString('testDataTransfer.getData("url")', 'http://www.google. com/');
28 shouldBeEqualToString('testDataTransfer.getData("text/html")', '<em>Markup</ em>');
29 shouldBeEqualToString('testDataTransfer.getData("custom-data")', '');
30
31 shouldNotThrow('testDataTransfer.clearData()');
32 shouldBeEqualToString('testDataTransfer.getData("text")', '');
33 shouldBeEqualToString('testDataTransfer.getData("url")', '');
34 shouldBeEqualToString('testDataTransfer.getData("text/html")', '');
35 shouldBeEqualToString('testDataTransfer.getData("custom-data")', '');
36 }
37 </script>
38 </head>
39 <body oncopy="copy(event)">
40 <script>
41 description("Tests clipboard.clearData()");
42
43 document.execCommand('copy');
44 </script>
45 <script src="../js/resources/js-test-post.js"></script>
46 </body>
47 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/events/clipboard-clearData-expected.txt » ('j') | Source/core/dom/Clipboard.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698