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

Unified Diff: mojo/public/js/struct_unittests.js

Issue 832583002: Mojo JS Bindings: added unit tests for int/uint values (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Sync Created 6 years 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 | « mojo/public/interfaces/bindings/tests/test_structs.mojom ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/js/struct_unittests.js
diff --git a/mojo/public/js/struct_unittests.js b/mojo/public/js/struct_unittests.js
index 5ed93ea2d1ef69528e7e1a83a31b3988c28d175d..39a8978139d1c4baa95643fd63567e90e1b07ede 100644
--- a/mojo/public/js/struct_unittests.js
+++ b/mojo/public/js/struct_unittests.js
@@ -188,6 +188,48 @@ define([
expect(decodedStruct.f9).toEqual(testStructs.FloatNumberValues.V9);
}
+ function testIntegerNumberValues() {
+ var decodedStruct = structEncodeDecode(new testStructs.IntegerNumberValues);
+ expect(decodedStruct.f0).toEqual(testStructs.IntegerNumberValues.V0);
+ expect(decodedStruct.f1).toEqual(testStructs.IntegerNumberValues.V1);
+ expect(decodedStruct.f2).toEqual(testStructs.IntegerNumberValues.V2);
+ expect(decodedStruct.f3).toEqual(testStructs.IntegerNumberValues.V3);
+ expect(decodedStruct.f4).toEqual(testStructs.IntegerNumberValues.V4);
+ expect(decodedStruct.f5).toEqual(testStructs.IntegerNumberValues.V5);
+ expect(decodedStruct.f6).toEqual(testStructs.IntegerNumberValues.V6);
+ expect(decodedStruct.f7).toEqual(testStructs.IntegerNumberValues.V7);
+ expect(decodedStruct.f8).toEqual(testStructs.IntegerNumberValues.V8);
+ expect(decodedStruct.f9).toEqual(testStructs.IntegerNumberValues.V9);
+ expect(decodedStruct.f10).toEqual(testStructs.IntegerNumberValues.V10);
+ expect(decodedStruct.f11).toEqual(testStructs.IntegerNumberValues.V11);
+ expect(decodedStruct.f12).toEqual(testStructs.IntegerNumberValues.V12);
+ expect(decodedStruct.f13).toEqual(testStructs.IntegerNumberValues.V13);
+ expect(decodedStruct.f14).toEqual(testStructs.IntegerNumberValues.V14);
+ expect(decodedStruct.f15).toEqual(testStructs.IntegerNumberValues.V15);
+ expect(decodedStruct.f16).toEqual(testStructs.IntegerNumberValues.V16);
+ expect(decodedStruct.f17).toEqual(testStructs.IntegerNumberValues.V17);
+ expect(decodedStruct.f18).toEqual(testStructs.IntegerNumberValues.V18);
+ expect(decodedStruct.f19).toEqual(testStructs.IntegerNumberValues.V19);
+ }
+
+ function testUnsignedNumberValues() {
+ var decodedStruct =
+ structEncodeDecode(new testStructs.UnsignedNumberValues);
+ expect(decodedStruct.f0).toEqual(testStructs.UnsignedNumberValues.V0);
+ expect(decodedStruct.f1).toEqual(testStructs.UnsignedNumberValues.V1);
+ expect(decodedStruct.f2).toEqual(testStructs.UnsignedNumberValues.V2);
+ expect(decodedStruct.f3).toEqual(testStructs.UnsignedNumberValues.V3);
+ expect(decodedStruct.f4).toEqual(testStructs.UnsignedNumberValues.V4);
+ expect(decodedStruct.f5).toEqual(testStructs.UnsignedNumberValues.V5);
+ expect(decodedStruct.f6).toEqual(testStructs.UnsignedNumberValues.V6);
+ expect(decodedStruct.f7).toEqual(testStructs.UnsignedNumberValues.V7);
+ expect(decodedStruct.f8).toEqual(testStructs.UnsignedNumberValues.V8);
+ expect(decodedStruct.f9).toEqual(testStructs.UnsignedNumberValues.V9);
+ expect(decodedStruct.f10).toEqual(testStructs.UnsignedNumberValues.V10);
+ expect(decodedStruct.f11).toEqual(testStructs.UnsignedNumberValues.V11);
+ }
+
+
function testBitArrayValues() {
var bitArraysStruct = new testStructs.BitArrayValues({
// array<bool, 1> f0;
@@ -222,6 +264,8 @@ define([
testMapKeyTypes();
testMapValueTypes();
testFloatNumberValues();
+ testIntegerNumberValues();
+ testUnsignedNumberValues();
testBitArrayValues();
this.result = "PASS";
});
« no previous file with comments | « mojo/public/interfaces/bindings/tests/test_structs.mojom ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698