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

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

Powered by Google App Engine
This is Rietveld 408576698