Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(485)

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/suborigins/crossorigin/suborigin-cors-font-face.php

Issue 2370843003: Suborigin LayoutTest formatting and refactoring (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698