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

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

Issue 15091002: Lazily load API schemas from resource files and convert all APIs to features (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix chromeos tests 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 GetExtensionAPIDefinitionsForTest =
12 requireNative('apiDefinitions').GetExtensionAPIDefinitions; 12 requireNative('apiDefinitions').GetExtensionAPIDefinitionsForTest;
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 15
16 binding.registerCustomHook(function(api) { 16 binding.registerCustomHook(function(api) {
17 var chromeTest = api.compiledApi; 17 var chromeTest = api.compiledApi;
18 var apiFunctions = api.apiFunctions; 18 var apiFunctions = api.apiFunctions;
19 19
20 chromeTest.tests = chromeTest.tests || []; 20 chromeTest.tests = chromeTest.tests || [];
21 21
22 var currentTest = null; 22 var currentTest = null;
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 return chromeTest.callback(func, expectedError); 283 return chromeTest.callback(func, expectedError);
284 }); 284 });
285 285
286 apiFunctions.setHandleRequest('runTests', function(tests) { 286 apiFunctions.setHandleRequest('runTests', function(tests) {
287 chromeTest.tests = tests; 287 chromeTest.tests = tests;
288 testCount = chromeTest.tests.length; 288 testCount = chromeTest.tests.length;
289 chromeTest.runNextTest(); 289 chromeTest.runNextTest();
290 }); 290 });
291 291
292 apiFunctions.setHandleRequest('getApiDefinitions', function() { 292 apiFunctions.setHandleRequest('getApiDefinitions', function() {
293 return GetExtensionAPIDefinitions().filter(function(api) { 293 return GetExtensionAPIDefinitionsForTest();
294 return GetAvailability(api.namespace).is_available;
295 });
296 }); 294 });
297 295
298 apiFunctions.setHandleRequest('getApiFeatures', function() { 296 apiFunctions.setHandleRequest('getApiFeatures', function() {
299 return GetAPIFeatures(); 297 return GetAPIFeatures();
300 }); 298 });
301 }); 299 });
302 300
303 exports.binding = binding.generate(); 301 exports.binding = binding.generate();
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/v8_schema_registry.cc ('k') | chrome/test/data/extensions/api_test/events/background.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698