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

Side by Side Diff: extensions/test/data/mojo_private_unittest.js

Issue 2409073002: Use mojo from the PDF extension instead of using an extension API.
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « extensions/test/data/keep_alive_client_unittest.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 'use strict';
6
7 let mojoPrivate = require('mojoPrivate').binding;
8 let test = require('test').binding;
9 let unittestBindings = require('test_environment_specific_bindings');
10
11 unittestBindings.exportTests([
12 function testDefine() {
13 mojoPrivate.define('testModule', [
14 'mojo/public/js/codec',
15 ], test.callbackPass(function(codec) {
16 test.assertEq('function', typeof codec.Message);
17 }));
18 },
19
20 function testDefineRegistersModule() {
21 mojoPrivate.define('testModule', ['dependency'],
22 test.callbackPass(function(module) {
23 test.assertEq(12345, module.result);
24 }));
25 mojoPrivate.define('dependency', test.callbackPass(function() {
26 return {result: 12345};
27 }));
28 },
29
30 function testDefineModuleDoesNotExist() {
31 mojoPrivate.define('testModule', ['does not exist!'], test.fail);
32 test.succeed();
33 },
34
35 function testRequireAsync() {
36 mojoPrivate.requireAsync('mojo/public/js/codec').then(
37 test.callbackPass(function(codec) {
38 test.assertEq('function', typeof codec.Message);
39 }));
40 },
41
42 function testDefineAndRequire() {
43 mojoPrivate.define('testModule', ['dependency'],
44 test.callbackPass(function(module) {
45 test.assertEq(12345, module.result);
46 }));
47 mojoPrivate.define('dependency', test.callbackPass(function() {
48 return {result: 12345};
49 }));
50 mojoPrivate.requireAsync('dependency').then(
51 test.callbackPass(),
52 test.fail);
53 }
54 ], test.runTests, exports);
OLDNEW
« no previous file with comments | « extensions/test/data/keep_alive_client_unittest.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698