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

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

Issue 14494013: Allow API functions and events to have entries in _api_features.json (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix bug in searching for unprivileged Created 7 years, 7 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 json = require('json'); 15 var json = require('json');
15 16
16 binding.registerCustomHook(function(api) { 17 binding.registerCustomHook(function(api) {
17 var chromeTest = api.compiledApi; 18 var chromeTest = api.compiledApi;
18 var apiFunctions = api.apiFunctions; 19 var apiFunctions = api.apiFunctions;
19 20
20 chromeTest.tests = chromeTest.tests || []; 21 chromeTest.tests = chromeTest.tests || [];
21 22
22 var currentTest = null; 23 var currentTest = null;
23 var lastTest = null; 24 var lastTest = null;
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 chromeTest.tests = tests; 284 chromeTest.tests = tests;
284 testCount = chromeTest.tests.length; 285 testCount = chromeTest.tests.length;
285 chromeTest.runNextTest(); 286 chromeTest.runNextTest();
286 }); 287 });
287 288
288 apiFunctions.setHandleRequest('getApiDefinitions', function() { 289 apiFunctions.setHandleRequest('getApiDefinitions', function() {
289 return GetExtensionAPIDefinitions().filter(function(api) { 290 return GetExtensionAPIDefinitions().filter(function(api) {
290 return GetAvailability(api.namespace).is_available; 291 return GetAvailability(api.namespace).is_available;
291 }); 292 });
292 }); 293 });
294
295 apiFunctions.setHandleRequest('getApiFeatures', function() {
296 return GetAPIFeatures();
297 });
293 }); 298 });
294 299
295 exports.binding = binding.generate(); 300 exports.binding = binding.generate();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698