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.
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 FTP server used to mock network responses. Will be set only if test calls ExtensionApiTest::StartFTPServer().",
33 "description": "The port on which the FTP server is listening.",
42 "description": "Details on the test server used to mock network responses. Will be set only if test calls ExtensionApiTest::StartTestServer().",
46 "description": "The port on which the test server is listening.",
52 "spawnedTestServer": {
55 "description": "Details on the spawned test server used to mock network responses. Will be set only if test calls ExtensionApiTest::StartSpawnedTestServer().",
59 "description": "The port on which the test server is listening.",
65 "testDataDirectory": {
67 "description": "file:/// URL for the API test data directory."
69 "testWebSocketPort": {
71 "description": "The port on which the test WebSocket server is listening.",
84 "description": "Notifies the browser process that test code running in the extension failed. This is only used for internal unit testing.",
86 {"type": "string", "name": "message"}
92 "description": "Notifies the browser process that test code running in the extension passed. This is only used for internal unit testing.",
94 {"type": "string", "name": "message", "optional": true}
100 "description": "Resets all accumulated quota state for all extensions. This is only used for internal unit testing.",
106 "description": "Logs a message during internal unit testing.",
108 {"type": "string", "name": "message"}
112 "name": "sendMessage",
114 "description": "Sends a string message to the browser process, generating a Notification that C++ test code can wait for.",
116 {"type": "string", "name": "message"},
122 {"type": "string", "name": "response"}
128 "name": "callbackAdded",
134 "name": "runNextTest",
144 {"type": "any", "name": "message", "optional": true}
152 {"type": "any", "name": "message", "optional": true}
156 "name": "assertTrue",
167 {"type": "string", "name": "message", "optional": true}
171 "name": "assertFalse",
182 {"type": "string", "name": "message", "optional": true}
186 "name": "assertBool",
197 {"type": "boolean", "name": "expected"},
198 {"type": "string", "name": "message", "optional": true}
202 "name": "checkDeepEq",
205 "allowAmbiguousOptionalArguments": true,
207 // These need to be optional because they can be null.
208 {"type": "any", "name": "expected", "optional": true},
209 {"type": "any", "name": "actual", "optional": true}
216 "allowAmbiguousOptionalArguments": true,
218 // These need to be optional because they can be null.
219 {"type": "any", "name": "expected", "optional": true},
220 {"type": "any", "name": "actual", "optional": true},
221 {"type": "string", "name": "message", "optional": true}
225 "name": "assertNoLastError",
231 "name": "assertLastError",
235 {"type": "string", "name": "expectedError"}
239 "name": "assertThrows",
243 {"type": "function", "name": "fn"},
247 "additionalProperties": {"type": "any"},
250 {"type": "array", "items": {"type": "any"}, "name": "args"},
251 {"choices": [ {"type": "string"}, {"type": "object", "isInstanceOf": "RegExp"} ], "name": "message", "optional": true}
259 {"type": "function", "name": "func", "optional": true},
260 {"type": "string", "name": "expectedError", "optional": true}
264 "name": "listenOnce",
268 // TODO(cduvall): Make this a $ref to events.Event.
269 {"type": "any", "name": "event"},
270 {"type": "function", "name": "func"}
274 "name": "listenForever",
278 // TODO(cduvall): Make this a $ref to events.Event.
279 {"type": "any", "name": "event"},
280 {"type": "function", "name": "func"}
284 "name": "callbackPass",
288 {"type": "function", "name": "func", "optional": true}
292 "name": "callbackFail",
296 {"type": "string", "name": "expectedError"},
297 {"type": "function", "name": "func", "optional": true}
308 "items": {"type": "function"}
313 "name": "getApiFeatures",
319 "name": "getApiDefinitions",
327 "items": {"type": "string"}
332 "name": "isProcessingUserGesture",
338 "name": "runWithUserGesture",
340 "description": "Runs the callback in the context of a user gesture.",
351 "name": "runWithoutUserGesture",
363 "name": "waitForRoundTrip",
365 "description": "Sends a string message one round trip from the renderer to the browser process and back.",
367 {"type": "string", "name": "message"},
372 {"type": "string", "name": "message"}
378 "name": "setExceptionHandler",
380 "description": "Sets the function to be called when an exception occurs. By default this is a function which fails the test. This is reset for every test run through $ref:test.runTests.",
387 {"type": "string", "name": "message"},
388 {"type": "any", "name": "exception"}
398 "description": "Used to test sending messages to extensions.",
404 "data": { "type": "string", "description": "Additional information." },
405 "lastMessage": { "type": "boolean", "description": "True if this was the last message for this test" }