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

Unified Diff: mojo/public/bindings/sample/sample_test.js

Issue 63033010: Mojo's C++ and JavaScript bindings should produce identical messages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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
« no previous file with comments | « mojo/public/bindings/sample/sample_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/bindings/sample/sample_test.js
diff --git a/mojo/public/bindings/sample/sample_test.js b/mojo/public/bindings/sample/sample_test.js
index 230f4df51a1d3bee2c6a99fe895c90768452c9d7..e361b85da279490f96062388deb519043f2ff51e 100644
--- a/mojo/public/bindings/sample/sample_test.js
+++ b/mojo/public/bindings/sample/sample_test.js
@@ -3,16 +3,21 @@
// found in the LICENSE file.
define([
+ "console",
+ "mojo/public/bindings/js/test/hexdump",
"gtest",
// TODO(abarth): We shouldn't need to depend on codec, but there seems to
// be a bug in the module loading system whereby this test doesn't run if
// we don't import codec here.
"mojo/public/bindings/js/codec",
"mojo/public/bindings/sample/mojom/sample_service"
- ], function(gtest, codec, sample) {
+ ], function(console, hexdump, gtest, codec, sample) {
var global = this;
+ // Set this variable to true to print the binary message in hex.
+ var dumpMessageAsHex = false;
+
function makeFoo() {
var bar = new sample.Bar();
bar.alpha = 20;
@@ -107,6 +112,8 @@ define([
}
SimpleMessageReceiver.prototype.accept = function(message) {
+ if (dumpMessageAsHex)
+ console.log(hexdump.dumpArray(message.memory));
// Imagine some IPC happened here.
var serviceImpl = new ServiceImpl();
serviceImpl.accept(message);
« no previous file with comments | « mojo/public/bindings/sample/sample_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698