OLD | NEW |
1 #!/usr/bin/python2.6.2 | 1 #!/usr/bin/python2.6.2 |
2 # Copyright 2009, Google Inc. | 2 # Copyright 2009, Google Inc. |
3 # All rights reserved. | 3 # All rights reserved. |
4 # | 4 # |
5 # Redistribution and use in source and binary forms, with or without | 5 # Redistribution and use in source and binary forms, with or without |
6 # modification, are permitted provided that the following conditions are | 6 # modification, are permitted provided that the following conditions are |
7 # met: | 7 # met: |
8 # | 8 # |
9 # * Redistributions of source code must retain the above copyright | 9 # * Redistributions of source code must retain the above copyright |
10 # notice, this list of conditions and the following disclaimer. | 10 # notice, this list of conditions and the following disclaimer. |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 import logging | 36 import logging |
37 import os | 37 import os |
38 import subprocess | 38 import subprocess |
39 import shutil | 39 import shutil |
40 import sys | 40 import sys |
41 | 41 |
42 import runner_constants as const | 42 import runner_constants as const |
43 import util | 43 import util |
44 | 44 |
45 CHANGE_RESOLUTION_PATH = os.path.join(const.TEST_PATH, 'lab', | 45 CHANGE_RESOLUTION_PATH = (const.O3D_PATH + '/o3d/tests/lab' |
46 'ChangeResolution','Debug', | 46 '/ChangeResolution/Debug/changeresolution.exe') |
47 'changeresolution.exe') | |
48 | 47 |
49 def EnsureWindowsScreenResolution(width, height, bpp): | 48 def EnsureWindowsScreenResolution(width, height, bpp): |
50 """Performs all steps needed to configure system for testing on Windows. | 49 """Performs all steps needed to configure system for testing on Windows. |
51 | 50 |
52 Args: | 51 Args: |
53 width: new screen resolution width | 52 width: new screen resolution width |
54 height: new screen resolution height | 53 height: new screen resolution height |
55 bpp: new screen resolution bytes per pixel | 54 bpp: new screen resolution bytes per pixel |
56 Returns: | 55 Returns: |
57 True on success. | 56 True on success. |
58 """ | 57 """ |
59 if not os.path.exists(CHANGE_RESOLUTION_PATH): | 58 |
60 return False | |
61 command = 'call "%s" %d %d %d' % (CHANGE_RESOLUTION_PATH, width, height, bpp) | 59 command = 'call "%s" %d %d %d' % (CHANGE_RESOLUTION_PATH, width, height, bpp) |
62 | 60 |
63 | 61 |
64 our_process = subprocess.Popen(command, | 62 our_process = subprocess.Popen(command, |
65 shell=True, | 63 shell=True, |
66 stdout=None, | 64 stdout=None, |
67 stderr=None, | 65 stderr=None, |
68 universal_newlines=True) | 66 universal_newlines=True) |
69 | 67 |
70 our_process.wait() | 68 our_process.wait() |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 return not DoesAnO3DPluginExist() | 155 return not DoesAnO3DPluginExist() |
158 | 156 |
159 def DoesAnO3DPluginExist(): | 157 def DoesAnO3DPluginExist(): |
160 for path in const.INSTALL_PATHS: | 158 for path in const.INSTALL_PATHS: |
161 if os.path.exists(path): | 159 if os.path.exists(path): |
162 return True | 160 return True |
163 return False | 161 return False |
164 | 162 |
165 | 163 |
166 | 164 |
OLD | NEW |