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

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

Issue 100573003: [Mojo] Move JS bindings out of public (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix header guards Created 7 years 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/js/core.cc ('k') | mojo/public/bindings/js/handle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/bindings/js/core_unittests.js
diff --git a/mojo/public/bindings/js/core_unittests.js b/mojo/public/bindings/js/core_unittests.js
deleted file mode 100644
index bc3b55e64747ea25bb77670510185bda1f9bde89..0000000000000000000000000000000000000000
--- a/mojo/public/bindings/js/core_unittests.js
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-define([
- "gin/test/expect",
- "mojo/public/bindings/js/core",
- ], function(expect, core) {
- runWithPipe(testNop);
- runWithPipe(testReadAndWriteMessage);
- this.result = "PASS";
-
- function runWithPipe(test) {
- var pipe = core.createMessagePipe();
-
- test(pipe);
-
- expect(core.close(pipe.handle0)).toBe(core.RESULT_OK);
- expect(core.close(pipe.handle1)).toBe(core.RESULT_OK);
- }
-
- function testNop(pipe) {
- }
-
- function testReadAndWriteMessage(pipe) {
- var senderData = new Uint8Array(42);
- for (var i = 0; i < senderData.length; ++i) {
- senderData[i] = i * i;
- }
-
- var result = core.writeMessage(
- pipe.handle0, senderData, [],
- core.WRITE_MESSAGE_FLAG_NONE);
-
- expect(result).toBe(core.RESULT_OK);
-
- var receiverData = new Uint8Array(50);
-
- var read = core.readMessage(
- pipe.handle1, core.READ_MESSAGE_FLAG_NONE)
-
- expect(read.result).toBe(core.RESULT_OK);
- expect(read.buffer.byteLength).toBe(42);
- expect(read.handles.length).toBe(0);
-
- var memory = new Uint8Array(read.buffer);
- for (var i = 0; i < memory.length; ++i)
- expect(memory[i]).toBe((i * i) & 0xFF);
- }
-});
« no previous file with comments | « mojo/public/bindings/js/core.cc ('k') | mojo/public/bindings/js/handle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698