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

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

Issue 193403003: Move relevent JS tests to mojo_js_unittests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add back deps Created 6 years, 9 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/apps/js/bindings/codec_unittests.js ('k') | mojo/apps/js/test/run_apps_js_tests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/apps/js/bindings/core_unittests.js
diff --git a/mojo/apps/js/bindings/core_unittests.js b/mojo/apps/js/bindings/core_unittests.js
deleted file mode 100644
index b085cd02659c9c4d869c1e06732a8bd74658f27a..0000000000000000000000000000000000000000
--- a/mojo/apps/js/bindings/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/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/apps/js/bindings/codec_unittests.js ('k') | mojo/apps/js/test/run_apps_js_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698