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
3 // found in the LICENSE file.
13 "description": "Gives configuration options set by the test.",
16 "type": "function", "name": "callback", "parameters": [
24 "description": "Additional string argument to pass to test."
29 "description": "Details on the test server used to mock network responses. Will be set only if test calls ExtensionApiTest::StartTestServer().",
33 "description": "The port on which the test server is listening.",
39 "spawnedTestServer": {
42 "description": "Details on the spawned test server used to mock network responses. Will be set only if test calls ExtensionApiTest::StartSpawnedTestServer().",
46 "description": "The port on which the test server is listening.",
52 "testDataDirectory": {
54 "description": "file:/// URL for the API test data directory."
56 "testWebSocketPort": {
58 "description": "The port on which the test WebSocket server is listening.",
71 "description": "Notifies the browser process that test code running in the extension failed. This is only used for internal unit testing.",
73 {"type": "string", "name": "message"}
79 "description": "Notifies the browser process that test code running in the extension passed. This is only used for internal unit testing.",
81 {"type": "string", "name": "message", "optional": true}
87 "description": "Resets all accumulated quota state for all extensions. This is only used for internal unit testing.",
93 "description": "Logs a message during internal unit testing.",
95 {"type": "string", "name": "message"}
99 "name": "createIncognitoTab",
101 "description": "Creates an incognito tab during internal testing. Succeeds even if the extension is not enabled in incognito mode.",
103 {"type": "string", "name": "url"}
107 "name": "sendMessage",
109 "description": "Sends a string message to the browser process, generating a Notification that C++ test code can wait for.",
111 {"type": "string", "name": "message"},
117 {"type": "string", "name": "response"}
123 "name": "callbackAdded",
129 "name": "runNextTest",
139 {"type": "any", "name": "message", "optional": true}
147 {"type": "any", "name": "message", "optional": true}
151 "name": "assertTrue",
162 {"type": "string", "name": "message", "optional": true}
166 "name": "assertFalse",
177 {"type": "string", "name": "message", "optional": true}
181 "name": "assertBool",
192 {"type": "boolean", "name": "expected"},
193 {"type": "string", "name": "message", "optional": true}
197 "name": "checkDeepEq",
200 "allowAmbiguousOptionalArguments": true,
202 // These need to be optional because they can be null.
203 {"type": "any", "name": "expected", "optional": true},
204 {"type": "any", "name": "actual", "optional": true}
211 "allowAmbiguousOptionalArguments": true,
213 // These need to be optional because they can be null.
214 {"type": "any", "name": "expected", "optional": true},
215 {"type": "any", "name": "actual", "optional": true},
216 {"type": "string", "name": "message", "optional": true}
220 "name": "assertNoLastError",
226 "name": "assertLastError",
230 {"type": "string", "name": "expectedError"}
234 "name": "assertThrows",
238 {"type": "function", "name": "fn"},
242 "additionalProperties": {"type": "any"},
245 {"type": "array", "items": {"type": "any"}, "name": "args"},
246 {"choices": [ {"type": "string"}, {"type": "object", "isInstanceOf": "RegExp"} ], "name": "message", "optional": true}
254 {"type": "function", "name": "func", "optional": true},
255 {"type": "string", "name": "expectedError", "optional": true}
259 "name": "listenOnce",
263 // TODO(cduvall): Make this a $ref to events.Event.
264 {"type": "any", "name": "event"},
265 {"type": "function", "name": "func"}
269 "name": "listenForever",
273 // TODO(cduvall): Make this a $ref to events.Event.
274 {"type": "any", "name": "event"},
275 {"type": "function", "name": "func"}
279 "name": "callbackPass",
283 {"type": "function", "name": "func", "optional": true}
287 "name": "callbackFail",
291 {"type": "string", "name": "expectedError"},
292 {"type": "function", "name": "func", "optional": true}
303 "items": {"type": "function"}
308 "name": "getApiFeatures",
314 "name": "getApiDefinitions",
322 "items": {"type": "string"}
327 "name": "isProcessingUserGesture",
333 "name": "runWithUserGesture",
335 "description": "Runs the callback in the context of a user gesture.",
346 "name": "runWithoutUserGesture",
362 "description": "Used to test sending messages to extensions.",
368 "data": { "type": "string", "description": "Additional information." },
369 "lastMessage": { "type": "boolean", "description": "True if this was the last message for this test" }