https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 426d4707da2b60265fba7e5112ccbda72b113580 authored by Anne van Kesteren on 24 April 2018, 09:28:12 UTC
nit and use assert_equals
Tip revision: 426d470
css-transform-style-evaluation-validation.html
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>CSS Transforms Test: property</title>
    <link rel="author" title="Intel" href="http://www.intel.com">
    <link rel="help" href="http://www.w3.org/TR/css-transforms-1/#transform-property">
    <meta name="flags" content="dom">
    <script src="/resources/testharness.js"></script>
    <script src="/resources/testharnessreport.js"></script>
  </head>
  <body>
    <div id="test"></div>
    <div id="log"></div>
    <script>
      test(function() {
        document.getElementById("test").style.transform = "rotate(30deg),rotateX(60deg)"
        assert_equals(document.getElementById("test").style.transform, "", "expect NULL");
      }, "transform: Check bad-format multi-expr input.");

      test(function() {
        document.getElementById("test").style.transform = "rotate(30deg)|rotateX(60deg)";
        assert_equals(document.getElementById("test").style.transform, "", "expect not NULL");
      }, "transform: Check multi-expr input with tab.");

      test(function() {
        document.getElementById("test").style.transform = " rotate(30deg) rotateX(60deg) ";
        assert_not_equals(document.getElementById("test").style.transform, "", "expect not NULL");
      }, "transform: Check multi-expr input with spaces start and end.");

      test(function() {
        document.getElementById("test").style.transform = "rotate(30deg)  rotateX(60deg)";
        assert_not_equals(document.getElementById("test").style.transform, "", "expect not NULL");
      }, "transform: Check multi-expr input with two spaces.");

      test(function() {
        document.getElementById("test").style.transform = "rotate(30deg) rotateX(60deg)";
        assert_not_equals(document.getElementById("test").style.transform, "", "expect not NULL");
      }, "transform: Check valied multi-expr input.");

      test(function() {
        document.getElementById("test").style.transform = "rotate(0)";
        assert_not_equals(document.getElementById("test").style.transform, "", "expect not NULL");
      }, "transform: Check rotate(0) input.");

      test(function() {
        document.getElementById("test").style.transform = "rotateX(0)";
        assert_not_equals(document.getElementById("test").style.transform, "", "expect not NULL");
      }, "transform: Check rotateX(0) input.");

      test(function() {
        document.getElementById("test").style.transform = "rotateY(0)";
        assert_not_equals(document.getElementById("test").style.transform, "", "expect not NULL");
      }, "transform: Check rotateY(0) input.");

      test(function() {
        document.getElementById("test").style.transform = "rotateZ(0)";
        assert_not_equals(document.getElementById("test").style.transform, "", "expect not NULL");
      }, "transform: Check rotateZ(0) input.");

      test(function() {
        document.getElementById("test").style.transform = "rotate(string)";
        assert_not_equals(document.getElementById("test").style.transform, "", "expect not NULL");
      }, "transform: Check rotate(string) input.");

      test(function() {
        document.getElementById("test").style.transform = "rotateX(string)";
        assert_not_equals(document.getElementById("test").style.transform, "", "expect not NULL");
      }, "transform: Check rotateX(string) input.");

      test(function() {
        document.getElementById("test").style.transform = "rotateY(string)";
        assert_not_equals(document.getElementById("test").style.transform, "", "expect not NULL");
      }, "transform: Check rotateY(string) input.");

      test(function() {
        document.getElementById("test").style.transform = "rotateZ(string)";
        assert_not_equals(document.getElementById("test").style.transform, "", "expect not NULL");
      }, "transform: Check rotateZ(string) input.");
    </script>
  </body>
</html>
back to top