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

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: Saving a file, sherlock? ;) 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
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..6f6c503d41739ca935ec79dd607a07062fca28de
--- /dev/null
+++ b/chrome/browser/policy/test/local_policy_test_server.h
@@ -0,0 +1,48 @@
+// 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 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(FilePath* testserver_path) const OVERRIDE;
+ virtual bool GenerateAdditionalArguments(
+ base::DictionaryValue* arguments) const OVERRIDE;
+
+ private:
+ FilePath config_file_;
+
+ DISALLOW_COPY_AND_ASSIGN(LocalPolicyTestServer);
+};
+
+} // namespace
+
+#endif // CHROME_BROWSER_POLICY_TEST_LOCAL_POLICY_TEST_SERVER_H_

Powered by Google App Engine
This is Rietveld 408576698