OLD | NEW |
1 #!/usr/bin/python2.4 | 1 #!/usr/bin/python2.4 |
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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 self.assertTrue(not client is None) | 262 self.assertTrue(not client is None) |
263 | 263 |
264 url = base_path + self.sample_path + ".html" | 264 url = base_path + self.sample_path + ".html" |
265 | 265 |
266 # load the sample. | 266 # load the sample. |
267 self.session.open(url) | 267 self.session.open(url) |
268 | 268 |
269 # wait for it to initialize. | 269 # wait for it to initialize. |
270 self.session.wait_for_condition(ready_condition, timeout) | 270 self.session.wait_for_condition(ready_condition, timeout) |
271 | 271 |
| 272 self.session.run_script( |
| 273 "if (window.o3d_prepForSelenium) { window.o3d_prepForSelenium(); }") |
| 274 |
272 if assertion: | 275 if assertion: |
273 self.assertEqual("true", self.session.get_eval(assertion)) | 276 self.assertEqual("true", self.session.get_eval(assertion)) |
274 | 277 |
275 # take a screenshot. | 278 # take a screenshot. |
276 screenshot_id = 1 | 279 screenshot_id = 1 |
277 for clock in screenshots: | 280 for clock in screenshots: |
278 # if they are animated we need to stop the animation and set the clock | 281 # if they are animated we need to stop the animation and set the clock |
279 # to some time so we get a known state. | 282 # to some time so we get a known state. |
280 self.session.run_script("g_timeMult = 0") | 283 self.session.run_script("g_timeMult = 0") |
281 self.session.run_script("g_clock = " + clock) | 284 self.session.run_script("g_clock = " + clock) |
282 | 285 |
283 # take a screenshot. | 286 # take a screenshot. |
284 screenshot = self.sample_path.replace("/", "_") + str(screenshot_id) | 287 screenshot = self.sample_path.replace("/", "_") + str(screenshot_id) |
285 self.assertTrue(TakeScreenShot(self.session, self.browser, | 288 self.assertTrue(TakeScreenShot(self.session, self.browser, |
286 client, screenshot)) | 289 client, screenshot)) |
287 screenshot_id += 1 | 290 screenshot_id += 1 |
OLD | NEW |