Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_TEST_WEBDRIVER_COMMANDS_COOKIE_COMMANDS_H_ | |
| 6 #define CHROME_TEST_WEBDRIVER_COMMANDS_COOKIE_COMMANDS_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include <string> | |
| 10 | |
| 11 #include "chrome/test/webdriver/commands/webdriver_command.h" | |
| 12 #include "googleurl/src/gurl.h" | |
| 13 | |
| 14 class DictionaryValue; | |
| 15 | |
| 16 namespace webdriver { | |
| 17 | |
| 18 class Response; | |
| 19 | |
| 20 // Retrieve all cookies visible to the current page. Each cookie will be | |
| 21 // returned as a JSON object with the following properties: | |
| 22 // name, value, path, domain, secure, and expiry. See: | |
| 23 // http://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/c ookie | |
| 24 class CookieCommand: public WebDriverCommand { | |
|
John Grabowski
2011/02/14 21:59:06
classname: and classname<space>: are used in this
kkania
2011/02/14 22:47:08
Use the second one (class CookieCommand : public .
| |
| 25 public: | |
| 26 CookieCommand(const std::vector<std::string>& path_segments, | |
| 27 const DictionaryValue* const parameters) | |
| 28 : WebDriverCommand(path_segments, parameters) {} | |
| 29 virtual ~CookieCommand(){} | |
| 30 | |
| 31 virtual bool Init(Response* const response); | |
| 32 | |
| 33 virtual bool DoesDelete() { return true; } | |
| 34 virtual bool DoesGet() { return true; } | |
| 35 virtual bool DoesPost() { return true; } | |
| 36 | |
| 37 virtual void ExecuteDelete(Response* const response); | |
| 38 virtual void ExecuteGet(Response* const response); | |
| 39 virtual void ExecutePost(Response* const response); | |
| 40 | |
| 41 private: | |
| 42 GURL current_url_; | |
| 43 | |
| 44 DISALLOW_COPY_AND_ASSIGN(CookieCommand); | |
| 45 }; | |
| 46 | |
| 47 // Set a cookie. The cookie should be specified as a JSON object with the | |
| 48 // following properties: name, value, path, domain, secure, and expiry. See: | |
| 49 // http://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/c ookie/:name | |
| 50 class NamedCookieCommand : public WebDriverCommand { | |
| 51 public: | |
| 52 NamedCookieCommand(const std::vector<std::string>& path_segments, | |
| 53 const DictionaryValue* const parameters) | |
| 54 : WebDriverCommand(path_segments, parameters) {} | |
| 55 virtual ~NamedCookieCommand(){} | |
| 56 | |
| 57 virtual bool Init(Response* const response); | |
| 58 | |
| 59 protected: | |
| 60 virtual bool DoesDelete() { return true; } | |
| 61 virtual bool DoesGet() { return true; } | |
| 62 | |
| 63 virtual void ExecuteDelete(Response* const response); | |
| 64 virtual void ExecuteGet(Response* const response); | |
| 65 | |
| 66 private: | |
| 67 GURL current_url_; | |
| 68 std::string cookie_name_; | |
| 69 | |
| 70 DISALLOW_COPY_AND_ASSIGN(NamedCookieCommand); | |
| 71 }; | |
| 72 | |
| 73 } // namespace webdriver | |
| 74 | |
| 75 #endif // CHROME_TEST_WEBDRIVER_COMMANDS_COOKIE_COMMANDS_H_ | |
| OLD | NEW |