| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/test/webdriver/cookie.h" | 5 #include "chrome/test/webdriver/cookie.h" |
| 6 | 6 |
| 7 #include <time.h> | 7 #include <time.h> |
| 8 | 8 |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 valid_ = false; | 82 valid_ = false; |
| 83 return; | 83 return; |
| 84 } | 84 } |
| 85 #endif | 85 #endif |
| 86 expires_ = std::string(buff); | 86 expires_ = std::string(buff); |
| 87 } | 87 } |
| 88 | 88 |
| 89 valid_ = true; | 89 valid_ = true; |
| 90 } | 90 } |
| 91 | 91 |
| 92 Cookie::~Cookie() {} |
| 93 |
| 92 // Convert's to webdriver's cookie spec, see: | 94 // Convert's to webdriver's cookie spec, see: |
| 93 // http://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/c
ookie | 95 // http://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/c
ookie |
| 94 DictionaryValue* Cookie::ToDictionary() { | 96 DictionaryValue* Cookie::ToDictionary() { |
| 95 DictionaryValue* cookie = new DictionaryValue(); | 97 DictionaryValue* cookie = new DictionaryValue(); |
| 96 | 98 |
| 97 // Required parameters for WebDriver protocol. | 99 // Required parameters for WebDriver protocol. |
| 98 cookie->SetString("name", name_); | 100 cookie->SetString("name", name_); |
| 99 cookie->SetString("value", value_); | 101 cookie->SetString("value", value_); |
| 100 cookie->SetString("path", path_); | 102 cookie->SetString("path", path_); |
| 101 cookie->SetString("domain", domain_); | 103 cookie->SetString("domain", domain_); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 } | 141 } |
| 140 if (http_) { | 142 if (http_) { |
| 141 cookie += "http_only;"; | 143 cookie += "http_only;"; |
| 142 } | 144 } |
| 143 | 145 |
| 144 return cookie; | 146 return cookie; |
| 145 } | 147 } |
| 146 | 148 |
| 147 } // namespace webdriver | 149 } // namespace webdriver |
| 148 | 150 |
| OLD | NEW |