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 3 // found in the LICENSE file. 4 5 #ifndef CHROME_TEST_WEBDRIVER_COMMANDS_NAVIGATE_COMMANDS_H_ 6 #define CHROME_TEST_WEBDRIVER_COMMANDS_NAVIGATE_COMMANDS_H_ 7 8 #include <string> 9 #include <vector> 10 11 #include "chrome/test/webdriver/commands/webdriver_command.h" 12 13 namespace webdriver { 14 15 class Response; 16 17 // Navigate forward in the browser history, if possible. See: 18 // http://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/forward 19 class ForwardCommand : public WebDriverCommand { 20 public: 21 ForwardCommand(const std::vector<std::string>& path_segments, 22 const DictionaryValue* const parameters); 23 virtual ~ForwardCommand(); 24 25 virtual bool DoesPost() OVERRIDE; 26 virtual void ExecutePost(Response* const response) OVERRIDE; 27 28 private: 29 DISALLOW_COPY_AND_ASSIGN(ForwardCommand); 30 }; 31 32 // Navigate backwards in the browser history, if possible. See: 33 // http://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/back 34 class BackCommand : public WebDriverCommand { 35 public: 36 BackCommand(const std::vector<std::string>& path_segments, 37 const DictionaryValue* const parameters); 38 virtual ~BackCommand(); 39 40 virtual bool DoesPost() OVERRIDE; 41 virtual void ExecutePost(Response* const response) OVERRIDE; 42 43 private: 44 DISALLOW_COPY_AND_ASSIGN(BackCommand); 45 }; 46 47 // Performs a reload on the current page. See: 48 // http://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/refresh 49 class RefreshCommand : public WebDriverCommand { 50 public: 51 RefreshCommand(const std::vector<std::string>& path_segments, 52 const DictionaryValue* const parameters); 53 virtual ~RefreshCommand(); 54 55 virtual bool DoesPost() OVERRIDE; 56 virtual void ExecutePost(Response* const response) OVERRIDE; 57 58 private: 59 DISALLOW_COPY_AND_ASSIGN(RefreshCommand); 60 }; 61 62 } // namespace webdriver 63 64 #endif // CHROME_TEST_WEBDRIVER_COMMANDS_NAVIGATE_COMMANDS_H_ 65