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

Side by Side Diff: chrome/renderer/resources/extensions/test_custom_bindings.js

Issue 15841013: Make miscellaneous_bindings and event_bindings Required as needed. Previously (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // test_custom_bindings.js 5 // test_custom_bindings.js
6 // mini-framework for ExtensionApiTest browser tests 6 // mini-framework for ExtensionApiTest browser tests
7 7
8 var binding = require('binding').Binding.create('test'); 8 var binding = require('binding').Binding.create('test');
9 9
10 var chrome = requireNative('chrome').GetChrome(); 10 var chrome = requireNative('chrome').GetChrome();
11 var GetExtensionAPIDefinitions = 11 var GetExtensionAPIDefinitions =
12 requireNative('apiDefinitions').GetExtensionAPIDefinitions; 12 requireNative('apiDefinitions').GetExtensionAPIDefinitions;
13 var GetAvailability = requireNative('v8_context').GetAvailability; 13 var GetAvailability = requireNative('v8_context').GetAvailability;
14 var GetAPIFeatures = requireNative('test_features').GetAPIFeatures; 14 var GetAPIFeatures = requireNative('test_features').GetAPIFeatures;
15 var Event = require('event_bindings').Event;
15 var json = require('json'); 16 var json = require('json');
16 17
17 binding.registerCustomHook(function(api) { 18 binding.registerCustomHook(function(api) {
18 var chromeTest = api.compiledApi; 19 var chromeTest = api.compiledApi;
19 var apiFunctions = api.apiFunctions; 20 var apiFunctions = api.apiFunctions;
20 21
21 chromeTest.tests = chromeTest.tests || []; 22 chromeTest.tests = chromeTest.tests || [];
22 23
23 var currentTest = null; 24 var currentTest = null;
24 var lastTest = null; 25 var lastTest = null;
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 289
289 apiFunctions.setHandleRequest('getApiDefinitions', function() { 290 apiFunctions.setHandleRequest('getApiDefinitions', function() {
290 return GetExtensionAPIDefinitions().filter(function(api) { 291 return GetExtensionAPIDefinitions().filter(function(api) {
291 return GetAvailability(api.namespace).is_available; 292 return GetAvailability(api.namespace).is_available;
292 }); 293 });
293 }); 294 });
294 295
295 apiFunctions.setHandleRequest('getApiFeatures', function() { 296 apiFunctions.setHandleRequest('getApiFeatures', function() {
296 return GetAPIFeatures(); 297 return GetAPIFeatures();
297 }); 298 });
299
300 apiFunctions.setHandleRequest('createEvent', function(name) {
301 return new Event(name);
302 });
298 }); 303 });
299 304
300 exports.binding = binding.generate(); 305 exports.binding = binding.generate();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698