blob: 96c8e2f4e0571a2651c23b282095f62afb1e318a [file] [log] [blame]
# Copyright (c) 2011 The Chromium OS Authors. All rights res.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os, re
from autotest_lib.client.bin import test, utils
from autotest_lib.client.common_lib import error
class realtimecomm_GTalkLmiCamera(test.test):
version = 1
camera_measurement = {}
def run_once(self):
camtool = os.path.join(self.bindir, 'camtool')
if not os.path.exists(camtool):
raise error.TestFail('Missing camtool binary. Make sure gtalk has '
'been emerged.')
# Run camera.
test_cmd = "%s capture --duration 60 --histogram --norender" % camtool
result = utils.system_output(test_cmd)
# Get average frame per second.
fps ="with fps\:(\d+) requested", result, re.M);
if fps and
self.camera_measurement['fps'] = int(
raise error.TestFail("No fps. Camtool output: %s" % result)
# Get start up latency.
latency ="Camera start-up time\: (\d+)ms", result, re.M);
if latency and
self.camera_measurement['latency'] = int(
raise error.TestFail("No latency. Camtool output: %s" % result)
# Get jerkiness.
jerkiness ="Jerkiness: ([0-9]+\.[0-9]*)\%", result, re.M);
if jerkiness and
self.camera_measurement['jerkiness'] = float(
raise error.TestFail("No jerkiness. Camtool output: %s" % result)
# Report camera measurement.