 window.addEventListener("load", runTests);
  function runTests() {
    test(function() {
      assert_equals(window.getComputedStyle(document.getElementById('x1')).direction, "ltr");
      assert_equals(window.getComputedStyle(document.getElementById('x2')).direction, "ltr");
      assert_equals(window.getComputedStyle(document.getElementById('x3')).direction, "ltr");
      assert_equals(window.getComputedStyle(document.getElementById('x4')).direction, "rtl");
    }, "Check direction");

    done();
  }
</