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

Unified Diff: mojo/public/bindings/js/codec_unittests.js

Issue 68323004: Port Mojo's sample_service.cc to JavaScript (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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: mojo/public/bindings/js/codec_unittests.js
diff --git a/mojo/public/bindings/js/codec_unittests.js b/mojo/public/bindings/js/codec_unittests.js
index 7fd23f6f7306ff1103f85a8e2d76a1c90e7cfa47..f22791de97babee08eda4a441b2dd08d841818cc 100644
--- a/mojo/public/bindings/js/codec_unittests.js
+++ b/mojo/public/bindings/js/codec_unittests.js
@@ -5,10 +5,11 @@
define([
"gtest",
"mojo/public/bindings/js/codec",
- "mojo/public/bindings/js/test/sample_service"
+ "mojo/public/bindings/sample/mojom/sample_service"
], function(gtest, codec, sample) {
testBar();
testFoo();
+ testAlign();
this.result = "PASS";
function barMatches(bar, expected) {
@@ -161,4 +162,34 @@ define([
equalsArray(foo2.files, foo.files, "foo2.files");
}
+
+ function testAlign() {
+ var aligned = [
+ 0, // 0
+ 8, // 1
+ 8, // 2
+ 8, // 3
+ 8, // 4
+ 8, // 5
+ 8, // 6
+ 8, // 7
+ 8, // 8
+ 16, // 9
+ 16, // 10
+ 16, // 11
+ 16, // 12
+ 16, // 13
+ 16, // 14
+ 16, // 15
+ 16, // 16
+ 24, // 17
+ 24, // 18
+ 24, // 19
+ 24, // 20
+ ];
+ for (var i = 0; i < aligned.length; ++i) {
+ gtest.expectEqual(codec.align(i), aligned[i],
+ "codec.align(" + i + ") is " + codec.align(i));
+ }
+ }
});

Powered by Google App Engine
This is Rietveld 408576698