Bug 1286439 - Fix the last FormData-append XHR web platform test. r=jgraham

--HG--
extra : rebase_source : 19ead5bc7c2adc154f9f20f790824db63d740579
This commit is contained in:
Thomas Wisniewski 2016-07-19 13:18:01 -04:00
parent 30036214e5
commit b02c59194a
3 changed files with 8 additions and 8 deletions

View File

@ -1,5 +0,0 @@
[FormData-append.html]
type: testharness
[testFormDataAppendEmptyBlob]
expected: FAIL

View File

@ -80,8 +80,13 @@
assert_equals(fd.get('key'), "null");
}, 'testFormDataAppendToFormNull2');
test(function() {
assert_object_equals(create_formdata(['key', new Blob(), 'blank.txt']).get('key'),
new File(new Blob(), 'blank.txt'));
var before = new Date(new Date().getTime() - 2000); // two seconds ago, in case there's clock drift
var fd = create_formdata(['key', new Blob(), 'blank.txt']).get('key');
assert_equals(fd.name, "blank.txt");
assert_equals(fd.type, "");
assert_equals(fd.size, 0);
assert_greater_than_equal(fd.lastModified, before);
assert_less_than_equal(fd.lastModified, new Date());
}, 'testFormDataAppendEmptyBlob');
function create_formdata() {

View File

@ -45,7 +45,7 @@
test(function() {
var lastModified = Math.floor(new Date(client.responseXML.lastModified).getTime() / 1000);
var now = Math.floor(new Date().getTime() / 1000);
var now = Math.floor(new Date().getTime(new Date().getTime() + 2000) / 1000); // two seconds from now, in case there's clock drift
assert_greater_than_equal(lastModified, timePreXHR);
assert_less_than_equal(lastModified, now);
}, 'lastModified set to time of response if no HTTP header provided')