2 * Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
7 // Helper / error handling functions.
10 * Prints a debug message.
17 * Sends a value back to the test.
19 * @param {string} message The message to return.
21 function returnToTest(message) {
22 debug('Returning ' + message + ' to test.');
23 window.domAutomationController.send(message);
27 * Fails the test by generating an exception. If the test automation is calling
28 * into us, make sure to fail the test as fast as possible. You must use this
31 * throw failTest('my reason');
35 function failTest(reason) {
36 returnToTest('Test failed: ' + reason);
37 return new Error(reason);