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

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

Issue 683583002: Update mojo sdk to rev e083961bf11fd0c94d40be8853761da529b6d444 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: geolocation Created 6 years, 2 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
Index: mojo/public/js/bindings/core_unittests.js
diff --git a/mojo/public/js/bindings/core_unittests.js b/mojo/public/js/bindings/core_unittests.js
index b115cc06362c67d3d9534b9bb3fa936d96ee02e9..5fed10d04cbf0bfffd0eba80985cccbcbe44658b 100644
--- a/mojo/public/js/bindings/core_unittests.js
+++ b/mojo/public/js/bindings/core_unittests.js
@@ -15,6 +15,7 @@ define([
runWithDataPipe(testReadAndWriteDataPipe);
runWithDataPipeWithOptions(testNop);
runWithDataPipeWithOptions(testReadAndWriteDataPipe);
+ testHandleToString();
gc.collectGarbage(); // should not crash
this.result = "PASS";
@@ -115,4 +116,18 @@ define([
expect(memory[i]).toBe((i * i) & 0xFF);
}
+ function testHandleToString() {
+ var pipe = core.createDataPipe();
+ expect(pipe.consumerHandle.toString).toBeDefined();
+
+ var openHandleRE = /^\[mojo\:\:Handle \d+\]$/ // e.g. "[mojo::Handle 123]"
+ var openHandleString = pipe.consumerHandle.toString();
+ expect(openHandleString.match(openHandleRE)[0]).toEqual(openHandleString);
+
+ expect(core.close(pipe.producerHandle)).toBe(core.RESULT_OK);
+ expect(core.close(pipe.consumerHandle)).toBe(core.RESULT_OK);
+
+ expect(pipe.consumerHandle.toString()).toEqual("[mojo::Handle null]");
+ }
+
});

Powered by Google App Engine
This is Rietveld 408576698