OLD | NEW |
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/webdriver/commands/html5_location_commands.h" | 5 #include "chrome/test/webdriver/commands/html5_location_commands.h" |
6 | 6 |
7 #include "base/values.h" | 7 #include "base/values.h" |
8 #include "chrome/test/webdriver/commands/response.h" | 8 #include "chrome/test/webdriver/commands/response.h" |
9 #include "chrome/test/webdriver/webdriver_error.h" | 9 #include "chrome/test/webdriver/webdriver_error.h" |
10 #include "chrome/test/webdriver/webdriver_session.h" | 10 #include "chrome/test/webdriver/webdriver_session.h" |
11 | 11 |
12 namespace webdriver { | 12 namespace webdriver { |
13 | 13 |
14 HTML5LocationCommand::HTML5LocationCommand( | 14 HTML5LocationCommand::HTML5LocationCommand( |
15 const std::vector<std::string>& path_segments, | 15 const std::vector<std::string>& path_segments, |
16 const base::DictionaryValue* const parameters) | 16 base::DictionaryValue* const parameters) |
17 : WebDriverCommand(path_segments, parameters) {} | 17 : WebDriverCommand(path_segments, parameters) {} |
18 | 18 |
19 HTML5LocationCommand::~HTML5LocationCommand() {} | 19 HTML5LocationCommand::~HTML5LocationCommand() {} |
20 | 20 |
21 bool HTML5LocationCommand::DoesGet() { | 21 bool HTML5LocationCommand::DoesGet() { |
22 return true; | 22 return true; |
23 } | 23 } |
24 | 24 |
25 bool HTML5LocationCommand::DoesPost() { | 25 bool HTML5LocationCommand::DoesPost() { |
26 return true; | 26 return true; |
(...skipping 15 matching lines...) Expand all Loading... |
42 response->SetError(new Error( | 42 response->SetError(new Error( |
43 kBadRequest, "Missing or invalid 'location'")); | 43 kBadRequest, "Missing or invalid 'location'")); |
44 return; | 44 return; |
45 } | 45 } |
46 Error* error = session_->OverrideGeolocation(geolocation); | 46 Error* error = session_->OverrideGeolocation(geolocation); |
47 if (error) | 47 if (error) |
48 response->SetError(error); | 48 response->SetError(error); |
49 } | 49 } |
50 | 50 |
51 } // namespace webdriver | 51 } // namespace webdriver |
OLD | NEW |