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

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

Powered by Google App Engine
This is Rietveld 408576698