OLD | NEW |
1 # -*- coding: utf-8 -*- | 1 # -*- coding: utf-8 -*- |
2 # | 2 # |
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 | 7 |
8 # DESCRIPTION : | 8 # DESCRIPTION : |
9 # | 9 # |
10 # This is a factory test to test the LEDs (wifi, battery, etc). | 10 # This is a factory test to test the LEDs (wifi, battery, etc). |
11 | 11 |
12 | 12 |
13 import cairo | 13 import cairo |
14 import gtk | 14 import gtk |
15 import pango | 15 import pango |
16 import os | 16 import os |
17 import subprocess | 17 import subprocess |
18 import sys | 18 import sys |
19 import re | 19 import re |
20 | 20 |
21 from cmath import pi | 21 from cmath import pi |
22 from gtk import gdk | 22 from gtk import gdk |
23 | 23 |
24 from autotest_lib.client.bin import factory | 24 from autotest_lib.client.bin import factory |
25 from autotest_lib.client.bin import factory_ui_lib as ful | 25 from autotest_lib.client.bin import factory_ui_lib as ful |
26 from autotest_lib.client.bin import test | 26 from autotest_lib.client.bin import test |
27 from autotest_lib.client.bin import utils | 27 from autotest_lib.client.bin import utils |
28 from autotest_lib.client.common_lib import error | 28 from autotest_lib.client.bin import factory_error as error |
29 | 29 |
30 | 30 |
31 _LABEL_STATUS_SIZE = (140, 30) | 31 _LABEL_STATUS_SIZE = (140, 30) |
32 _LABEL_FONT = pango.FontDescription('courier new condensed 16') | 32 _LABEL_FONT = pango.FontDescription('courier new condensed 16') |
33 _LABEL_FG = gtk.gdk.color_parse('light green') | 33 _LABEL_FG = gtk.gdk.color_parse('light green') |
34 _LABEL_UNTESTED_FG = gtk.gdk.color_parse('grey40') | 34 _LABEL_UNTESTED_FG = gtk.gdk.color_parse('grey40') |
35 | 35 |
36 _PATTERN_LABEL_STR = 'pattern / 圖樣: ' | 36 _PATTERN_LABEL_STR = 'pattern / 圖樣: ' |
37 | 37 |
38 _ORANGE = gtk.gdk.color_parse('orange') | 38 _ORANGE = gtk.gdk.color_parse('orange') |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 cleanup_callback=self.quit) | 256 cleanup_callback=self.quit) |
257 | 257 |
258 failed_set = set(name for name, status in self._status_map.items() | 258 failed_set = set(name for name, status in self._status_map.items() |
259 if status is not ful.PASSED) | 259 if status is not ful.PASSED) |
260 if failed_set: | 260 if failed_set: |
261 raise error.TestFail('Some patterns failed\n' \ | 261 raise error.TestFail('Some patterns failed\n' \ |
262 '以下圖樣測試未通過: %s' % | 262 '以下圖樣測試未通過: %s' % |
263 ', '.join(failed_set)) | 263 ', '.join(failed_set)) |
264 | 264 |
265 factory.log('%s run_once finished' % self.__class__) | 265 factory.log('%s run_once finished' % self.__class__) |
OLD | NEW |