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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/background-serialize.html

Issue 2228733005: Convert fast/css/background-serialize.html test to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed review comments Created 4 years, 4 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/css/background-serialize-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/css/background-serialize.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/background-serialize.html b/third_party/WebKit/LayoutTests/fast/css/background-serialize.html
index d055832a41b39a4752a50d1335b27608acfa2fb1..0808de2edb6e3616a917952dd6066b928b957603 100644
--- a/third_party/WebKit/LayoutTests/fast/css/background-serialize.html
+++ b/third_party/WebKit/LayoutTests/fast/css/background-serialize.html
@@ -1,40 +1,34 @@
<!doctype html>
-<html>
<head>
-<script src="../../resources/js-test.js"></script>
+<title>Test background properties obtained by using cssText when the properties are set by using style element's textContent.</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
</head>
-<body>
- <pre id='console'></pre>
-</body>
<script>
+test(function() {
var style = document.createElement('style');
document.head.appendChild(style);
+assert_equals(getStyle('.test { background: none; }'), '.test { background: none; }');
+assert_equals(getStyle('.test { background: none; background-color: black;}'), '.test { background: none black; }');
+assert_equals(getStyle('.test { background: none; background-color: initial !important;}'), '.test { background-image: none; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial !important; }');
+assert_equals(getStyle('.test { background: initial; }'), '.test { background: initial; }');
+assert_equals(getStyle('.test { background: initial; background-color: black; }'), '.test { background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: black; }');
+assert_equals(getStyle('.test { background: inherit; }'), '.test { background: inherit; }');
+assert_equals(getStyle('.test { background: inherit; background-color: black; }'), '.test { background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: black; }');
+assert_equals(getStyle('.test { background: none; background-repeat: repeat-x !important;}'), '.test { background-image: none; background-position: initial; background-size: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-repeat: repeat-x !important; }');
+assert_equals(getStyle('.test { background: none; background-repeat: repeat-x;}'), '.test { background: none repeat-x; }');
+assert_equals(getStyle('.test { background: none; background-position-x: 0%;}'), '.test { background: none 0%; }');
+assert_equals(getStyle('.test { background: none; background-position: 20% 80%;}'), '.test { background: none 20% 80%; }');
+assert_equals(getStyle('.test { background-position-x: 5%; }'), '.test { background-position-x: 5%; }');
+assert_equals(getStyle('.test { background-position-y: 5%; }'), '.test { background-position-y: 5%; }');
+assert_equals(getStyle('.test { background-position-x: 5%; background-position-y: 10%; }'), '.test { background-position: 5% 10%; }');
+assert_equals(getStyle('.test { background-position-x: 5%; background-position-y: 10% !important; }'), '.test { background-position-x: 5%; background-position-y: 10% !important; }');
+assert_equals(getStyle('.test { background: url(dummy://test.png); }'), '.test { background: url("dummy://test.png"); }');
+assert_equals(getStyle('.test { background: url(dummy://test.png); background-color: black; }'), '.test { background: url("dummy://test.png") black; }');
-function test(text) {
+function getStyle(text) {
style.textContent = text;
return style.sheet.cssRules[0].cssText;
}
-
-description("Test background properties obtained by using cssText when the properties are set by using style element's textContent.");
-
-shouldBeEqualToString("test('.test { background: none; }')", ".test { background: none; }");
-shouldBeEqualToString("test('.test { background: none; background-color: black;}')", ".test { background: none black; }");
-shouldBeEqualToString("test('.test { background: none; background-color: initial !important;}')", ".test { background-image: none; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial !important; }");
-shouldBeEqualToString("test('.test { background: initial; }')", ".test { background: initial; }");
-shouldBeEqualToString("test('.test { background: initial; background-color: black; }')", ".test { background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: black; }");
-shouldBeEqualToString("test('.test { background: inherit; }')", ".test { background: inherit; }");
-shouldBeEqualToString("test('.test { background: inherit; background-color: black; }')", ".test { background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: black; }");
-shouldBeEqualToString("test('.test { background: none; background-repeat: repeat-x !important;}')", ".test { background-image: none; background-position: initial; background-size: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-repeat: repeat-x !important; }");
-shouldBeEqualToString("test('.test { background: none; background-repeat: repeat-x;}')", ".test { background: none repeat-x; }");
-shouldBeEqualToString("test('.test { background: none; background-position-x: 0%;}')", ".test { background: none 0%; }");
-shouldBeEqualToString("test('.test { background: none; background-position: 20% 80%;}')", ".test { background: none 20% 80%; }");
-shouldBeEqualToString("test('.test { background-position-x: 5%; }')", ".test { background-position-x: 5%; }");
-shouldBeEqualToString("test('.test { background-position-y: 5%; }')", ".test { background-position-y: 5%; }");
-shouldBeEqualToString("test('.test { background-position-x: 5%; background-position-y: 10%; }')", ".test { background-position: 5% 10%; }");
-shouldBeEqualToString("test('.test { background-position-x: 5%; background-position-y: 10% !important; }')", ".test { background-position-x: 5%; background-position-y: 10% !important; }");
-shouldBeEqualToString("test('.test { background: url(dummy://test.png); }')", '.test { background: url("dummy://test.png"); }');
-shouldBeEqualToString("test('.test { background: url(dummy://test.png); background-color: black; }')", '.test { background: url("dummy://test.png") black; }');
-
+});
</script>
-<script src="../js/resources/js-test-post.js"></script>
-</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/css/background-serialize-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698