зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1286439 - Fix the last FormData-append XHR web platform test. r=jgraham
--HG-- extra : rebase_source : 19ead5bc7c2adc154f9f20f790824db63d740579
This commit is contained in:
Родитель
30036214e5
Коммит
b02c59194a
|
@ -1,5 +0,0 @@
|
|||
[FormData-append.html]
|
||||
type: testharness
|
||||
[testFormDataAppendEmptyBlob]
|
||||
expected: FAIL
|
||||
|
|
@ -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() {
|
||||
|
|
|
@ -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')
|
||||
|
|
Загрузка…
Ссылка в новой задаче