summaryrefslogtreecommitdiffstats
path: root/chrome/browser/media/test_license_server.h
blob: 0fa77f45b905e812c97a8e18b3fb762798c902b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright 2014 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_MEDIA_TEST_LICENSE_SERVER_H_
#define CHROME_BROWSER_MEDIA_TEST_LICENSE_SERVER_H_

#include <string>
#include "base/memory/scoped_ptr.h"
#include "base/process/process.h"

class TestLicenseServerConfig;

// Class used to start a test license server.
class TestLicenseServer {
 public:
  explicit TestLicenseServer(scoped_ptr<TestLicenseServerConfig> server_config);
  ~TestLicenseServer();

  // Returns true if the server started successfully. False otherwise.
  bool Start();
  // Returns true if the server was stopped successfully. False otherwise.
  bool Stop();
  // Returns a string containing the URL and port the server is listening to.
  std::string GetServerURL();

 private:
  // License server configuration class used to obtain server paths, etc.
  scoped_ptr<TestLicenseServerConfig> server_config_;
  // Process for the license server.
  base::Process license_server_process_;

  DISALLOW_COPY_AND_ASSIGN(TestLicenseServer);
};

#endif  // CHROME_BROWSER_MEDIA_TEST_LICENSE_SERVER_H_