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

Side by Side Diff: chrome/test/webdriver/webdriver_error.cc

Issue 9288051: Implement the webdriver window sizing commands. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 8 years, 10 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/webdriver/webdriver_error.h" 5 #include "chrome/test/webdriver/webdriver_error.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "chrome/common/automation_constants.h" 9 #include "chrome/common/automation_constants.h"
10 10
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 // static 55 // static
56 Error* Error::FromAutomationError(const automation::Error& error) { 56 Error* Error::FromAutomationError(const automation::Error& error) {
57 ErrorCode code = kUnknownError; 57 ErrorCode code = kUnknownError;
58 switch (error.code()) { 58 switch (error.code()) {
59 case automation::kNoJavaScriptModalDialogOpen: 59 case automation::kNoJavaScriptModalDialogOpen:
60 code = kNoAlertOpenError; 60 code = kNoAlertOpenError;
61 break; 61 break;
62 case automation::kBlockedByModalDialog: 62 case automation::kBlockedByModalDialog:
63 code = kUnexpectedAlertOpen; 63 code = kUnexpectedAlertOpen;
64 break; 64 break;
65 case automation::kInvalidId:
66 code = kNoSuchWindow;
65 default: 67 default:
66 break; 68 break;
67 } 69 }
68 70
69 // In Chrome 17 and before, the automation error was just a string. 71 // In Chrome 17 and before, the automation error was just a string.
70 // Compare against some strings that correspond to webdriver errors. 72 // Compare against some strings that correspond to webdriver errors.
71 // TODO(kkania): Remove these comparisons when Chrome 17 is unsupported. 73 // TODO(kkania): Remove these comparisons when Chrome 17 is unsupported.
72 if (code == kUnknownError) { 74 if (code == kUnknownError) {
73 if (error.message() == 75 if (error.message() ==
74 "Command cannot be performed because a modal dialog is active" || 76 "Command cannot be performed because a modal dialog is active" ||
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 112
111 ErrorCode Error::code() const { 113 ErrorCode Error::code() const {
112 return code_; 114 return code_;
113 } 115 }
114 116
115 const std::string& Error::details() const { 117 const std::string& Error::details() const {
116 return details_; 118 return details_;
117 } 119 }
118 120
119 } // namespace webdriver 121 } // namespace webdriver
OLDNEW
« no previous file with comments | « chrome/test/webdriver/webdriver_automation.cc ('k') | chrome/test/webdriver/webdriver_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698