| Index: chrome/test/mini_installer/process.py
|
| diff --git a/chrome/test/mini_installer/process.py b/chrome/test/mini_installer/process.py
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..bef2000222d47c0dbe822f2123d8edf045619918
|
| --- /dev/null
|
| +++ b/chrome/test/mini_installer/process.py
|
| @@ -0,0 +1,32 @@
|
| +# Copyright 2017 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.
|
| +
|
| +import chrome_helper
|
| +import entry
|
| +
|
| +class Process(entry.Entry):
|
| + """ Visitor for Processes entry in property.
|
| + """
|
| + def __init__(self, variable_expander, visitor):
|
| + super(Process, self).__init__(variable_expander, visitor)
|
| + self.process_path = None
|
| + self.is_running = None
|
| + self.should_process_run = None
|
| +
|
| + def Check(self, entry_name, entry_value):
|
| + """ Check whether a process is running or not.
|
| +
|
| + Args:
|
| + 'entry_name' - A string represents the path to the process being
|
| + verified.
|
| + 'entry_value' - A dictionary with the following key and value:
|
| + 'running': a boolean indicating whether the process
|
| + should be running.
|
| + """
|
| + running_process_paths = [path for (_, path) in
|
| + chrome_helper.GetProcessIDAndPathPairs()]
|
| + self.process_path = self._variable_expander.Expand(entry_name)
|
| + self.is_running = self.process_path in running_process_paths
|
| + self.should_process_run = entry_value['running']
|
| + self._visitor.VisitProcess(self)
|
|
|