OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 |
11 | 11 |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 // TestServer | 186 // TestServer |
187 %feature("docstring", | 187 %feature("docstring", |
188 "TestServer. Serves files in data dir over a local http server") | 188 "TestServer. Serves files in data dir over a local http server") |
189 TestServer; | 189 TestServer; |
190 class TestServer { | 190 class TestServer { |
191 public: | 191 public: |
192 enum Type { | 192 enum Type { |
193 TYPE_FTP, | 193 TYPE_FTP, |
194 TYPE_HTTP, | 194 TYPE_HTTP, |
195 TYPE_HTTPS, | 195 TYPE_HTTPS, |
196 TYPE_SYNC, | |
197 }; | 196 }; |
198 | 197 |
199 // Initialize a TestServer listening on the specified host (IP or hostname). | 198 // Initialize a TestServer listening on the specified host (IP or hostname). |
200 TestServer(Type type, const std::string& host, const FilePath& document_root); | 199 TestServer(Type type, const std::string& host, const FilePath& document_root); |
201 // Initialize a TestServer with a specific set of SSLOptions. | 200 // Initialize a TestServer with a specific set of SSLOptions. |
202 TestServer(Type type, | 201 TestServer(Type type, |
203 const SSLOptions& ssl_options, | 202 const SSLOptions& ssl_options, |
204 const FilePath& document_root); | 203 const FilePath& document_root); |
205 | 204 |
206 %feature("docstring", "Start TestServer over an ephemeral port") Start; | 205 %feature("docstring", "Start TestServer over an ephemeral port") Start; |
(...skipping 11 matching lines...) Expand all Loading... |
218 GURL GetURL(const std::string& path) const; | 217 GURL GetURL(const std::string& path) const; |
219 }; | 218 }; |
220 | 219 |
221 %extend TestServer { | 220 %extend TestServer { |
222 %feature("docstring", "Get port number.") GetPort; | 221 %feature("docstring", "Get port number.") GetPort; |
223 int GetPort() const { | 222 int GetPort() const { |
224 int val = 0; | 223 int val = 0; |
225 $self->server_data().GetInteger("port", &val); | 224 $self->server_data().GetInteger("port", &val); |
226 return val; | 225 return val; |
227 } | 226 } |
228 | |
229 %feature("docstring", "Get xmpp port number in case of sync server.") | |
230 GetSyncXmppPort; | |
231 int GetSyncXmppPort() const { | |
232 int val = 0; | |
233 $self->server_data().GetInteger("xmpp_port", &val); | |
234 return val; | |
235 } | |
236 }; | 227 }; |
237 | 228 |
238 } | 229 } |
239 // SSLOptions | 230 // SSLOptions |
240 %feature("docstring", | 231 %feature("docstring", |
241 "SSLOptions. Sets one of three types of a cert") | 232 "SSLOptions. Sets one of three types of a cert") |
242 SSLOptions; | 233 SSLOptions; |
243 struct SSLOptions { | 234 struct SSLOptions { |
244 enum ServerCertificate { | 235 enum ServerCertificate { |
245 CERT_OK, | 236 CERT_OK, |
246 CERT_MISMATCHED_NAME, | 237 CERT_MISMATCHED_NAME, |
247 CERT_EXPIRED, | 238 CERT_EXPIRED, |
248 }; | 239 }; |
249 | 240 |
250 // Initialize a new SSLOptions that will use the specified certificate. | 241 // Initialize a new SSLOptions that will use the specified certificate. |
251 explicit SSLOptions(ServerCertificate cert); | 242 explicit SSLOptions(ServerCertificate cert); |
252 }; | 243 }; |
253 | 244 |
254 %{ | 245 %{ |
255 typedef net::TestServer::SSLOptions SSLOptions; | 246 typedef net::TestServer::SSLOptions SSLOptions; |
256 %} | 247 %} |
257 | 248 |
258 %pointer_class(int, int_ptr); | 249 %pointer_class(int, int_ptr); |
259 %pointer_class(uint32, uint32_ptr); | 250 %pointer_class(uint32, uint32_ptr); |
OLD | NEW |