| OLD | NEW |
| 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 // 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 = apiBridge || require('binding').Binding.create('test'); |
| 9 | 9 |
| 10 var environmentSpecificBindings = require('test_environment_specific_bindings'); | 10 var environmentSpecificBindings = require('test_environment_specific_bindings'); |
| 11 var GetExtensionAPIDefinitionsForTest = | 11 var GetExtensionAPIDefinitionsForTest = |
| 12 requireNative('apiDefinitions').GetExtensionAPIDefinitionsForTest; | 12 requireNative('apiDefinitions').GetExtensionAPIDefinitionsForTest; |
| 13 var GetAPIFeatures = requireNative('test_features').GetAPIFeatures; | 13 var GetAPIFeatures = requireNative('test_features').GetAPIFeatures; |
| 14 var natives = requireNative('test_native_handler'); | 14 var natives = requireNative('test_native_handler'); |
| 15 var uncaughtExceptionHandler = require('uncaught_exception_handler'); | 15 var uncaughtExceptionHandler = require('uncaught_exception_handler'); |
| 16 var userGestures = requireNative('user_gestures'); | 16 var userGestures = requireNative('user_gestures'); |
| 17 | 17 |
| 18 var GetModuleSystem = requireNative('v8_context').GetModuleSystem; | 18 var GetModuleSystem = requireNative('v8_context').GetModuleSystem; |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 uncaughtExceptionHandler.setHandler(callback); | 350 uncaughtExceptionHandler.setHandler(callback); |
| 351 }); | 351 }); |
| 352 | 352 |
| 353 apiFunctions.setHandleRequest('getWakeEventPage', function() { | 353 apiFunctions.setHandleRequest('getWakeEventPage', function() { |
| 354 return natives.GetWakeEventPage(); | 354 return natives.GetWakeEventPage(); |
| 355 }); | 355 }); |
| 356 | 356 |
| 357 environmentSpecificBindings.registerHooks(api); | 357 environmentSpecificBindings.registerHooks(api); |
| 358 }); | 358 }); |
| 359 | 359 |
| 360 exports.$set('binding', binding.generate()); | 360 if (!apiBridge) |
| 361 exports.$set('binding', binding.generate()); |
| OLD | NEW |