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.",
77 "description": "Whether or not the site-per-process flag is enabled."
88 "description": "Notifies the browser process that test code running in the extension failed. This is only used for internal unit testing.",
90 {"type": "string", "name": "message"}
96 "description": "Notifies the browser process that test code running in the extension passed. This is only used for internal unit testing.",
98 {"type": "string", "name": "message", "optional": true}
104 "description": "Logs a message during internal unit testing.",
106 {"type": "string", "name": "message"}
110 "name": "sendMessage",
112 "description": "Sends a string message to the browser process, generating a Notification that C++ test code can wait for.",
114 {"type": "string", "name": "message"},
120 {"type": "string", "name": "response"}
126 "name": "callbackAdded",
132 "name": "runNextTest",
142 {"type": "any", "name": "message", "optional": true}
150 {"type": "any", "name": "message", "optional": true}
154 "name": "runWithNativesEnabled",
157 "description": "Runs the given function with access to native methods enabled.",
166 "name": "getModuleSystem",
169 "description": "Returns an instance of the module system for the given context.",
178 "description": "The module system",
183 "name": "assertTrue",
194 {"type": "string", "name": "message", "optional": true}
198 "name": "assertFalse",
209 {"type": "string", "name": "message", "optional": true}
213 "name": "assertBool",
224 {"type": "boolean", "name": "expected"},
225 {"type": "string", "name": "message", "optional": true}
229 "name": "checkDeepEq",
232 "allowAmbiguousOptionalArguments": true,
234 // These need to be optional because they can be null.
235 {"type": "any", "name": "expected", "optional": true},
236 {"type": "any", "name": "actual", "optional": true}
243 "allowAmbiguousOptionalArguments": true,
245 // These need to be optional because they can be null.
246 {"type": "any", "name": "expected", "optional": true},
247 {"type": "any", "name": "actual", "optional": true},
248 {"type": "string", "name": "message", "optional": true}
252 "name": "assertNoLastError",
258 "name": "assertLastError",
262 {"type": "string", "name": "expectedError"}
266 "name": "assertThrows",
270 {"type": "function", "name": "fn"},
274 "additionalProperties": {"type": "any"},
277 {"type": "array", "items": {"type": "any"}, "name": "args"},
278 {"choices": [ {"type": "string"}, {"type": "object", "isInstanceOf": "RegExp"} ], "name": "message", "optional": true}
286 {"type": "function", "name": "func", "optional": true},
287 {"type": "string", "name": "expectedError", "optional": true}
291 "name": "listenOnce",
295 // TODO(cduvall): Make this a $ref to events.Event.
296 {"type": "any", "name": "event"},
297 {"type": "function", "name": "func"}
301 "name": "listenForever",
305 // TODO(cduvall): Make this a $ref to events.Event.
306 {"type": "any", "name": "event"},
307 {"type": "function", "name": "func"}
311 "name": "callbackPass",
315 {"type": "function", "name": "func", "optional": true}
319 "name": "callbackFail",
323 {"type": "string", "name": "expectedError"},
324 {"type": "function", "name": "func", "optional": true}
335 "items": {"type": "function"}
340 "name": "getApiFeatures",
346 "name": "getApiDefinitions",
354 "items": {"type": "string"}
359 "name": "isProcessingUserGesture",
365 "name": "runWithUserGesture",
367 "description": "Runs the callback in the context of a user gesture.",
378 "name": "runWithoutUserGesture",
390 "name": "waitForRoundTrip",
392 "description": "Sends a string message one round trip from the renderer to the browser process and back.",
394 {"type": "string", "name": "message"},
399 {"type": "string", "name": "message"}
405 "name": "setExceptionHandler",
407 "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.",
414 {"type": "string", "name": "message"},
415 {"type": "any", "name": "exception"}
421 "name": "getWakeEventPage",
423 "description": "Returns the wake-event-page API function, which can be called to wake up the extension's event page.",
428 "description": "The API function which wakes the extension's event page"
436 "description": "Used to test sending messages to extensions.",
442 "data": { "type": "string", "description": "Additional information." },
443 "lastMessage": { "type": "boolean", "description": "True if this was the last message for this test" }