Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Side by Side Diff: chrome/test/webdriver/commands/cookie_commands.h

Issue 6330012: Cookie commands for the webdriver protocol (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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/01/28 23:25:59 add '#pragma once' here
Joe 2011/02/03 10:02:05 Done.
8 #include "chrome/test/webdriver/commands/webdriver_command.h"
9
10 namespace webdriver {
11
12 // Retrieve all cookies visible to the current page. Each cookie will be
13 // returned as a JSON object with the following properties:
14 // name, value, path, domain, secure, and expiry. See:
15 // http://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/c ookie
16 class CookieCommand: public WebDriverCommand {
17 public:
18 CookieCommand(const std::vector<std::string> path_segments,
19 const DictionaryValue* const parameters)
20 : WebDriverCommand(path_segments, parameters) {}
21 virtual ~CookieCommand(){}
22
23 virtual bool Init(Response* const response);
24
25 virtual bool DoesDelete() { return true; }
26 virtual bool DoesGet() { return true; }
27 virtual bool DoesPost() { return true; }
28
29 virtual void ExecuteDelete(Response* const response);
30 virtual void ExecuteGet(Response* const response);
31 virtual void ExecutePost(Response* const response);
32
33 private:
34 GURL current_url_;
35
36 virtual bool RequiresValidTab() { return true; }
37
38 DISALLOW_COPY_AND_ASSIGN(CookieCommand);
39 };
40
41 // Set a cookie. The cookie should be specified as a JSON object with the
42 // following properties: name, value, path, domain, secure, and expiry. See:
43 // http://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/c ookie/:name
44 class NamedCookieCommand : public WebDriverCommand {
45 public:
46 NamedCookieCommand(const std::vector<std::string> path_segments,
47 const DictionaryValue* const parameters)
48 : WebDriverCommand(path_segments, parameters) {}
49 virtual ~NamedCookieCommand(){}
50
51 virtual bool Init(Response* const response);
52
53 protected:
54 virtual bool DoesDelete() { return true; }
55 virtual bool DoesGet() { return true; }
56
57 virtual void ExecuteDelete(Response* const response);
58 virtual void ExecuteGet(Response* const response);
59
60 private:
61 GURL current_url_;
62 std::string cookie_name_;
63
64 virtual bool RequiresValidTab() { return true; }
65
66 DISALLOW_COPY_AND_ASSIGN(NamedCookieCommand);
67 };
68
69 } // namespace webdriver
70
71 #endif // CHROME_TEST_WEBDRIVER_COMMANDS_COOKIE_COMMANDS_H_
72
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698