Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: tools/site_compare/drivers/win32/windowing.py

Issue 8678023: Fix python scripts in src/tools/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/site_compare/drivers/win32/mouse.py ('k') | tools/site_compare/operators/__init__.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python2.4 1 #!/usr/bin/env python
2 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """SiteCompare module for invoking, locating, and manipulating windows. 6 """SiteCompare module for invoking, locating, and manipulating windows.
7 7
8 This module is a catch-all wrapper for operating system UI functionality 8 This module is a catch-all wrapper for operating system UI functionality
9 that doesn't belong in other modules. It contains functions for finding 9 that doesn't belong in other modules. It contains functions for finding
10 particular windows, scraping their contents, and invoking processes to 10 particular windows, scraping their contents, and invoking processes to
11 create them. 11 create them.
12 """ 12 """
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 path: fully-qualified path of directory to ensure exists 331 path: fully-qualified path of directory to ensure exists
332 332
333 Returns: 333 Returns:
334 None 334 None
335 """ 335 """
336 try: 336 try:
337 os.makedirs(path) 337 os.makedirs(path)
338 except OSError, e: 338 except OSError, e:
339 if e[0] != 17: raise e # error 17: path already exists 339 if e[0] != 17: raise e # error 17: path already exists
340 340
341 if __name__ == "__main__": 341
342 def main():
342 PreparePath(r"c:\sitecompare\scrapes\ie7") 343 PreparePath(r"c:\sitecompare\scrapes\ie7")
343 # We're being invoked rather than imported. Let's do some tests 344 # We're being invoked rather than imported. Let's do some tests
344 345
345 # Hardcode IE's location for the purpose of this test 346 # Hardcode IE's location for the purpose of this test
346 (proc, wnd) = InvokeAndWait( 347 (proc, wnd) = InvokeAndWait(
347 r"c:\program files\internet explorer\iexplore.exe") 348 r"c:\program files\internet explorer\iexplore.exe")
348 349
349 # Find the browser pane in the IE window 350 # Find the browser pane in the IE window
350 browser = FindChildWindow( 351 browser = FindChildWindow(
351 wnd, "TabWindowClass/Shell DocObject View/Internet Explorer_Server") 352 wnd, "TabWindowClass/Shell DocObject View/Internet Explorer_Server")
352 353
353 # Move and size the window 354 # Move and size the window
354 MoveAndSizeWindow(wnd, (0, 0), (1024, 768), browser) 355 MoveAndSizeWindow(wnd, (0, 0), (1024, 768), browser)
355 356
356 # Take a screenshot 357 # Take a screenshot
357 i = ScrapeWindow(browser) 358 i = ScrapeWindow(browser)
358 359
359 i.show() 360 i.show()
360 361
361 EndProcess(proc, 0) 362 EndProcess(proc, 0)
362 363
364
365 if __name__ == "__main__":
366 sys.exit(main())
OLDNEW
« no previous file with comments | « tools/site_compare/drivers/win32/mouse.py ('k') | tools/site_compare/operators/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698