autotest: refactor graphics_utils.

Move screenshot code to graphics_utils.
Move xsystem et al to cros_ui.py.
Fail if X is used under freon.
Make pylint happy.

TODO: write a (unit/auto)test for graphics_utils.

BUG=chromium:422414
TEST=Ran graphics_GLMark2 power_Consumption power_Backlight ui_SystemTray
     on nyan_big, verified that code got exercised and is not broken.
     Ran camera_V4L2 desktopui_GmailLatency graphics_GLAPICheck graphics_Gbm
     graphics_Piglit graphics_SanAngeles hardware_VideoOutSemiAuto on
     link_freon and nyan_big and made sure we got reasonable pass/fail.

Change-Id: I31f49d8c7b7a4e899bf47ba0b3543fc8755eecb8
Reviewed-on: https://chromium-review.googlesource.com/222990
Reviewed-by: Haixia Shi <hshi@chromium.org>
Commit-Queue: Ilja Friedel <ihf@chromium.org>
Tested-by: Ilja Friedel <ihf@chromium.org>
diff --git a/client/cros/chrome_binary_test.py b/client/cros/chrome_binary_test.py
index ac49f12..c358af0 100755
--- a/client/cros/chrome_binary_test.py
+++ b/client/cros/chrome_binary_test.py
@@ -6,7 +6,8 @@
 
 from autotest_lib.client.bin import test, utils
 from autotest_lib.client.common_lib import error
-from autotest_lib.client.cros import constants, cros_ui
+from autotest_lib.client.cros import constants
+from autotest_lib.client.cros.graphics import graphics_utils
 
 
 class ChromeBinaryTest(test.test):
@@ -63,9 +64,9 @@
 
         try:
             if as_chronos:
-                cros_ui.xsystem_as(cmd, user='chronos')
+                graphics_utils.xsystem(cmd, user='chronos')
             else:
-                cros_ui.xsystem(cmd)
+                graphics_utils.xsystem(cmd)
         except error.CmdError as e:
             raise error.TestFail('%s failed! %s' % (binary_to_run, e))