https://github.com/web-platform-tests/wpt
Raw File
Tip revision: a78790aeb8417fb65c61a74ca82aea5f1e7c63ff authored by James Graham on 28 March 2014, 16:19:44 UTC
Make marquee test run much faster
Tip revision: a78790a
idbfactory_open9.htm
<!DOCTYPE html>
<title>IDBFactory.open() - errors in version argument</title>
<script src="support.js"></script>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
test(function() {
  [-1, -0.5, 0, 0.5, 0.8, 0x20000000000000, NaN, Infinity, -Infinity, "foo", undefined, null, false,
    { toString: function() { assert_unreached("toString should not be called for ToPrimitive [Number]"); },
      valueOf: function() { return 0; } },
    { toString: function() { return 0; },
      valueOf: function() { return {}; } },
    { toString: function() { return {}; },
      valueOf: function() { return {}; } }
  ].forEach(function(val) {
    test(function() {
      assert_throws(new TypeError(), function() {
        window.indexedDB.open(databaseName, val);
      });
    }, "Calling open() with version argument " +
       ((typeof val == "object" && val) ? "object" : format_value(val)) +
       " should throw TypeError.");
  });
  [1.5].forEach(function(val) {
    test(function() {
      window.indexedDB.open(databaseName, val);
    }, "Calling open() with version argument " +
       ((typeof val == "object" && val) ? "object" : format_value(val)) +
       " should not throw.");
  });
});
</script>
back to top