Index: chrome/test/webdriver/cookie.h |
diff --git a/chrome/test/webdriver/cookie.h b/chrome/test/webdriver/cookie.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..10397187f6ac57076df5e4df93c8d45f3ca68ca8 |
--- /dev/null |
+++ b/chrome/test/webdriver/cookie.h |
@@ -0,0 +1,47 @@ |
+// Copyright (c) 2010 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_TEST_WEBDRIVER_COOKIE_H_ |
+#define CHROME_TEST_WEBDRIVER_COOKIE_H_ |
+#pragma once |
+ |
+#include <string> |
+ |
+#include "base/values.h" |
+ |
+namespace webdriver { |
+ |
+// Class used to convert cookies to various formats. |
+class Cookie { |
+ public: |
+ explicit Cookie(const std::string& cookie); |
+ explicit Cookie(const DictionaryValue& dict); |
+ |
+ DictionaryValue* ToDictionary(); |
+ // ToJSONString returns a string form of a JSON object with the required |
John Grabowski
2011/02/15 03:39:56
ToJSONString() returns a ...
Joe
2011/02/15 21:39:26
Done.
|
+ // WebDriver tags. Example { "name"="foo", "value"="bar"} |
John Grabowski
2011/02/15 03:39:56
Can you use a valid Cookie as an example? Or docu
Joe
2011/02/15 21:39:26
The cookie is valid, it's a name value pair which
|
+ std::string ToJSONString(); |
+ // ToString returns a string format expected by chrome to for a cookie. |
+ // Example: "foo=bar" |
+ std::string ToString(); |
+ |
+ bool valid() const { return valid_; } |
+ const std::string& name() const { return name_; } |
+ |
+ private: |
+ std::string name_; |
+ std::string value_; |
+ std::string path_; |
+ std::string domain_; |
+ std::string expires_; |
+ bool secure_; |
+ bool http_; |
+ bool valid_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(Cookie); |
+}; |
+ |
+} // namespace webdriver |
+ |
+#endif // CHROME_TEST_WEBDRIVER_COOKIE_H_ |