| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 define([ | 5 define([ |
| 6 "gin/test/expect", | 6 "gin/test/expect", |
| 7 "mojo/public/js/core", | 7 "mojo/public/js/core", |
| 8 "gc", | 8 "gc", |
| 9 ], function(expect, core, gc) { | 9 ], function(expect, core, gc) { |
| 10 | 10 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 | 71 |
| 72 expect(core.close(pipe.producerHandle)).toBe(core.RESULT_OK); | 72 expect(core.close(pipe.producerHandle)).toBe(core.RESULT_OK); |
| 73 expect(core.close(pipe.consumerHandle)).toBe(core.RESULT_OK); | 73 expect(core.close(pipe.consumerHandle)).toBe(core.RESULT_OK); |
| 74 } | 74 } |
| 75 | 75 |
| 76 function testNop(pipe) { | 76 function testNop(pipe) { |
| 77 } | 77 } |
| 78 | 78 |
| 79 function testReadAndWriteMessage(pipe) { | 79 function testReadAndWriteMessage(pipe) { |
| 80 var wait = core.waitMany([], [], 0); | 80 var wait = core.waitMany([], [], 0); |
| 81 expect(wait.result).toBe(core.RESULT_INVALID_ARGUMENT); | 81 expect(wait.result).toBe(core.RESULT_DEADLINE_EXCEEDED); |
| 82 expect(wait.index).toBe(null); | 82 expect(wait.index).toBe(null); |
| 83 expect(wait.signalsState).toBe(null); | 83 expect(wait.signalsState.length).toBe(0); |
| 84 | 84 |
| 85 wait = core.wait(pipe.handle0, core.HANDLE_SIGNAL_READABLE, 0); | 85 wait = core.wait(pipe.handle0, core.HANDLE_SIGNAL_READABLE, 0); |
| 86 expect(wait.result).toBe(core.RESULT_DEADLINE_EXCEEDED); | 86 expect(wait.result).toBe(core.RESULT_DEADLINE_EXCEEDED); |
| 87 expect(wait.signalsState.satisfiedSignals).toBe( | 87 expect(wait.signalsState.satisfiedSignals).toBe( |
| 88 core.HANDLE_SIGNAL_WRITABLE); | 88 core.HANDLE_SIGNAL_WRITABLE); |
| 89 expect(wait.signalsState.satisfiableSignals).toBe(HANDLE_SIGNAL_ALL); | 89 expect(wait.signalsState.satisfiableSignals).toBe(HANDLE_SIGNAL_ALL); |
| 90 | 90 |
| 91 wait = core.waitMany( | 91 wait = core.waitMany( |
| 92 [pipe.handle0, pipe.handle1], | 92 [pipe.handle0, pipe.handle1], |
| 93 [core.HANDLE_SIGNAL_READABLE,core.HANDLE_SIGNAL_READABLE], | 93 [core.HANDLE_SIGNAL_READABLE,core.HANDLE_SIGNAL_READABLE], |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 expect(core.isHandle(pipe.handle1)).toBeTruthy(); | 188 expect(core.isHandle(pipe.handle1)).toBeTruthy(); |
| 189 expect(core.isHandle(null)).toBeTruthy(); | 189 expect(core.isHandle(null)).toBeTruthy(); |
| 190 } | 190 } |
| 191 | 191 |
| 192 function testIsHandleDataPipe(pipe) { | 192 function testIsHandleDataPipe(pipe) { |
| 193 expect(core.isHandle(pipe.consumerHandle)).toBeTruthy(); | 193 expect(core.isHandle(pipe.consumerHandle)).toBeTruthy(); |
| 194 expect(core.isHandle(pipe.producerHandle)).toBeTruthy(); | 194 expect(core.isHandle(pipe.producerHandle)).toBeTruthy(); |
| 195 } | 195 } |
| 196 | 196 |
| 197 }); | 197 }); |
| OLD | NEW |