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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/suborigins/crossorigin/suborigin-cors-style.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-style.php
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/suborigins/crossorigin/suborigin-cors-style.php b/third_party/WebKit/LayoutTests/http/tests/security/suborigins/crossorigin/suborigin-cors-style.php
index 27f195e2cfc7e60d2994bcab41e059ad4ddca02a..e3d292f824ec2d0a5a1cfbd4d5fa05eb53921962 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/suborigins/crossorigin/suborigin-cors-style.php
+++ b/third_party/WebKit/LayoutTests/http/tests/security/suborigins/crossorigin/suborigin-cors-style.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,56 +15,60 @@ header("Suborigin: foobar");
<script>
var style_tests = [];
style_tests.next = function() {
- if (style_tests.length > 0) {
- style_tests.shift().execute();
- }
+ if (style_tests.length > 0) {
+ style_tests.shift().execute();
+ }
}
-var SuboriginStyleTest = function(pass, name, href, crossoriginValue) {
- var style_pass_verify = function (div, e) {
- var background = window.getComputedStyle(div, null).getPropertyValue("background-color");
- assert_equals(background, "rgb(255, 255, 0)");
- };
+var SuboriginStyleTest = function(pass, name, href, crossorigin_value) {
+ var style_pass_verify = function (div, e) {
+ var background =
+ window.getComputedStyle(div, null).getPropertyValue('background-color');
+ assert_equals(background, 'rgb(255, 255, 0)');
+ };
- var style_fail_verify = function(div, e) {
- var background = window.getComputedStyle(div, null).getPropertyValue("background-color");
- assert_equals(background, "rgba(0, 0, 0, 0)");
- };
+ var style_fail_verify = function(div, e) {
+ var background =
+ window.getComputedStyle(div, null).getPropertyValue('background-color');
+ assert_equals(background, 'rgba(0, 0, 0, 0)');
+ };
- SuboriginLinkTest.call(this, style_tests, "stylesheet", style_pass_verify, style_fail_verify, pass, "Style: " + name, href, crossoriginValue);
+ SuboriginLinkTest.call(
+ this, style_tests, 'stylesheet', style_pass_verify,
+ style_fail_verify, pass, 'Style: ' + name, href, crossorigin_value);
};
SuboriginStyleTest.prototype = Object.create(SuboriginLinkTest.prototype);
add_result_callback(function(res) {
- if (res.name.startsWith("Style: ") || res.name.startsWith("Import: ")) {
- style_tests.next();
+ if (res.name.startsWith('Style: ') || res.name.startsWith('Import: ')) {
+ style_tests.next();
}
-});
+ });
// Style tests
new SuboriginStyleTest(
false,
- "<crossorigin='anonymous'>, ACAO: " + server,
+ '<crossorigin="anonymous">, ACAO: ' + server,
xoriginAnonStyle(),
- "anonymous");
+ 'anonymous');
new SuboriginStyleTest(
true,
- "<crossorigin='anonymous'>, ACAO: *",
+ '<crossorigin="anonymous">, ACAO: *',
xoriginAnonStyle('*'),
- "anonymous");
+ 'anonymous');
new SuboriginStyleTest(
false,
- "<crossorigin='use-credentials'>, ACAO: " + server,
+ '<crossorigin="use-credentials">, ACAO: ' + server,
xoriginCredsStyle(),
- "use-credentials");
+ 'use-credentials');
new SuboriginStyleTest(
false,
- "<crossorigin='anonymous'>, CORS-ineligible resource",
+ '<crossorigin="anonymous">, CORS-ineligible resource',
xoriginIneligibleStyle(),
- "anonymous");
+ 'anonymous');
style_tests.next();
</script>

Powered by Google App Engine
This is Rietveld 408576698