зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1143537 - Part 1: Fix test numbering. r=jdaggett
This commit is contained in:
Родитель
eeb282726e
Коммит
a1e1bf9cc2
|
@ -796,17 +796,17 @@ function runTest() {
|
|||
var rule = style.sheet.cssRules[0];
|
||||
|
||||
var all = Array.from(document.fonts);
|
||||
is(all.length, 1, "document.fonts should contain one FontFace (TEST 34)");
|
||||
is(all.length, 1, "document.fonts should contain one FontFace (TEST 33)");
|
||||
|
||||
var face = all[0];
|
||||
is(face.family, "\"something\"", "FontFace should have correct family value (TEST 34)");
|
||||
is(face.family, "\"something\"", "FontFace should have correct family value (TEST 33)");
|
||||
Object.keys(nonDefaultValues).forEach(function(aDesc) {
|
||||
var ok_todo = aDesc == "variant" ? todo : ok;
|
||||
ok_todo(face[aDesc] == nonDefaultValues[aDesc][1], "FontFace should have correct " + aDesc + " value (TEST 34)");
|
||||
ok_todo(face[aDesc] == nonDefaultValues[aDesc][1], "FontFace should have correct " + aDesc + " value (TEST 33)");
|
||||
});
|
||||
|
||||
document.fonts.clear();
|
||||
ok(document.fonts.has(face), "CSS-connected FontFace should not be removed from document.fonts when clear is called (TEST 34)");
|
||||
ok(document.fonts.has(face), "CSS-connected FontFace should not be removed from document.fonts when clear is called (TEST 33)");
|
||||
|
||||
var exceptionName = "";
|
||||
try {
|
||||
|
@ -814,23 +814,23 @@ function runTest() {
|
|||
} catch (ex) {
|
||||
exceptionName = ex.name;
|
||||
}
|
||||
ok(exceptionName == "InvalidModificationError", "attempting to remove CSS-connected FontFace from document.fonts should throw an InvalidModificationError (TEST 34)");
|
||||
ok(document.fonts.has(face), "CSS-connected FontFace should not be removed from document.fonts when delete is called (TEST 34)");
|
||||
ok(exceptionName == "InvalidModificationError", "attempting to remove CSS-connected FontFace from document.fonts should throw an InvalidModificationError (TEST 33)");
|
||||
ok(document.fonts.has(face), "CSS-connected FontFace should not be removed from document.fonts when delete is called (TEST 33)");
|
||||
|
||||
style.textContent = "";
|
||||
document.body.offsetTop;
|
||||
|
||||
ok(!document.fonts.has(face), "CSS-connected FontFace should be removed from document.fonts once the rule has been removed (TEST 34)");
|
||||
ok(!document.fonts.has(face), "CSS-connected FontFace should be removed from document.fonts once the rule has been removed (TEST 33)");
|
||||
|
||||
document.fonts.add(face);
|
||||
ok(document.fonts.has(face), "previously CSS-connected FontFace should be able to be added to document.fonts (TEST 34)");
|
||||
ok(document.fonts.has(face), "previously CSS-connected FontFace should be able to be added to document.fonts (TEST 33)");
|
||||
|
||||
document.fonts.delete(face);
|
||||
ok(!document.fonts.has(face), "previously CSS-connected FontFace should be able to be removed from document.fonts (TEST 34)");
|
||||
ok(!document.fonts.has(face), "previously CSS-connected FontFace should be able to be removed from document.fonts (TEST 33)");
|
||||
|
||||
}).then(function() {
|
||||
|
||||
// (TEST 34) Test that a pending style sheet load prevents
|
||||
// (TEST LAST) Test that a pending style sheet load prevents
|
||||
// document.fonts.status from being set to "loaded".
|
||||
|
||||
// First, add a FontFace to document.fonts that will load soon.
|
||||
|
@ -848,7 +848,7 @@ function runTest() {
|
|||
return setTimeoutZero() // wait for the style sheet to start loading
|
||||
.then(function() {
|
||||
document.fonts.clear();
|
||||
is(document.fonts.status, "loading", "FontFaceSet.status when the FontFaceSet has been cleared of loading FontFaces but there is a pending style sheet load (TEST 33)");
|
||||
is(document.fonts.status, "loading", "FontFaceSet.status when the FontFaceSet has been cleared of loading FontFaces but there is a pending style sheet load (TEST LAST)");
|
||||
document.head.removeChild(link);
|
||||
// XXX Removing the <link> element won't cancel the load of the
|
||||
// style sheet, so we can't do that to test that
|
||||
|
|
Загрузка…
Ссылка в новой задаче