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

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: Take Joshua's feedback into consideration 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
« no previous file with comments | « no previous file | LayoutTests/fast/js/webidl-type-mapping-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..644886d1cbe0b4edba2955a61c9a78c072c3d674 100644
--- a/LayoutTests/fast/js/webidl-type-mapping.html
+++ b/LayoutTests/fast/js/webidl-type-mapping.html
@@ -325,5 +325,109 @@ 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, "0x1234", "0x34");
+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, "4660.99", "0x34");
+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");
+convertThrows(type, "0x1234");
+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, "4660.99");
+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, "0x1234", "0x34");
+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, "4660.99", "0x34");
+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, "0x1234");
+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, "4660.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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698