Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Unified Diff: LayoutTests/fast/js/webidl-type-mapping.html

Issue 16951005: Add support for byte and octet Web IDL types to the bindings generator (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/js/webidl-type-mapping.html
diff --git a/LayoutTests/fast/js/webidl-type-mapping.html b/LayoutTests/fast/js/webidl-type-mapping.html
index d811e5c14f1e4a0617071db84629cd229d892ce3..f978d399c03fc5fcc406f453ab262c4364691e50 100644
--- a/LayoutTests/fast/js/webidl-type-mapping.html
+++ b/LayoutTests/fast/js/webidl-type-mapping.html
@@ -325,5 +325,101 @@ testNonNumericToNumericEnforceRange(type);
convertThrows(type, "{valueOf:function(){throw new Error('custom');}}");
debug("");
+type = "testByte";
+verifyAttribute(type);
+convert(type, "0");
+convert(type, "-1");
+convert(type, "1");
+convert(type, "0x7F");
+convert(type, "0x80", "-0x80");
+convert(type, "-0x7F");
+convert(type, "-0x80");
+convert(type, "-0x81", "0x7F");
+convert(type, "Number.MIN_VALUE", "0");
+convert(type, "-Number.MIN_VALUE", "0");
+convert(type, "Number.MAX_VALUE", "0");
+convert(type, "-Number.MAX_VALUE", "0");
+convert(type, "1.99", "1");
+convert(type, "-1.99", "-1");
+convert(type, "Infinity", "0");
+convert(type, "-Infinity", "0");
+convert(type, "NaN", "0");
+testNonNumericToNumeric(type);
+convertThrows(type, "{valueOf:function(){throw new Error('custom');}}");
+debug("");
+
+type = "testEnforceRangeByte";
+verifyAttribute(type);
+convert(type, "0");
+convert(type, "-1");
+convert(type, "1");
+convert(type, "0x7F");
+convertThrows(type, "0x80");
+convert(type, "-0x7F");
+convert(type, "-0x80");
+convertThrows(type, "-0x81");
+convert(type, "Number.MIN_VALUE", "0");
+convert(type, "-Number.MIN_VALUE", "0");
+convertThrows(type, "Number.MAX_VALUE");
+convertThrows(type, "-Number.MAX_VALUE");
+convert(type, "1.99", "1");
+convert(type, "-1.99", "-1");
+convertThrows(type, "Infinity");
+convertThrows(type, "-Infinity");
+convertThrows(type, "NaN");
+testNonNumericToNumericEnforceRange(type);
+convertThrows(type, "{valueOf:function(){throw new Error('custom');}}");
+debug("");
+
+type = "testOctet";
+verifyAttribute(type);
+convert(type, "0");
+convert(type, "-1", "0xFF");
+convert(type, "1");
+convert(type, "0x7F");
+convert(type, "0x80");
+convert(type, "0xFF");
+convert(type, "0x100", "0");
+convert(type, "0x101", "1");
+convert(type, "-0x80", "0x80");
+convert(type, "-0x81", "0x7F");
+convert(type, "Number.MAX_VALUE", "0");
+convert(type, "Number.MIN_VALUE", "0");
+convert(type, "-Number.MAX_VALUE", "0");
+convert(type, "-Number.MIN_VALUE", "0");
+convert(type, "1.99", "1");
+convert(type, "-1.99", "0xFF");
+convert(type, "Infinity", "0");
+convert(type, "-Infinity", "0");
+convert(type, "NaN", "0");
+testNonNumericToNumeric(type);
+convertThrows(type, "{valueOf:function(){throw new Error('custom');}}");
+debug("");
+
+type = "testEnforceRangeOctet";
+verifyAttribute(type);
+convert(type, "0");
+convertThrows(type, "-1");
+convert(type, "1");
+convert(type, "0x7F");
+convert(type, "0x80");
+convert(type, "0xFF");
+convertThrows(type, "0x100");
+convertThrows(type, "0x101");
+convertThrows(type, "-0x80");
+convertThrows(type, "-0x81");
+convertThrows(type, "Number.MAX_VALUE");
+convert(type, "Number.MIN_VALUE", "0");
+convertThrows(type, "-Number.MAX_VALUE");
+convert(type, "-Number.MIN_VALUE", "0");
+convert(type, "1.99", "1");
+convertThrows(type, "-1.99");
+convertThrows(type, "Infinity");
+convertThrows(type, "-Infinity");
+convertThrows(type, "NaN");
+testNonNumericToNumericEnforceRange(type);
+convertThrows(type, "{valueOf:function(){throw new Error('custom');}}");
+debug("");
+
</script>
<script src="resources/js-test-post.js"></script>
« no previous file with comments | « no previous file | LayoutTests/fast/js/webidl-type-mapping-expected.txt » ('j') | Source/bindings/scripts/CodeGeneratorV8.pm » ('J')

Powered by Google App Engine
This is Rietveld 408576698