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

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: update 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 #pragma once
kkania 2011/02/04 17:04:44 put this after the #define CHROME_TEST....
Joe 2011/02/09 06:32:10 If you place it after the ifdef doesn't that defea
6 #ifndef CHROME_TEST_WEBDRIVER_COMMANDS_COOKIE_COMMANDS_H_
7 #define CHROME_TEST_WEBDRIVER_COMMANDS_COOKIE_COMMANDS_H_
8
9 #include "chrome/test/webdriver/commands/webdriver_command.h"
10
11 namespace webdriver {
12
13 // Retrieve all cookies visible to the current page. Each cookie will be
14 // returned as a JSON object with the following properties:
15 // name, value, path, domain, secure, and expiry. See:
16 // http://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/c ookie
17 class CookieCommand: public WebDriverCommand {
John Grabowski 2011/02/04 02:40:23 Here you have class CookieCommand: later in this
Joe 2011/02/09 06:32:10 I named the classes after the URLS of the JSON web
18 public:
19 CookieCommand(const std::vector<std::string> path_segments,
20 const DictionaryValue* const parameters)
21 : WebDriverCommand(path_segments, parameters) {}
22 virtual ~CookieCommand(){}
23
24 virtual bool Init(Response* const response);
25
26 virtual bool DoesDelete() { return true; }
27 virtual bool DoesGet() { return true; }
28 virtual bool DoesPost() { return true; }
29
30 virtual void ExecuteDelete(Response* const response);
31 virtual void ExecuteGet(Response* const response);
32 virtual void ExecutePost(Response* const response);
33
34 private:
35 GURL current_url_;
kkania 2011/02/04 17:04:44 need to include GURL header in this file since you
Joe 2011/02/09 06:32:10 Done.
36
37 virtual bool RequiresValidTab() { return true; }
38
39 DISALLOW_COPY_AND_ASSIGN(CookieCommand);
40 };
41
42 // Set a cookie. The cookie should be specified as a JSON object with the
43 // following properties: name, value, path, domain, secure, and expiry. See:
44 // http://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/c ookie/:name
45 class NamedCookieCommand : public WebDriverCommand {
46 public:
47 NamedCookieCommand(const std::vector<std::string> path_segments,
48 const DictionaryValue* const parameters)
49 : WebDriverCommand(path_segments, parameters) {}
50 virtual ~NamedCookieCommand(){}
51
52 virtual bool Init(Response* const response);
53
54 protected:
55 virtual bool DoesDelete() { return true; }
56 virtual bool DoesGet() { return true; }
57
58 virtual void ExecuteDelete(Response* const response);
59 virtual void ExecuteGet(Response* const response);
60
61 private:
62 GURL current_url_;
63 std::string cookie_name_;
kkania 2011/02/04 17:04:44 need to #include <string>
Joe 2011/02/09 06:32:10 Done.
64
65 virtual bool RequiresValidTab() { return true; }
66
67 DISALLOW_COPY_AND_ASSIGN(NamedCookieCommand);
68 };
69
70 } // namespace webdriver
71
72 #endif // CHROME_TEST_WEBDRIVER_COMMANDS_COOKIE_COMMANDS_H_
73
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698