Chromium Code Reviews| Index: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/linux.py |
| diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/linux.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/linux.py |
| index beed25906b46949746f847f4716d56a6c0b76d23..568eda66065150b25ff8a4cdd5c8882cad6b6ed2 100644 |
| --- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/linux.py |
| +++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/linux.py |
| @@ -27,10 +27,9 @@ |
| # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| import logging |
| +import os |
| -from webkitpy.common.webkit_finder import WebKitFinder |
| from webkitpy.layout_tests.breakpad.dump_reader_multipart import DumpReaderLinux |
| -from webkitpy.layout_tests.models import test_run_results |
| from webkitpy.layout_tests.port import base |
| from webkitpy.layout_tests.port import win |
| @@ -68,6 +67,9 @@ class LinuxPort(base.Port): |
| if not self.get_option('disable_breakpad'): |
| self._dump_reader = DumpReaderLinux(host, self._build_path()) |
| + self._original_home = os.environ['HOME'] |
| + self._dummy_home = None |
| + |
| def additional_driver_flag(self): |
| flags = super(LinuxPort, self).additional_driver_flag() |
| if not self.get_option('disable_breakpad'): |
| @@ -104,10 +106,36 @@ class LinuxPort(base.Port): |
| _log.error("Could not find apache. Not installed or unknown path.") |
| return None |
| + def setup_test_run(self): |
| + super(LinuxPort, self).setup_test_run() |
| + self._setup_dummy_home_dir() |
| + |
| + def clean_up_test_run(self): |
| + super(LinuxPort, self).clean_up_test_run() |
| + self._clean_up_dummy_home_dir() |
| + |
| # |
| # PROTECTED METHODS |
| # |
| + def _setup_dummy_home_dir(self): |
| + """Creates a dummy home directory for running the test. |
| + |
| + This is a workaround for crbug.com/595504; see crbug.com/612730. |
| + """ |
| + self._dummy_home = self._filesystem.mkdtemp() |
| + os.environ['HOME'] = str(self._dummy_home) |
| + self._filesystem.copyfile( |
| + self._filesystem.join(self._original_home, '.Xauthority'), |
| + self._filesystem.join(str(self._dummy_home), '.Xauthority')) |
|
qyearsley
2016/07/14 00:00:38
I'm not actually entirely sure whether it's necess
|
| + |
| + def _clean_up_dummy_home_dir(self): |
| + """Cleans up the dummy dir and resets the HOME environment variable.""" |
| + dummy_home = os.environ['HOME'] |
| + assert dummy_home != self._original_home |
| + self._filesystem.rmtree(dummy_home) |
| + os.environ['HOME'] = self._original_home |
| + |
| def _check_apache_install(self): |
| result = self._check_file_exists(self.path_to_apache(), "apache2") |
| result = self._check_file_exists(self.path_to_apache_config_file(), "apache2 config file") and result |