Index: third_party/WebKit/LayoutTests/http/tests/security/suborigins/crossorigin/suborigin-cors-font-face.php |
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/suborigins/crossorigin/suborigin-cors-font-face.php b/third_party/WebKit/LayoutTests/http/tests/security/suborigins/crossorigin/suborigin-cors-font-face.php |
index ec2a831147e09241c7446a32fa2a92dd0d899d7f..3f7d2afee5342101ec6fde83f7c4eb00ee46cac1 100644 |
--- a/third_party/WebKit/LayoutTests/http/tests/security/suborigins/crossorigin/suborigin-cors-font-face.php |
+++ b/third_party/WebKit/LayoutTests/http/tests/security/suborigins/crossorigin/suborigin-cors-font-face.php |
@@ -4,6 +4,7 @@ header("Suborigin: foobar"); |
<!DOCTYPE html> |
<html> |
<head> |
+<meta charset="utf-8"> |
<title>Allow suborigin in HTTP header</title> |
<script src="/resources/testharness.js"></script> |
<script src="/resources/testharnessreport.js"></script> |
@@ -14,55 +15,57 @@ header("Suborigin: foobar"); |
<script> |
// FontFace tests |
var SuboriginFontFaceTest = function(pass, name, src) { |
- SuboriginTest.call(this, pass, "FontFace: " + name, src, false); |
+ SuboriginTest.call(this, pass, 'FontFace: ' + name, src, false); |
}; |
SuboriginFontFaceTest.prototype.execute = function() { |
- var test = async_test(this.name); |
- var url = "url('" + this.src + "')"; |
- var fontFace = new FontFace("ahem", url); |
+ var settings = this; |
+ async_test(test => { |
+ var url = 'url(\'' + settings.src + '\')'; |
+ var fontFace = new FontFace('ahem', url); |
- if (this.pass) { |
- fontFace.load().then( |
- function(loadedFace) { |
- test.step(function() { |
- assert_equals(loadedFace.family, "ahem"); |
- test.done(); |
+ if (settings.pass) { |
+ fontFace.load() |
+ .then(function(loadedFace) { |
+ test.step(function() { |
+ assert_equals(loadedFace.family, 'ahem'); |
+ test.done(); |
})}, |
function() { |
- test.step(function() { |
- assert_unreached("Good FontFace failed to load."); |
- test.done(); |
+ test.step(function() { |
+ assert_unreached('Good FontFace failed to load.'); |
+ test.done(); |
}); |
}); |
- } else { |
- fontFace.load().then( |
- function() { |
- test.step(function() { |
- assert_unreached("Bad FontFace loaded."); |
- test.done(); |
+ } else { |
+ fontFace.load() |
+ .then(function() { |
+ test.step(function() { |
+ assert_unreached('Bad FontFace loaded.'); |
+ test.done(); |
})}, |
function() { |
- test.step(function() { |
- test.done(); |
+ test.step(function() { |
+ test.done(); |
}); |
}); |
- } |
+ } |
+ }, settings.name); |
}; |
// CSS FontFace tests |
new SuboriginFontFaceTest( |
- false, |
- "ACAO: " + server, |
- xoriginFont()).execute(); |
+ false, |
+ 'ACAO: ' + server, |
+ xoriginFont()).execute(); |
new SuboriginFontFaceTest( |
- true, |
- "ACAO: *", |
- xoriginFont('*')).execute(); |
+ true, |
+ 'ACAO: *', |
+ xoriginFont('*')).execute(); |
new SuboriginFontFaceTest( |
- false, |
- "CORS-ineligible resource", |
- xoriginIneligibleFont()).execute(); |
+ false, |
+ 'CORS-ineligible resource', |
+ xoriginIneligibleFont()).execute(); |
</script> |
</body> |
</html> |