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 external SD and USB ports. | 10 # This is a factory test to test external SD and USB ports. |
11 | 11 |
12 | 12 |
13 import cairo | 13 import cairo |
14 import gobject | 14 import gobject |
15 import gtk | 15 import gtk |
16 import pango | 16 import pango |
17 import os | 17 import os |
18 import sys | 18 import sys |
19 | 19 |
20 from autotest_lib.client.bin import factory | 20 from autotest_lib.client.bin import factory |
21 from autotest_lib.client.bin import factory_ui_lib as ful | 21 from autotest_lib.client.bin import factory_ui_lib as ful |
22 from autotest_lib.client.bin import test | 22 from autotest_lib.client.bin import test |
23 from autotest_lib.client.bin import utils | 23 from autotest_lib.client.bin import utils |
24 from autotest_lib.client.common_lib import error | 24 from autotest_lib.client.bin import factory_error as error |
25 | 25 |
26 | 26 |
27 _STATE_WAIT_INSERT = 1 | 27 _STATE_WAIT_INSERT = 1 |
28 _STATE_WAIT_REMOVE = 2 | 28 _STATE_WAIT_REMOVE = 2 |
29 | 29 |
30 _INSERT_FMT_STR = lambda t: 'insert %s drive...\n插入%s存儲...' % (t, t) | 30 _INSERT_FMT_STR = lambda t: 'insert %s drive...\n插入%s存儲...' % (t, t) |
31 _REMOVE_FMT_STR = lambda t: 'remove %s drive...\n提取%s存儲...' % (t, t) | 31 _REMOVE_FMT_STR = lambda t: 'remove %s drive...\n提取%s存儲...' % (t, t) |
32 _TESTING_FMT_STR = lambda t:'testing %s...\n%s 檢查當中...' % (t, t) | 32 _TESTING_FMT_STR = lambda t:'testing %s...\n%s 檢查當中...' % (t, t) |
33 _ERR_TOO_MANY_REMOVE_FMT_STR = \ | 33 _ERR_TOO_MANY_REMOVE_FMT_STR = \ |
34 lambda target_dev, removed_dev: \ | 34 lambda target_dev, removed_dev: \ |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 test_widget = gtk.EventBox() | 147 test_widget = gtk.EventBox() |
148 test_widget.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse('black')) | 148 test_widget.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse('black')) |
149 test_widget.add(vbox) | 149 test_widget.add(vbox) |
150 | 150 |
151 ful.run_test_widget(self.job, test_widget) | 151 ful.run_test_widget(self.job, test_widget) |
152 | 152 |
153 if self._error: | 153 if self._error: |
154 raise error.TestFail(self._error) | 154 raise error.TestFail(self._error) |
155 | 155 |
156 factory.log('%s run_once finished' % self.__class__) | 156 factory.log('%s run_once finished' % self.__class__) |
OLD | NEW |