OLD | NEW |
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/commands/navigate_commands.h" | 5 #include "chrome/test/webdriver/commands/navigate_commands.h" |
6 | 6 |
7 #include "chrome/test/webdriver/commands/response.h" | 7 #include "chrome/test/webdriver/commands/response.h" |
8 #include "chrome/test/webdriver/webdriver_error.h" | 8 #include "chrome/test/webdriver/webdriver_error.h" |
9 #include "chrome/test/webdriver/webdriver_session.h" | 9 #include "chrome/test/webdriver/webdriver_session.h" |
10 | 10 |
11 namespace webdriver { | 11 namespace webdriver { |
12 | 12 |
13 ForwardCommand::ForwardCommand(const std::vector<std::string>& path_segments, | 13 ForwardCommand::ForwardCommand(const std::vector<std::string>& path_segments, |
14 const DictionaryValue* const parameters) | 14 DictionaryValue* const parameters) |
15 : WebDriverCommand(path_segments, parameters) {} | 15 : WebDriverCommand(path_segments, parameters) {} |
16 | 16 |
17 ForwardCommand::~ForwardCommand() {} | 17 ForwardCommand::~ForwardCommand() {} |
18 | 18 |
19 bool ForwardCommand::DoesPost() { | 19 bool ForwardCommand::DoesPost() { |
20 return true; | 20 return true; |
21 } | 21 } |
22 | 22 |
23 void ForwardCommand::ExecutePost(Response* const response) { | 23 void ForwardCommand::ExecutePost(Response* const response) { |
24 Error* error = session_->GoForward(); | 24 Error* error = session_->GoForward(); |
25 if (error) | 25 if (error) |
26 response->SetError(error); | 26 response->SetError(error); |
27 } | 27 } |
28 | 28 |
29 BackCommand::BackCommand(const std::vector<std::string>& path_segments, | 29 BackCommand::BackCommand(const std::vector<std::string>& path_segments, |
30 const DictionaryValue* const parameters) | 30 DictionaryValue* const parameters) |
31 : WebDriverCommand(path_segments, parameters) {} | 31 : WebDriverCommand(path_segments, parameters) {} |
32 | 32 |
33 BackCommand::~BackCommand() {} | 33 BackCommand::~BackCommand() {} |
34 | 34 |
35 bool BackCommand::DoesPost() { | 35 bool BackCommand::DoesPost() { |
36 return true; | 36 return true; |
37 } | 37 } |
38 | 38 |
39 void BackCommand::ExecutePost(Response* const response) { | 39 void BackCommand::ExecutePost(Response* const response) { |
40 Error* error = session_->GoBack(); | 40 Error* error = session_->GoBack(); |
41 if (error) | 41 if (error) |
42 response->SetError(error); | 42 response->SetError(error); |
43 } | 43 } |
44 | 44 |
45 RefreshCommand::RefreshCommand(const std::vector<std::string>& path_segments, | 45 RefreshCommand::RefreshCommand(const std::vector<std::string>& path_segments, |
46 const DictionaryValue* const parameters) | 46 DictionaryValue* const parameters) |
47 : WebDriverCommand(path_segments, parameters) {} | 47 : WebDriverCommand(path_segments, parameters) {} |
48 | 48 |
49 RefreshCommand::~RefreshCommand() {} | 49 RefreshCommand::~RefreshCommand() {} |
50 | 50 |
51 bool RefreshCommand::DoesPost() { | 51 bool RefreshCommand::DoesPost() { |
52 return true; | 52 return true; |
53 } | 53 } |
54 | 54 |
55 void RefreshCommand::ExecutePost(Response* const response) { | 55 void RefreshCommand::ExecutePost(Response* const response) { |
56 Error* error = session_->Reload(); | 56 Error* error = session_->Reload(); |
57 if (error) | 57 if (error) |
58 response->SetError(error); | 58 response->SetError(error); |
59 } | 59 } |
60 | 60 |
61 } // namespace webdriver | 61 } // namespace webdriver |
OLD | NEW |