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
3 // found in the LICENSE file.
5 /** @fileoverview Externs generated from namespace: test */
13 * Gives configuration options set by the test.
14 * @param {Function} callback
16 chrome.test.getConfig = function(callback) {};
19 * Notifies the browser process that test code running in the extension failed.
20 * This is only used for internal unit testing.
21 * @param {string} message
23 chrome.test.notifyFail = function(message) {};
26 * Notifies the browser process that test code running in the extension passed.
27 * This is only used for internal unit testing.
28 * @param {string=} message
30 chrome.test.notifyPass = function(message) {};
33 * Logs a message during internal unit testing.
34 * @param {string} message
36 chrome.test.log = function(message) {};
39 * Sends a string message to the browser process, generating a Notification
40 * that C++ test code can wait for.
41 * @param {string} message
42 * @param {Function=} callback
44 chrome.test.sendMessage = function(message, callback) {};
48 chrome.test.callbackAdded = function() {};
52 chrome.test.runNextTest = function() {};
57 chrome.test.fail = function(message) {};
62 chrome.test.succeed = function(message) {};
65 * Runs the given function with access to native methods enabled.
66 * @param {Function} callback
68 chrome.test.runWithNativesEnabled = function(callback) {};
71 * Returns an instance of the ModuleSystem for the given context.
72 * @param {Object} context
74 chrome.test.getModuleSystem = function(context) {};
78 * @param {string=} message
80 chrome.test.assertTrue = function(test, message) {};
84 * @param {string=} message
86 chrome.test.assertFalse = function(test, message) {};
90 * @param {boolean} expected
91 * @param {string=} message
93 chrome.test.assertBool = function(test, expected, message) {};
96 * @param {?=} expected
99 chrome.test.checkDeepEq = function(expected, actual) {};
102 * @param {?=} expected
104 * @param {string=} message
106 chrome.test.assertEq = function(expected, actual, message) {};
110 chrome.test.assertNoLastError = function() {};
113 * @param {string} expectedError
115 chrome.test.assertLastError = function(expectedError) {};
118 * @param {Object} self
119 * @param {Array} args
121 * @param {Function} fn
123 chrome.test.assertThrows = function(self, args, message, fn) {};
126 * @param {string=} expectedError
127 * @param {Function=} func
129 chrome.test.callback = function(expectedError, func) {};
133 * @param {Function} func
135 chrome.test.listenOnce = function(event, func) {};
139 * @param {Function} func
141 chrome.test.listenForever = function(event, func) {};
144 * @param {Function=} func
146 chrome.test.callbackPass = function(func) {};
149 * @param {string} expectedError
150 * @param {Function=} func
152 chrome.test.callbackFail = function(expectedError, func) {};
155 * @param {Array} tests
157 chrome.test.runTests = function(tests) {};
161 chrome.test.getApiFeatures = function() {};
164 * @param {Array=} apiNames
166 chrome.test.getApiDefinitions = function(apiNames) {};
170 chrome.test.isProcessingUserGesture = function() {};
173 * Runs the callback in the context of a user gesture.
174 * @param {Function} callback
176 chrome.test.runWithUserGesture = function(callback) {};
179 * @param {Function} callback
181 chrome.test.runWithoutUserGesture = function(callback) {};
184 * Sends a string message one round trip from the renderer to the browser
186 * @param {string} message
187 * @param {Function} callback
189 chrome.test.waitForRoundTrip = function(message, callback) {};
192 * Sets the function to be called when an exception occurs. By default this is
193 * a function which fails the test. This is reset for every test run through
194 * $ref:test.runTests.
195 * @param {Function} callback
197 chrome.test.setExceptionHandler = function(callback) {};
199 /** @type {!ChromeEvent} */
200 chrome.test.onMessage;