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

Unified Diff: mojo/bindings/js/core_unittests.js

Issue 392923002: Add support for MojoCreateMessagePipeOptions struct to JS bindings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | « mojo/bindings/js/core.cc ('k') | mojo/public/js/bindings/core.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/bindings/js/core_unittests.js
diff --git a/mojo/bindings/js/core_unittests.js b/mojo/bindings/js/core_unittests.js
index 20446dbc2607898e3121fb3de07dfc240d51bf0f..fa6cb4f49fe2abf14de4939f9a2db045ea19a617 100644
--- a/mojo/bindings/js/core_unittests.js
+++ b/mojo/bindings/js/core_unittests.js
@@ -9,13 +9,30 @@ define([
], function(expect, core, gc) {
runWithMessagePipe(testNop);
runWithMessagePipe(testReadAndWriteMessage);
+ runWithMessagePipeWithOptions(testNop);
+ runWithMessagePipeWithOptions(testReadAndWriteMessage);
runWithDataPipe(testNop);
runWithDataPipe(testReadAndWriteDataPipe);
+ runWithDataPipeWithOptions(testNop);
+ runWithDataPipeWithOptions(testReadAndWriteDataPipe);
gc.collectGarbage(); // should not crash
this.result = "PASS";
function runWithMessagePipe(test) {
var pipe = core.createMessagePipe();
+ expect(pipe.result).toBe(core.RESULT_OK);
+
+ test(pipe);
+
+ expect(core.close(pipe.handle0)).toBe(core.RESULT_OK);
+ expect(core.close(pipe.handle1)).toBe(core.RESULT_OK);
+ }
+
+ function runWithMessagePipeWithOptions(test) {
+ var pipe = core.createMessagePipe({
+ flags: core.CREATE_MESSAGE_PIPE_OPTIONS_FLAG_NONE
+ });
+ expect(pipe.result).toBe(core.RESULT_OK);
test(pipe);
@@ -24,6 +41,16 @@ define([
}
function runWithDataPipe(test) {
+ var pipe = core.createDataPipe();
+ expect(pipe.result).toBe(core.RESULT_OK);
+
+ test(pipe);
+
+ expect(core.close(pipe.producerHandle)).toBe(core.RESULT_OK);
+ expect(core.close(pipe.consumerHandle)).toBe(core.RESULT_OK);
+ }
+
+ function runWithDataPipeWithOptions(test) {
var pipe = core.createDataPipe({
flags: core.CREATE_DATA_PIPE_OPTIONS_FLAG_NONE,
elementNumBytes: 1,
« no previous file with comments | « mojo/bindings/js/core.cc ('k') | mojo/public/js/bindings/core.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698