1 # Copyright 2014 The Chromium OS Authors. All rights reserved. 2 # Use of this source code is governed by a BSD-style license that can be 3 # found in the LICENSE file. 4 5 import os.path 6 7 from autotest_lib.client.bin import utils 8 from autotest_lib.client.common_lib import error 9 from autotest_lib.client.cros import chrome_binary_test 10 from autotest_lib.client.cros.graphics import graphics_utils 11 12 class graphics_GLES2ConformChrome(chrome_binary_test.ChromeBinaryTest): 13 """ 14 Run the Khronos GLES2 Conformance test suite against the Chrome GPU command 15 buffer. 16 """ 17 version = 1 18 GSC = None 19 BINARY = 'gles2_conform_test' 20 21 def initialize(self): 22 super(graphics_GLES2ConformChrome, self).initialize() 23 self.GSC = graphics_utils.GraphicsStateChecker() 24 25 def cleanup(self): 26 super(graphics_GLES2ConformChrome, self).cleanup() 27 if self.GSC: 28 keyvals = self.GSC.get_memory_keyvals() 29 for key, val in keyvals.iteritems(): 30 self.output_perf_value(description=key, value=val, 31 units='bytes', higher_is_better=False) 32 self.GSC.finalize() 33 self.write_perf_keyval(keyvals) 34 35 def run_once(self): 36 # TODO(ihf): Remove this once GLES2ConformChrome works on freon. 37 if utils.is_freon(): 38 raise error.TestNAError( 39 'Test needs work on Freon. See crbug.com/484463.') 40 41 if not os.path.exists(self.get_chrome_binary_path(self.BINARY)): 42 raise error.TestFail('%s not found. Use internal Chrome sources!' % 43 self.BINARY) 44 45 self.run_chrome_test_binary(self.BINARY) 46