blob: f8b20fbb14f50b49337c247b05e0ba3f17ee261c [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../../../resources/js-test.js"></script>
</head>
<body>
<script>
description("This tests the constructor for the ApplicationCacheErrorEvent DOM class.");
// No initializer is passed.
shouldBe("new ApplicationCacheErrorEvent('eventType').bubbles", "false");
shouldBe("new ApplicationCacheErrorEvent('eventType').cancelable", "false");
shouldBeEqualToString("new ApplicationCacheErrorEvent('eventType').reason", "");
shouldBeEqualToString("new ApplicationCacheErrorEvent('eventType').url", "");
shouldBe("new ApplicationCacheErrorEvent('eventType').status", "0");
shouldBeEqualToString("new ApplicationCacheErrorEvent('eventType').message", "");
// bubbles is passed.
shouldBe("new ApplicationCacheErrorEvent('eventType', { bubbles: false }).bubbles", "false");
shouldBe("new ApplicationCacheErrorEvent('eventType', { bubbles: true }).bubbles", "true");
// cancelable is passed.
shouldBe("new ApplicationCacheErrorEvent('eventType', { cancelable: false }).cancelable", "false");
shouldBe("new ApplicationCacheErrorEvent('eventType', { cancelable: true }).cancelable", "true");
// reason is passed.
shouldBeEqualToString("new ApplicationCacheErrorEvent('eventType', { reason: 'foo' }).reason", "foo");
// url is passed.
shouldBeEqualToString("new ApplicationCacheErrorEvent('eventType', { url: 'bar' }).url", "bar");
// status is passed.
shouldBe("new ApplicationCacheErrorEvent('eventType', { status: 42 }).status", "42");
// message is passed.
shouldBeEqualToString("new ApplicationCacheErrorEvent('eventType', { message: 'baz' }).message", "baz");
</script>
</body>
</html>