mirror of
https://github.com/servo/servo.git
synced 2025-08-11 16:35:33 +01:00
Update web-platform-tests and CSS tests.
- Update CSS tests to revision e05bfd5e30ed662c2f8a353577003f8eed230180. - Update web-platform-tests to revision a052787dd5c069a340031011196b73affbd68cd9.
This commit is contained in:
parent
fb4f421c8b
commit
296fa2512b
21852 changed files with 2080936 additions and 892894 deletions
|
@ -62,12 +62,14 @@ function createdb_for_multiple_tests(dbname, version) {
|
|||
assert_unreached("unexpected open." + evt + " event");
|
||||
}
|
||||
|
||||
if (e.target.result + "" == "[object IDBDatabase]" && !this.db) {
|
||||
this.db = e.target.result;
|
||||
if (e.target.result + '' == '[object IDBDatabase]' &&
|
||||
!this.db) {
|
||||
this.db = e.target.result;
|
||||
|
||||
this.db.onerror = fail(test, "unexpected db.error");
|
||||
this.db.onabort = fail(test, "unexpected db.abort");
|
||||
this.db.onversionchange = fail(test, "unexpected db.versionchange");
|
||||
this.db.onerror = fail(test, 'unexpected db.error');
|
||||
this.db.onabort = fail(test, 'unexpected db.abort');
|
||||
this.db.onversionchange =
|
||||
fail(test, 'unexpected db.versionchange');
|
||||
}
|
||||
})
|
||||
})
|
||||
|
@ -102,22 +104,42 @@ function assert_key_equals(actual, expected, description) {
|
|||
assert_equals(indexedDB.cmp(actual, expected), 0, description);
|
||||
}
|
||||
|
||||
function indexeddb_test(upgrade_func, open_func, description) {
|
||||
async_test(function(t) {
|
||||
var dbname = document.location + '-' + t.name;
|
||||
var del = indexedDB.deleteDatabase(dbname);
|
||||
del.onerror = t.unreached_func('deleteDatabase should succeed');
|
||||
var open = indexedDB.open(dbname, 1);
|
||||
open.onerror = t.unreached_func('open should succeed');
|
||||
open.onupgradeneeded = t.step_func(function() {
|
||||
var db = open.result;
|
||||
var tx = open.transaction;
|
||||
upgrade_func(t, db, tx);
|
||||
});
|
||||
open.onsuccess = t.step_func(function() {
|
||||
var db = open.result;
|
||||
if (open_func)
|
||||
open_func(t, db);
|
||||
});
|
||||
}, description);
|
||||
function indexeddb_test(upgrade_func, open_func, description, options) {
|
||||
async_test(function(t) {
|
||||
var options = Object.assign({upgrade_will_abort: false}, options);
|
||||
var dbname = document.location + '-' + t.name;
|
||||
var del = indexedDB.deleteDatabase(dbname);
|
||||
del.onerror = t.unreached_func('deleteDatabase should succeed');
|
||||
var open = indexedDB.open(dbname, 1);
|
||||
if (!options.upgrade_will_abort) {
|
||||
open.onsuccess = t.unreached_func('open should not succeed');
|
||||
} else {
|
||||
open.onerror = t.unreached_func('open should succeed');
|
||||
}
|
||||
open.onupgradeneeded = t.step_func(function() {
|
||||
var db = open.result;
|
||||
var tx = open.transaction;
|
||||
upgrade_func(t, db, tx);
|
||||
});
|
||||
open.onsuccess = t.step_func(function() {
|
||||
var db = open.result;
|
||||
if (open_func)
|
||||
open_func(t, db);
|
||||
});
|
||||
}, description);
|
||||
}
|
||||
|
||||
// Call with a Test and an array of expected results in order. Returns
|
||||
// a function; call the function when a result arrives and when the
|
||||
// expected number appear the order will be asserted and test
|
||||
// completed.
|
||||
function expect(t, expected) {
|
||||
var results = [];
|
||||
return result => {
|
||||
results.push(result);
|
||||
if (results.length === expected.length) {
|
||||
assert_array_equals(results, expected);
|
||||
t.done();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue