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

Unified Diff: build/android/monkeyrunner_screenshot.py

Issue 11470004: [Android] Add screenshot command line tool. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use parser.error Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | build/android/screenshot.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/monkeyrunner_screenshot.py
diff --git a/build/android/monkeyrunner_screenshot.py b/build/android/monkeyrunner_screenshot.py
deleted file mode 100755
index c478d047c3923eaa978e280a85ec5b8e92c5e223..0000000000000000000000000000000000000000
--- a/build/android/monkeyrunner_screenshot.py
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import sys
-from optparse import OptionParser
-from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
-
-def main(argv):
- # Parse options.
- parser = OptionParser()
- parser.add_option("--serial", dest="serial",
- help="connect to device with specified SERIAL",
- metavar="SERIAL")
- parser.add_option("--file", dest="filename",
- help="write screenshot to FILE",
- metavar="FILE", default="Screenshot.png")
- parser.add_option("--timeout", dest="timeout",
- help="TIMEOUT in seconds for connecting to a device",
- metavar="TIMEOUT", default=120)
- (options, args) = parser.parse_args(argv)
-
- # Connect to the current device, returning a MonkeyDevice object.
- # Monkeyrunner fails with a NullPointerException if options.serial is None.
- if options.serial:
- device = MonkeyRunner.waitForConnection(options.timeout, options.serial)
- else:
- device = MonkeyRunner.waitForConnection(options.timeout)
-
- if not device:
- return 1
-
- # Grab screenshot and write to disk.
- result = device.takeSnapshot()
- result.writeToFile(options.filename, 'png')
- return 0
-
-if __name__ == '__main__':
- sys.exit(main(sys.argv))
« no previous file with comments | « no previous file | build/android/screenshot.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698