Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(717)

Side by Side Diff: chrome/test/chromedriver/status.cc

Issue 12675002: [chromedriver] Implement command: executeAsyncScript and setScriptTimeout (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments. Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/test/chromedriver/status.h" 5 #include "chrome/test/chromedriver/status.h"
6 6
7 #include "base/stringprintf.h" 7 #include "base/stringprintf.h"
8 8
9 namespace { 9 namespace {
10 10
11 // Returns the string equivalent of the given |ErrorCode|. 11 // Returns the string equivalent of the given |ErrorCode|.
12 const char* DefaultMessageForStatusCode(StatusCode code) { 12 const char* DefaultMessageForStatusCode(StatusCode code) {
13 switch (code) { 13 switch (code) {
14 case kOk: 14 case kOk:
15 return "ok"; 15 return "ok";
16 case kNoSuchElement: 16 case kNoSuchElement:
17 return "no such element"; 17 return "no such element";
18 case kUnknownCommand: 18 case kUnknownCommand:
19 return "unknown command"; 19 return "unknown command";
20 case kStaleElementReference: 20 case kStaleElementReference:
21 return "stale element reference"; 21 return "stale element reference";
22 case kElementNotVisible: 22 case kElementNotVisible:
23 return "element not visible"; 23 return "element not visible";
24 case kInvalidElementState: 24 case kInvalidElementState:
25 return "invalid element state"; 25 return "invalid element state";
26 case kUnknownError: 26 case kUnknownError:
27 return "unknown error"; 27 return "unknown error";
28 case kJavaScriptError:
29 return "javascript error";
28 case kXPathLookupError: 30 case kXPathLookupError:
29 return "xpath lookup error"; 31 return "xpath lookup error";
30 case kNoSuchWindow: 32 case kNoSuchWindow:
31 return "no such window"; 33 return "no such window";
32 case kInvalidCookieDomain: 34 case kInvalidCookieDomain:
33 return "invalid cookie domain"; 35 return "invalid cookie domain";
34 case kUnexpectedAlertOpen: 36 case kUnexpectedAlertOpen:
35 return "unexpected alert open"; 37 return "unexpected alert open";
36 case kNoAlertOpen: 38 case kNoAlertOpen:
37 return "no alert open"; 39 return "no alert open";
40 case kScriptTimeout:
41 return "asynchronous script timeout";
38 case kInvalidSelector: 42 case kInvalidSelector:
39 return "invalid selector"; 43 return "invalid selector";
40 case kSessionNotCreatedException: 44 case kSessionNotCreatedException:
41 return "session not created exception"; 45 return "session not created exception";
42 case kNoSuchSession: 46 case kNoSuchSession:
43 return "no such session"; 47 return "no such session";
44 case kNoSuchFrame: 48 case kNoSuchFrame:
45 return "no such frame"; 49 return "no such frame";
46 case kChromeNotReachable: 50 case kChromeNotReachable:
47 return "chrome not reachable"; 51 return "chrome not reachable";
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 return code_ != kOk; 93 return code_ != kOk;
90 } 94 }
91 95
92 StatusCode Status::code() const { 96 StatusCode Status::code() const {
93 return code_; 97 return code_;
94 } 98 }
95 99
96 const std::string& Status::message() const { 100 const std::string& Status::message() const {
97 return msg_; 101 return msg_;
98 } 102 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698