| 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,
|
|
|