Popular sites on the NTP: check that experiment group StartsWith (rather than IS...
[chromium-blink-merge.git] / chrome / browser / chromeos / login / test / https_forwarder.h
blobc054ae71d38617983b2b619a7efa14da7c2e0b9d
1 // Copyright 2014 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.
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_TEST_HTTPS_FORWARDER_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_TEST_HTTPS_FORWARDER_H_
8 #include <string>
10 #include "base/compiler_specific.h"
11 #include "base/macros.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "url/gurl.h"
15 namespace chromeos {
17 class ForwardingServer;
19 // An https test server that forwards all requests to another server. This
20 // allows a server that supports http only to be accessed over https.
22 // The server will bind to |127.0.0.1| but will present a certificate issued to
23 // |ssl_host|.
24 class HTTPSForwarder {
25 public:
26 HTTPSForwarder();
27 ~HTTPSForwarder();
29 // Returns a URL that uses |ssl_host_| as the host.
30 GURL GetURLForSSLHost(const std::string& path) const;
32 bool Initialize(const std::string& ssl_host,
33 const GURL& forward_target) WARN_UNUSED_RESULT;
35 private:
36 std::string ssl_host_;
38 scoped_ptr<ForwardingServer> forwarding_server_;
40 DISALLOW_COPY_AND_ASSIGN(HTTPSForwarder);
43 } // namespace chromeos
45 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_TEST_HTTPS_FORWARDER_H_