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

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/linux_unittest.py

Issue 2821543003: In run-webkit-tests, start xvfb if necessary. (Closed)
Patch Set: Fix debug log Created 3 years, 8 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: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/linux_unittest.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/linux_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/linux_unittest.py
index fe363f73c44d767964611998b915a8c11137a37d..e62e030ecf3d1501de23567d7087be83b9a53ba0 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/linux_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/linux_unittest.py
@@ -114,3 +114,30 @@ class LinuxPortTest(port_testcase.PortTestCase):
port.clean_up_test_run()
self.assertEqual(port.host.environ['HOME'], '/home/user')
self.assertFalse(port.host.filesystem.exists(temp_home_dir))
+
+ def test_xvfb_started_no_display(self):
+ port = self.make_port()
+ port.host.environ['DISPLAY'] = ''
+ port.setup_test_run()
+ self.assertEqual(
+ port.host.executive.calls,
+ [['Xvfb', ':20', '-screen', '0', '1280x800x24', '-ac', '-dpi', '96']])
+
+ def test_xvfb_started_with_display(self):
+ port = self.make_port()
+ port.host.environ['DISPLAY'] = ':0'
+ port.host.executive = MockExecutive(exit_code=0)
+ port.setup_test_run()
+ self.assertEqual(port.host.executive.calls, [['xdpyinfo', '-display', ':0']])
+
+ def test_xvfb_started_with_display_set_but_no_x_server(self):
+ port = self.make_port()
+ port.host.environ['DISPLAY'] = ':0'
+ port.host.executive = MockExecutive(exit_code=1)
+ port.setup_test_run()
+ self.assertEqual(
+ port.host.executive.calls,
+ [
+ ['xdpyinfo', '-display', ':0'],
+ ['Xvfb', ':0', '-screen', '0', '1280x800x24', '-ac', '-dpi', '96']
+ ])

Powered by Google App Engine
This is Rietveld 408576698