Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Unified Diff: chrome/browser/policy/test/local_policy_test_server.h

Issue 12235003: Split out policy code from net/tools/testserver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 80 chars. Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/policy/test/asn1der.py ('k') | chrome/browser/policy/test/local_policy_test_server.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/test/local_policy_test_server.h
diff --git a/chrome/browser/policy/test/local_policy_test_server.h b/chrome/browser/policy/test/local_policy_test_server.h
new file mode 100644
index 0000000000000000000000000000000000000000..10a9e2903612354b5c3932f774640782cb9a5f79
--- /dev/null
+++ b/chrome/browser/policy/test/local_policy_test_server.h
@@ -0,0 +1,49 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_POLICY_TEST_LOCAL_POLICY_TEST_SERVER_H_
+#define CHROME_BROWSER_POLICY_TEST_LOCAL_POLICY_TEST_SERVER_H_
+
+#include <string>
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "base/file_path.h"
+#include "googleurl/src/gurl.h"
+#include "net/test/local_test_server.h"
+
+namespace policy {
+
+// Runs a python implementation of the cloud policy server on the local machine.
+class LocalPolicyTestServer : public net::LocalTestServer {
+ public:
+ // Initializes a test server configured by the configuration file
+ // |config_file|.
+ explicit LocalPolicyTestServer(const base::FilePath& config_file);
+
+ // Initializes the test server with the configuration read from
+ // chrome/test/data/policy/policy_|test_name|.json.
+ explicit LocalPolicyTestServer(const std::string& test_name);
+
+ virtual ~LocalPolicyTestServer();
+
+ // Gets the service URL.
+ GURL GetServiceURL() const;
+
+ // net::LocalTestServer:
+ virtual bool SetPythonPath() const OVERRIDE;
+ virtual bool GetTestServerPath(
+ base::FilePath* testserver_path) const OVERRIDE;
+ virtual bool GenerateAdditionalArguments(
+ base::DictionaryValue* arguments) const OVERRIDE;
+
+ private:
+ base::FilePath config_file_;
+
+ DISALLOW_COPY_AND_ASSIGN(LocalPolicyTestServer);
+};
+
+} // namespace
+
+#endif // CHROME_BROWSER_POLICY_TEST_LOCAL_POLICY_TEST_SERVER_H_
« no previous file with comments | « chrome/browser/policy/test/asn1der.py ('k') | chrome/browser/policy/test/local_policy_test_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698