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