ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / chrome / browser / chromeos / login / test / https_forwarder.cc
blob118488ab9d811062c0bc6e6da560366523d23a15
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 #include "chrome/browser/chromeos/login/test/https_forwarder.h"
7 #include "base/base_paths.h"
8 #include "base/files/file_path.h"
9 #include "base/path_service.h"
10 #include "base/values.h"
11 #include "net/test/python_utils.h"
13 namespace chromeos {
15 HTTPSForwarder::HTTPSForwarder(const GURL& forward_target)
16 : net::LocalTestServer(net::LocalTestServer::TYPE_HTTPS,
17 net::LocalTestServer::kLocalhost,
18 base::FilePath()),
19 forward_target_(forward_target) {
22 HTTPSForwarder::~HTTPSForwarder() {
25 bool HTTPSForwarder::SetPythonPath() const {
26 if (!net::LocalTestServer::SetPythonPath())
27 return false;
29 base::FilePath net_testserver_path;
30 if (!LocalTestServer::GetTestServerPath(&net_testserver_path))
31 return false;
32 AppendToPythonPath(net_testserver_path.DirName());
34 return true;
37 bool HTTPSForwarder::GetTestServerPath(base::FilePath* testserver_path) const {
38 base::FilePath source_root_dir;
39 if (!PathService::Get(base::DIR_SOURCE_ROOT, &source_root_dir))
40 return false;
42 *testserver_path = source_root_dir.Append("chrome")
43 .Append("browser")
44 .Append("chromeos")
45 .Append("login")
46 .Append("test")
47 .Append("https_forwarder.py");
48 return true;
51 bool HTTPSForwarder::GenerateAdditionalArguments(
52 base::DictionaryValue* arguments) const {
53 base::FilePath source_root_dir;
54 if (!net::LocalTestServer::GenerateAdditionalArguments(arguments) ||
55 !PathService::Get(base::DIR_SOURCE_ROOT, &source_root_dir))
56 return false;
58 arguments->SetString("forward-target", forward_target_.spec());
59 return true;
62 } // namespace chromeos