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

Unified Diff: tools/telemetry/telemetry/android_browser_finder_unittest.py

Issue 12278015: [Telemetry] Reorganize everything. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Re-add shebangs. Created 7 years, 10 months 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 | « tools/telemetry/telemetry/android_browser_finder.py ('k') | tools/telemetry/telemetry/android_platform.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/android_browser_finder_unittest.py
diff --git a/tools/telemetry/telemetry/android_browser_finder_unittest.py b/tools/telemetry/telemetry/android_browser_finder_unittest.py
deleted file mode 100644
index 1d70e5216295356cebdbd9691e9ae76785c16dc7..0000000000000000000000000000000000000000
--- a/tools/telemetry/telemetry/android_browser_finder_unittest.py
+++ /dev/null
@@ -1,88 +0,0 @@
-# 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 unittest
-
-from telemetry import android_browser_finder
-from telemetry import browser_options
-from telemetry import system_stub
-
-class LoggingStub(object):
- def __init__(self):
- self.warnings = []
-
- def info(self, msg, *args):
- pass
-
- def warn(self, msg, *args):
- self.warnings.append(msg % args)
-
-class AndroidBrowserFinderTest(unittest.TestCase):
- def setUp(self):
- self._stubs = system_stub.Override(android_browser_finder,
- ['adb_commands', 'subprocess'])
-
- def tearDown(self):
- self._stubs.Restore()
-
- def test_no_adb(self):
- options = browser_options.BrowserOptions()
-
- def NoAdb(*args, **kargs): # pylint: disable=W0613
- raise OSError('not found')
- self._stubs.subprocess.Popen = NoAdb
- browsers = android_browser_finder.FindAllAvailableBrowsers(options)
- self.assertEquals(0, len(browsers))
-
- def test_adb_no_devices(self):
- options = browser_options.BrowserOptions()
-
- browsers = android_browser_finder.FindAllAvailableBrowsers(options)
- self.assertEquals(0, len(browsers))
-
-
- def test_adb_permissions_error(self):
- options = browser_options.BrowserOptions()
-
- self._stubs.subprocess.Popen.communicate_result = (
- """List of devices attached
-????????????\tno permissions""",
- """* daemon not running. starting it now on port 5037 *
-* daemon started successfully *
-""")
-
- log_stub = LoggingStub()
- browsers = android_browser_finder.FindAllAvailableBrowsers(
- options, log_stub)
- self.assertEquals(3, len(log_stub.warnings))
- self.assertEquals(0, len(browsers))
-
-
- def test_adb_two_devices(self):
- options = browser_options.BrowserOptions()
-
- self._stubs.adb_commands.attached_devices = ['015d14fec128220c',
- '015d14fec128220d']
-
- log_stub = LoggingStub()
- browsers = android_browser_finder.FindAllAvailableBrowsers(
- options, log_stub)
- self.assertEquals(1, len(log_stub.warnings))
- self.assertEquals(0, len(browsers))
-
- def test_adb_one_device(self):
- options = browser_options.BrowserOptions()
-
- self._stubs.adb_commands.attached_devices = ['015d14fec128220c']
-
- def OnPM(args):
- assert args[0] == 'pm'
- assert args[1] == 'list'
- assert args[2] == 'packages'
- return ['package:org.chromium.content_shell_apk',
- 'package.com.google.android.setupwizard']
-
- self._stubs.adb_commands.shell_command_handlers['pm'] = OnPM
-
- browsers = android_browser_finder.FindAllAvailableBrowsers(options)
- self.assertEquals(1, len(browsers))
« no previous file with comments | « tools/telemetry/telemetry/android_browser_finder.py ('k') | tools/telemetry/telemetry/android_platform.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698