Revision ae13e0657812995fed82c383c820036aeb03108a authored by Stephen McGruer on 13 March 2018, 01:33:01 UTC, committed by Blink WPT Bot on 13 March 2018, 01:41:53 UTC
The spec says that setting the current time to null should throw if the existing currentTime is non-null, or do nothing otherwise. Bug: 818196 Change-Id: Iac89e46d6b884c924c88b603fbec77b61a337ce2 Reviewed-on: https://chromium-review.googlesource.com/946050 Reviewed-by: Xida Chen <xidachen@chromium.org> Commit-Queue: Stephen McGruer <smcgruer@chromium.org> Cr-Commit-Position: refs/heads/master@{#542682}
1 parent 28300a0
formdata-foreach.html
<!doctype html>
<html lang=en>
<meta charset=utf-8>
<title>FormData: foreach</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<link rel="help" href="https://xhr.spec.whatwg.org/#interface-formdata" />
<script>
var fd = new FormData();
fd.append('n1', 'v1');
fd.append('n2', 'v2');
fd.append('n3', 'v3');
fd.append('n1', 'v4');
fd.append('n2', 'v5');
fd.append('n3', 'v6');
fd.delete('n2');
var file = new File(['hello'], "hello.txt");
fd.append('f1', file);
var expected_keys = ['n1', 'n3', 'n1', 'n3', 'f1'];
var expected_values = ['v1', 'v3', 'v4', 'v6', file];
test(function() {
var mykeys = [], myvalues = [];
for(var entry of fd) {
assert_equals(entry.length, 2,
'Default iterator should yield key/value pairs');
mykeys.push(entry[0]);
myvalues.push(entry[1]);
}
assert_array_equals(mykeys, expected_keys,
'Default iterator should see duplicate keys');
assert_array_equals(myvalues, expected_values,
'Default iterator should see non-deleted values');
}, 'Iterator should return duplicate keys and non-deleted values');
test(function() {
var mykeys = [], myvalues = [];
for(var entry of fd.entries()) {
assert_equals(entry.length, 2,
'entries() iterator should yield key/value pairs');
mykeys.push(entry[0]);
myvalues.push(entry[1]);
}
assert_array_equals(mykeys, expected_keys,
'entries() iterator should see duplicate keys');
assert_array_equals(myvalues, expected_values,
'entries() iterator should see non-deleted values');
}, 'Entries iterator should return duplicate keys and non-deleted values');
test(function() {
var mykeys = [];
for(var entry of fd.keys())
mykeys.push(entry);
assert_array_equals(mykeys, expected_keys,
'keys() iterator should see duplicate keys');
}, 'Keys iterator should return duplicates');
test(function() {
var myvalues = [];
for(var entry of fd.values())
myvalues.push(entry);
assert_array_equals(myvalues, expected_values,
'values() iterator should see non-deleted values');
}, 'Values iterator should return non-deleted values');
</script>
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...