| OLD | NEW |
| 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import os, time | 5 import os, time |
| 6 from autotest_lib.client.bin import test | 6 from autotest_lib.client.bin import test |
| 7 from autotest_lib.client.common_lib import error | 7 from autotest_lib.client.common_lib import error |
| 8 from autotest_lib.client.cros import login, ui_test | 8 from autotest_lib.client.cros import cros_ui_test, login |
| 9 | 9 |
| 10 class desktopui_WindowManagerFocusNewWindows(ui_test.UITest): | 10 class desktopui_WindowManagerFocusNewWindows(cros_ui_test.UITest): |
| 11 version = 1 | 11 version = 1 |
| 12 | 12 |
| 13 |
| 14 def initialize(self, creds = '$default'): |
| 15 cros_ui_test.UITest.initialize(self, creds) |
| 16 |
| 17 |
| 13 def __check_active_window(self, id, info): | 18 def __check_active_window(self, id, info): |
| 14 """Check that a particular window is active. | 19 """Check that a particular window is active. |
| 15 | 20 |
| 16 Args: | 21 Args: |
| 17 id: int window ID | 22 id: int window ID |
| 18 info: AutoX.WindowInfo object corresponding to 'id' | 23 info: AutoX.WindowInfo object corresponding to 'id' |
| 19 | 24 |
| 20 Raises: | 25 Raises: |
| 21 error.TestFail: if a condition timed out | 26 error.TestFail: if a condition timed out |
| 22 """ | 27 """ |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 win = self.autox.create_and_map_window( | 60 win = self.autox.create_and_map_window( |
| 56 width=200, height=200, title='test') | 61 width=200, height=200, title='test') |
| 57 info = self.autox.get_window_info(win.id) | 62 info = self.autox.get_window_info(win.id) |
| 58 self.__check_active_window(win.id, info) | 63 self.__check_active_window(win.id, info) |
| 59 | 64 |
| 60 # Create a second window. | 65 # Create a second window. |
| 61 win2 = self.autox.create_and_map_window( | 66 win2 = self.autox.create_and_map_window( |
| 62 width=200, height=200, title='test 2') | 67 width=200, height=200, title='test 2') |
| 63 info2 = self.autox.get_window_info(win2.id) | 68 info2 = self.autox.get_window_info(win2.id) |
| 64 self.__check_active_window(win2.id, info2) | 69 self.__check_active_window(win2.id, info2) |
| OLD | NEW |