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": "Logs a message during internal unit testing.",
102 {"type": "string", "name": "message"}
106 "name": "sendMessage",
108 "description": "Sends a string message to the browser process, generating a Notification that C++ test code can wait for.",
110 {"type": "string", "name": "message"},
116 {"type": "string", "name": "response"}
122 "name": "callbackAdded",
128 "name": "runNextTest",
138 {"type": "any", "name": "message", "optional": true}
146 {"type": "any", "name": "message", "optional": true}
150 "name": "runWithModuleSystem",
153 "description": "Gets a module system suitable for use in the context of a test.",
162 "name": "assertTrue",
173 {"type": "string", "name": "message", "optional": true}
177 "name": "assertFalse",
188 {"type": "string", "name": "message", "optional": true}
192 "name": "assertBool",
203 {"type": "boolean", "name": "expected"},
204 {"type": "string", "name": "message", "optional": true}
208 "name": "checkDeepEq",
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}
222 "allowAmbiguousOptionalArguments": true,
224 // These need to be optional because they can be null.
225 {"type": "any", "name": "expected", "optional": true},
226 {"type": "any", "name": "actual", "optional": true},
227 {"type": "string", "name": "message", "optional": true}
231 "name": "assertNoLastError",
237 "name": "assertLastError",
241 {"type": "string", "name": "expectedError"}
245 "name": "assertThrows",
249 {"type": "function", "name": "fn"},
253 "additionalProperties": {"type": "any"},
256 {"type": "array", "items": {"type": "any"}, "name": "args"},
257 {"choices": [ {"type": "string"}, {"type": "object", "isInstanceOf": "RegExp"} ], "name": "message", "optional": true}
265 {"type": "function", "name": "func", "optional": true},
266 {"type": "string", "name": "expectedError", "optional": true}
270 "name": "listenOnce",
274 // TODO(cduvall): Make this a $ref to events.Event.
275 {"type": "any", "name": "event"},
276 {"type": "function", "name": "func"}
280 "name": "listenForever",
284 // TODO(cduvall): Make this a $ref to events.Event.
285 {"type": "any", "name": "event"},
286 {"type": "function", "name": "func"}
290 "name": "callbackPass",
294 {"type": "function", "name": "func", "optional": true}
298 "name": "callbackFail",
302 {"type": "string", "name": "expectedError"},
303 {"type": "function", "name": "func", "optional": true}
314 "items": {"type": "function"}
319 "name": "getApiFeatures",
325 "name": "getApiDefinitions",
333 "items": {"type": "string"}
338 "name": "isProcessingUserGesture",
344 "name": "runWithUserGesture",
346 "description": "Runs the callback in the context of a user gesture.",
357 "name": "runWithoutUserGesture",
369 "name": "waitForRoundTrip",
371 "description": "Sends a string message one round trip from the renderer to the browser process and back.",
373 {"type": "string", "name": "message"},
378 {"type": "string", "name": "message"}
384 "name": "setExceptionHandler",
386 "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.",
393 {"type": "string", "name": "message"},
394 {"type": "any", "name": "exception"}
404 "description": "Used to test sending messages to extensions.",
410 "data": { "type": "string", "description": "Additional information." },
411 "lastMessage": { "type": "boolean", "description": "True if this was the last message for this test" }