Delete chrome.mediaGalleriesPrivate because the functionality unique to it has since...
[chromium-blink-merge.git] / extensions / test / data / mojo_private_unittest.js
blob2a90d6509240d2cda449aa21a6633784efe43a0b
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.
5 'use strict';
7 let mojoPrivate = require('mojoPrivate').binding;
8 let test = require('test').binding;
9 let unittestBindings = require('test_environment_specific_bindings');
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 }));
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 }));
30 function testDefineModuleDoesNotExist() {
31 mojoPrivate.define('testModule', ['does not exist!'], test.fail);
32 test.succeed();
34 ], test.runTests, exports);