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

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

Issue 2405093003: [WIP] Mojo native bindings interface.
Patch Set: fixes webui tests Created 3 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 unified diff | Download patch
« no previous file with comments | « extensions/renderer/resources/keep_alive.js ('k') | mojo/public/js/bindings.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var test = require('test').binding; 5 var test = require('test').binding;
6 var unittestBindings = require('test_environment_specific_bindings'); 6 var unittestBindings = require('test_environment_specific_bindings');
7 7
8 unittestBindings.exportTests([ 8 unittestBindings.exportTests([
9 function testEnvironment() { 9 function testEnvironment() {
10 test.assertTrue(!!$Array); 10 test.assertTrue(!!$Array);
(...skipping 19 matching lines...) Expand all
30 var sendRequest = require('sendRequest'); 30 var sendRequest = require('sendRequest');
31 var lastError = require('lastError'); 31 var lastError = require('lastError');
32 test.assertTrue(!!binding); 32 test.assertTrue(!!binding);
33 test.assertTrue(!!sendRequest); 33 test.assertTrue(!!sendRequest);
34 test.assertTrue(!!lastError); 34 test.assertTrue(!!lastError);
35 test.succeed(); 35 test.succeed();
36 }, 36 },
37 function testMojoModulesAreAvailable() { 37 function testMojoModulesAreAvailable() {
38 Promise.all([ 38 Promise.all([
39 requireAsync('mojo/public/js/bindings'), 39 requireAsync('mojo/public/js/bindings'),
40 requireAsync('mojo/public/js/core'),
41 requireAsync('content/public/renderer/frame_interfaces'), 40 requireAsync('content/public/renderer/frame_interfaces'),
42 ]).then(test.callback(function(modules) { 41 ]).then(test.callback(function(modules) {
43 var bindings = modules[0]; 42 var bindings = modules[0];
44 var core = modules[1]; 43 var frameInterfaces = modules[1];
45 var frameInterfaces = modules[2];
46 test.assertTrue(!!bindings.Binding); 44 test.assertTrue(!!bindings.Binding);
47 test.assertTrue(!!core.createMessagePipe);
48 test.assertTrue(!!frameInterfaces.getInterface); 45 test.assertTrue(!!frameInterfaces.getInterface);
49 })); 46 }));
50 }, 47 },
51 function testTestBindings() { 48 function testTestBindings() {
52 var counter = 0; 49 var counter = 0;
53 function increment() { 50 function increment() {
54 counter++; 51 counter++;
55 } 52 }
56 test.runWithUserGesture(increment); 53 test.runWithUserGesture(increment);
57 test.runWithoutUserGesture(increment); 54 test.runWithoutUserGesture(increment);
58 test.assertEq(2, counter); 55 test.assertEq(2, counter);
59 test.assertFalse(test.isProcessingUserGesture()); 56 test.assertFalse(test.isProcessingUserGesture());
60 test.assertTrue(!!test.getApiFeatures()); 57 test.assertTrue(!!test.getApiFeatures());
61 test.assertEq(0, test.getApiDefinitions().length); 58 test.assertEq(0, test.getApiDefinitions().length);
62 test.succeed(); 59 test.succeed();
63 } 60 }
64 ], test.runTests, exports); 61 ], test.runTests, exports);
OLDNEW
« no previous file with comments | « extensions/renderer/resources/keep_alive.js ('k') | mojo/public/js/bindings.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698