OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 # TODO(nduca): Rewrite what some of these tests to use mocks instead of | 5 # TODO(nduca): Rewrite what some of these tests to use mocks instead of |
6 # actually talking to the device. This would improve our coverage quite | 6 # actually talking to the device. This would improve our coverage quite |
7 # a bit. | 7 # a bit. |
8 import unittest | 8 import unittest |
9 import socket | 9 import socket |
10 | 10 |
11 from telemetry import cros_browser_backend | 11 from telemetry.core import util |
12 from telemetry import cros_interface | 12 from telemetry.core.chrome import cros_browser_backend |
13 from telemetry import options_for_unittests | 13 from telemetry.core.chrome import cros_interface |
14 from telemetry import run_tests | 14 from telemetry.test import options_for_unittests |
15 from telemetry import util | 15 from telemetry.test import run_tests |
16 | 16 |
17 class CrOSInterfaceTest(unittest.TestCase): | 17 class CrOSInterfaceTest(unittest.TestCase): |
18 @run_tests.RequiresBrowserOfType('cros-chrome') | 18 @run_tests.RequiresBrowserOfType('cros-chrome') |
19 def testDeviceSideProcessFailureToLaunch(self): | 19 def testDeviceSideProcessFailureToLaunch(self): |
20 remote = options_for_unittests.GetCopy().cros_remote | 20 remote = options_for_unittests.GetCopy().cros_remote |
21 cri = cros_interface.CrOSInterface( | 21 cri = cros_interface.CrOSInterface( |
22 remote, | 22 remote, |
23 options_for_unittests.GetCopy().cros_ssh_identity) | 23 options_for_unittests.GetCopy().cros_ssh_identity) |
24 | 24 |
25 def WillFail(): | 25 def WillFail(): |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 cri = cros_interface.CrOSInterface( | 154 cri = cros_interface.CrOSInterface( |
155 remote, | 155 remote, |
156 options_for_unittests.GetCopy().cros_ssh_identity) | 156 options_for_unittests.GetCopy().cros_ssh_identity) |
157 | 157 |
158 # Should return 2 separate ports even though the first one isn't technically | 158 # Should return 2 separate ports even though the first one isn't technically |
159 # being used yet. | 159 # being used yet. |
160 remote_port_1 = cri.GetRemotePort() | 160 remote_port_1 = cri.GetRemotePort() |
161 remote_port_2 = cri.GetRemotePort() | 161 remote_port_2 = cri.GetRemotePort() |
162 | 162 |
163 self.assertTrue(remote_port_1 != remote_port_2) | 163 self.assertTrue(remote_port_1 != remote_port_2) |
OLD | NEW |