OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_TEST_WEBDRIVER_COMMANDS_SPEED_COMMAND_H_ | 5 #ifndef CHROME_TEST_WEBDRIVER_COMMANDS_SPEED_COMMAND_H_ |
6 #define CHROME_TEST_WEBDRIVER_COMMANDS_SPEED_COMMAND_H_ | 6 #define CHROME_TEST_WEBDRIVER_COMMANDS_SPEED_COMMAND_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "chrome/test/webdriver/session.h" | 11 #include "chrome/test/webdriver/session.h" |
12 #include "chrome/test/webdriver/commands/webdriver_command.h" | 12 #include "chrome/test/webdriver/commands/webdriver_command.h" |
13 | 13 |
14 namespace webdriver { | 14 namespace webdriver { |
15 | 15 |
16 // Controls how fast chrome should simulate user typing and mouse movements. | 16 // Controls how fast chrome should simulate user typing and mouse movements. |
17 // By default the speed is set to medium however webdriver has not defined | 17 // By default the speed is set to medium however webdriver has not defined |
18 // what this speed means accross browsers. Currently speed is ignored. | 18 // what this speed means accross browsers. Currently speed is ignored. |
19 // See: http://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessio
nId/speed | 19 // See: http://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessio
nId/speed |
20 class SpeedCommand : public WebDriverCommand { | 20 class SpeedCommand : public WebDriverCommand { |
21 public: | 21 public: |
22 SpeedCommand(const std::vector<std::string>& path_segments, | 22 SpeedCommand(const std::vector<std::string>& path_segments, |
23 const DictionaryValue* const parameters) | 23 const DictionaryValue* const parameters); |
24 : WebDriverCommand(path_segments, parameters), speed_(Session::kMedium) {} | 24 virtual ~SpeedCommand(); |
25 virtual ~SpeedCommand() {} | |
26 | 25 |
27 virtual bool Init(Response* const response); | 26 virtual bool Init(Response* const response); |
28 | 27 |
29 virtual bool DoesGet() { return true; } | 28 virtual bool DoesGet(); |
30 virtual bool DoesPost() { return true; } | 29 virtual bool DoesPost(); |
31 virtual void ExecuteGet(Response* const response); | 30 virtual void ExecuteGet(Response* const response); |
32 virtual void ExecutePost(Response* const response); | 31 virtual void ExecutePost(Response* const response); |
33 | 32 |
34 private: | 33 private: |
| 34 virtual bool RequiresValidTab(); |
| 35 |
35 Session::Speed speed_; | 36 Session::Speed speed_; |
36 virtual bool RequiresValidTab() { return true; } | |
37 | 37 |
38 DISALLOW_COPY_AND_ASSIGN(SpeedCommand); | 38 DISALLOW_COPY_AND_ASSIGN(SpeedCommand); |
39 }; | 39 }; |
40 | 40 |
41 } // namespace webdriver | 41 } // namespace webdriver |
42 | 42 |
43 #endif // CHROME_TEST_WEBDRIVER_COMMANDS_SPEED_COMMAND_H_ | 43 #endif // CHROME_TEST_WEBDRIVER_COMMANDS_SPEED_COMMAND_H_ |
44 | 44 |
OLD | NEW |