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

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

Issue 2409723002: Remove chrome.test.runWithNativesEnabled (Closed)
Patch Set: Created 4 years, 2 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/common/api/test.json ('k') | extensions/renderer/v8_context_native_handler.h » ('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 // 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 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 RunWithNativesEnabled = requireNative('v8_context').RunWithNativesEnabled;
19 var GetModuleSystem = requireNative('v8_context').GetModuleSystem; 18 var GetModuleSystem = requireNative('v8_context').GetModuleSystem;
20 19
21 binding.registerCustomHook(function(api) { 20 binding.registerCustomHook(function(api) {
22 var chromeTest = api.compiledApi; 21 var chromeTest = api.compiledApi;
23 var apiFunctions = api.apiFunctions; 22 var apiFunctions = api.apiFunctions;
24 23
25 chromeTest.tests = chromeTest.tests || []; 24 chromeTest.tests = chromeTest.tests || [];
26 25
27 var currentTest = null; 26 var currentTest = null;
28 var lastTest = null; 27 var lastTest = null;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 // Interrupt the rest of the test. 115 // Interrupt the rest of the test.
117 throw failureException; 116 throw failureException;
118 }); 117 });
119 118
120 apiFunctions.setHandleRequest('succeed', function() { 119 apiFunctions.setHandleRequest('succeed', function() {
121 console.log("[SUCCESS] " + testName(currentTest)); 120 console.log("[SUCCESS] " + testName(currentTest));
122 chromeTest.log("( SUCCESS )"); 121 chromeTest.log("( SUCCESS )");
123 testDone(); 122 testDone();
124 }); 123 });
125 124
126 apiFunctions.setHandleRequest('runWithNativesEnabled', function(callback) {
127 RunWithNativesEnabled(callback);
128 });
129
130 apiFunctions.setHandleRequest('getModuleSystem', function(context) { 125 apiFunctions.setHandleRequest('getModuleSystem', function(context) {
131 return GetModuleSystem(context); 126 return GetModuleSystem(context);
132 }); 127 });
133 128
134 apiFunctions.setHandleRequest('assertTrue', function(test, message) { 129 apiFunctions.setHandleRequest('assertTrue', function(test, message) {
135 chromeTest.assertBool(test, true, message); 130 chromeTest.assertBool(test, true, message);
136 }); 131 });
137 132
138 apiFunctions.setHandleRequest('assertFalse', function(test, message) { 133 apiFunctions.setHandleRequest('assertFalse', function(test, message) {
139 chromeTest.assertBool(test, false, message); 134 chromeTest.assertBool(test, false, message);
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 }); 350 });
356 351
357 apiFunctions.setHandleRequest('getWakeEventPage', function() { 352 apiFunctions.setHandleRequest('getWakeEventPage', function() {
358 return natives.GetWakeEventPage(); 353 return natives.GetWakeEventPage();
359 }); 354 });
360 355
361 environmentSpecificBindings.registerHooks(api); 356 environmentSpecificBindings.registerHooks(api);
362 }); 357 });
363 358
364 exports.$set('binding', binding.generate()); 359 exports.$set('binding', binding.generate());
OLDNEW
« no previous file with comments | « extensions/common/api/test.json ('k') | extensions/renderer/v8_context_native_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698