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

Unified Diff: LayoutTests/fast/events/drag-dataTransferItemList.html

Issue 22837006: Have DataTransferItemList.add() methods return the added item (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 | « no previous file | LayoutTests/fast/events/drag-dataTransferItemList-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/events/drag-dataTransferItemList.html
diff --git a/LayoutTests/fast/events/drag-dataTransferItemList.html b/LayoutTests/fast/events/drag-dataTransferItemList.html
index 978b3cd1dd9d1a7d8e7df63806db9fe89b21bc36..61bcad274fe5e9a7ee680e5418f162d3d1574c45 100644
--- a/LayoutTests/fast/events/drag-dataTransferItemList.html
+++ b/LayoutTests/fast/events/drag-dataTransferItemList.html
@@ -24,15 +24,24 @@ function legacyDragStart(dataTransfer)
}
var testDataTransfer;
+var testItem;
function itemListDragStart(dataTransfer)
{
testDataTransfer = dataTransfer;
shouldThrow('testDataTransfer.items.add()', '"TypeError: Not enough arguments"');
shouldThrow('testDataTransfer.items.add("sample")', '"TypeError: Type error"');
- dataTransfer.items.add('sample', 'text/plain');
- dataTransfer.items.add('http://www.google.com/', 'text/uri-list');
- dataTransfer.items.add('<em>Markup</em>', 'text/html');
- dataTransfer.items.add('hello world', 'custom-data');
+ testItem = dataTransfer.items.add('sample', 'text/plain');
+ shouldBeEqualToString('testItem.kind', 'string');
+ shouldBeEqualToString('testItem.type', 'text/plain');
+ testItem = dataTransfer.items.add('http://www.google.com/', 'text/uri-list');
+ shouldBeEqualToString('testItem.kind', 'string');
+ shouldBeEqualToString('testItem.type', 'text/uri-list');
+ testItem = dataTransfer.items.add('<em>Markup</em>', 'text/html');
+ shouldBeEqualToString('testItem.kind', 'string');
+ shouldBeEqualToString('testItem.type', 'text/html');
+ testItem = dataTransfer.items.add('hello world', 'custom-data');
+ shouldBeEqualToString('testItem.kind', 'string');
+ shouldBeEqualToString('testItem.type', 'custom-data');
}
function dragstart(event)
@@ -77,6 +86,8 @@ function itemListDrop(dataTransfer)
testDataTransfer = dataTransfer;
outstandingRequests = 0;
shouldBe('testDataTransfer.items.length', '4');
+ shouldBeNull('testDataTransfer.items.add("test", "text/plain")'); // Read-only.
+ shouldBe('testDataTransfer.items.length', '4');
types = [];
for (var i = 0; i < dataTransfer.items.length; ++i) {
types.push({kind: dataTransfer.items[i].kind, type: dataTransfer.items[i].type});
« no previous file with comments | « no previous file | LayoutTests/fast/events/drag-dataTransferItemList-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698