| Index: chrome/test/webdriver/commands/response.h
|
| diff --git a/chrome/test/webdriver/commands/response.h b/chrome/test/webdriver/commands/response.h
|
| index b77404d2260d67f3cec7f43550806640770b6e7e..678851fe889d8d915a6abc3fbfd48179bafff964 100644
|
| --- a/chrome/test/webdriver/commands/response.h
|
| +++ b/chrome/test/webdriver/commands/response.h
|
| @@ -1,4 +1,4 @@
|
| -// Copyright (c) 2010 The Chromium Authors. All rights reserved.
|
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| @@ -14,11 +14,18 @@
|
| namespace webdriver {
|
|
|
| // All errors in webdriver must use this macro in order to send back
|
| -// a proper stack trace to the client
|
| +// a proper stack trace to the client.
|
| #define SET_WEBDRIVER_ERROR(response, msg, err) \
|
| response->SetError(err, msg, __FILE__, __LINE__); \
|
| LOG(ERROR) << msg
|
|
|
| +// Error which need to send back a screenshot should use this macro.
|
| +// |png| needs to be a string which contains the raw binary data of
|
| +// the PNG file.
|
| +#define SET_WEBDRIVER_ERROR_WITH_SCREENSHOT(response, msg, err , png) \
|
| + response->SetError(err, msg, __FILE__, __LINE__, png); \
|
| + LOG(ERROR) << msg
|
| +
|
| // A simple class that encapsulates the information describing the response to
|
| // a |Command|. In Webdriver all responses must be sent back as a JSON value,
|
| // conforming to the spec found at:
|
| @@ -46,6 +53,16 @@ class Response {
|
| void SetError(ErrorCode error, const std::string& message,
|
| const std::string& file, int line);
|
|
|
| + // Configures this response to report an error. The |file| and |line|
|
| + // parameters, which identify where in the source the error occurred, can be
|
| + // set using the |SET_WEBDRIVER_ERROR_WITH_SCREENSHOT| macro above. Includes
|
| + // a screen shot of the tab which caused the error.
|
| + void SetError(ErrorCode error,
|
| + const std::string& message,
|
| + const std::string& file,
|
| + int line,
|
| + const std::string& png);
|
| +
|
| // Sets a JSON field in this response. The |key| may be a "." delimitted
|
| // string to indicate the value should be set in a nested object. Any
|
| // previously set value for the |key| will be deleted.
|
|
|