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

Unified Diff: LayoutTests/transforms/resources/parsing-test-helper.js

Issue 98663004: Add support for unprefixed CSS Transforms (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase. Created 6 years, 9 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: LayoutTests/transforms/resources/parsing-test-helper.js
diff --git a/LayoutTests/transforms/resources/parsing-test-helper.js b/LayoutTests/transforms/resources/parsing-test-helper.js
new file mode 100644
index 0000000000000000000000000000000000000000..572e76f5a20c55e74d12f339ad2510284e333504
--- /dev/null
+++ b/LayoutTests/transforms/resources/parsing-test-helper.js
@@ -0,0 +1,35 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+window.expect = (function() {
+ var testElement = document.getElementById('target');
+
+ function assert_equals_or_matches(actual, expected, description) {
+ return expected instanceof RegExp ?
+ assert_regexp_match(actual, expected, description) :
+ assert_equals(actual, expected, description);
+ }
+ return function expect(property, camelProperty, input) {
+ return {
+ parsesAs: function(output) {
+ test(function() {
+ assert_true(CSS.supports(property, input), 'CSS.supports');
+ testElement.style[camelProperty] = input;
+ assert_equals(testElement.style[camelProperty], output);
+ }, '"' + property + ': ' + input + ';" should parse as "' + output + '"');
+ return this;
+ },
+ isComputedTo: function(output) {
+ test(function() {
+ testElement.style[camelProperty] = input;
+ assert_equals_or_matches(getComputedStyle(testElement)[camelProperty], output);
+ }, '"' + property + ': ' + input + ';" should be computed to "' + output + '"');
+ },
+ isInvalid: function() {
+ test(function() {
+ assert_false(CSS.supports(property, input), 'CSS.supports');
+ }, '"' + property + ': ' + input + ';" should be invalid');
+ },
+ };
+ }
+})();
« no previous file with comments | « LayoutTests/transforms/perspective-parsing-expected.txt ('k') | LayoutTests/transforms/transform-origin-parsing.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698