| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Swig Interface for PyAuto. | 5 // Swig Interface for PyAuto. |
| 6 // PyAuto makes the Automation Proxy interface available in Python | 6 // PyAuto makes the Automation Proxy interface available in Python |
| 7 // | 7 // |
| 8 // Running swig as: | 8 // Running swig as: |
| 9 // swig -python -c++ chrome/test/pyautolib/pyautolib.i | 9 // swig -python -c++ chrome/test/pyautolib/pyautolib.i |
| 10 // would generate pyautolib.py, pyautolib_wrap.cxx | 10 // would generate pyautolib.py, pyautolib_wrap.cxx |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 public: | 202 public: |
| 203 enum Type { | 203 enum Type { |
| 204 TYPE_FTP, | 204 TYPE_FTP, |
| 205 TYPE_HTTP, | 205 TYPE_HTTP, |
| 206 TYPE_HTTPS, | 206 TYPE_HTTPS, |
| 207 TYPE_SYNC, | 207 TYPE_SYNC, |
| 208 }; | 208 }; |
| 209 | 209 |
| 210 // Initialize a TestServer listening on the specified host (IP or hostname). | 210 // Initialize a TestServer listening on the specified host (IP or hostname). |
| 211 TestServer(Type type, const std::string& host, const FilePath& document_root); | 211 TestServer(Type type, const std::string& host, const FilePath& document_root); |
| 212 // Initialize a HTTPS TestServer with a specific set of HTTPSOptions. | 212 // Initialize a TestServer with a specific set of SSLOptions. |
| 213 TestServer(const HTTPSOptions& https_options, | 213 TestServer(Type type, |
| 214 const SSLOptions& ssl_options, |
| 214 const FilePath& document_root); | 215 const FilePath& document_root); |
| 215 | 216 |
| 216 %feature("docstring", "Start TestServer over an ephemeral port") Start; | 217 %feature("docstring", "Start TestServer over an ephemeral port") Start; |
| 217 bool Start(); | 218 bool Start(); |
| 218 | 219 |
| 219 %feature("docstring", "Stop TestServer") Stop; | 220 %feature("docstring", "Stop TestServer") Stop; |
| 220 bool Stop(); | 221 bool Stop(); |
| 221 | 222 |
| 222 %feature("docstring", "Get FilePath to the document root") document_root; | 223 %feature("docstring", "Get FilePath to the document root") document_root; |
| 223 const FilePath& document_root() const; | 224 const FilePath& document_root() const; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 239 %feature("docstring", "Get xmpp port number in case of sync server.") | 240 %feature("docstring", "Get xmpp port number in case of sync server.") |
| 240 GetSyncXmppPort; | 241 GetSyncXmppPort; |
| 241 int GetSyncXmppPort() const { | 242 int GetSyncXmppPort() const { |
| 242 int val = 0; | 243 int val = 0; |
| 243 $self->server_data().GetInteger("xmpp_port", &val); | 244 $self->server_data().GetInteger("xmpp_port", &val); |
| 244 return val; | 245 return val; |
| 245 } | 246 } |
| 246 }; | 247 }; |
| 247 | 248 |
| 248 } | 249 } |
| 249 // HTTPSOptions | 250 // SSLOptions |
| 250 %feature("docstring", | 251 %feature("docstring", |
| 251 "HTTPSOptions. Sets one of three types of a cert") | 252 "SSLOptions. Sets one of three types of a cert") |
| 252 HTTPSOptions; | 253 SSLOptions; |
| 253 struct HTTPSOptions { | 254 struct SSLOptions { |
| 254 enum ServerCertificate { | 255 enum ServerCertificate { |
| 255 CERT_OK, | 256 CERT_OK, |
| 256 CERT_MISMATCHED_NAME, | 257 CERT_MISMATCHED_NAME, |
| 257 CERT_EXPIRED, | 258 CERT_EXPIRED, |
| 258 }; | 259 }; |
| 259 | 260 |
| 260 // Initialize a new HTTPSOptions that will use the specified certificate. | 261 // Initialize a new SSLOptions that will use the specified certificate. |
| 261 explicit HTTPSOptions(ServerCertificate cert); | 262 explicit SSLOptions(ServerCertificate cert); |
| 262 }; | 263 }; |
| 263 | 264 |
| 264 %{ | 265 %{ |
| 265 typedef net::TestServer::HTTPSOptions HTTPSOptions; | 266 typedef net::TestServer::SSLOptions SSLOptions; |
| 266 %} | 267 %} |
| 267 | 268 |
| 268 %pointer_class(int, int_ptr); | 269 %pointer_class(int, int_ptr); |
| 269 %pointer_class(uint32, uint32_ptr); | 270 %pointer_class(uint32, uint32_ptr); |
| OLD | NEW |