https://github.com/web-platform-tests/wpt
Raw File
Tip revision: f7662c3bc8a928fd55e76b83ed55ddc88a52447a authored by Marcos Cáceres on 19 March 2018, 05:46:16 UTC
user activation survives postMessage()
Tip revision: f7662c3
input-setcustomvalidity.html
<!DOCTYPE HTML>
<html>
 <head>
  <title>Forms</title>
  <script src="/resources/testharness.js"></script>
  <script src="/resources/testharnessreport.js"></script>
 </head>
 <body>
  <p>
    <h3>input_setCustomValidity</h3>
  </p>

  <hr>

  <div id="log"></div>

  <form method="post"
      enctype="application/x-www-form-urlencoded"
      action=""
      id="input_form">
    <p><input type='hidden' id='input_text'></p>
  </form>
  <script>

    var input = document.getElementById("input_text");

    try
    {
      input.setCustomValidity("custom error");
      test(function() {
        assert_true(true, "calling of setCustomValidity method is successed.");
      });
    }
    catch (e) {
      test(function() {
        assert_unreached("Error is raised.");
      });
    }

  </script>

 </body>
</html>
back to top