| OLD | NEW |
| (Empty) | |
| 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. |
| 5 |
| 6 """protector_updater.py: Runs Protector updater tests using two Chrome builds. |
| 7 |
| 8 Test requires two arguments: build url and chrome versions to be used, rest of |
| 9 the arguments are optional. The builds specified are sorted before installation |
| 10 begins, meaning lowest version of Chrome gets installed first and then Chrome |
| 11 is updated using the next, higher version of Chrome. Install and Update, which |
| 12 are both handled by the base class, return a pyauto.PyUITest object. PyUITest |
| 13 object can then be used to run updater tests. |
| 14 |
| 15 Example: |
| 16 $ python Chrome-Protector.py --url=http://chrome-master2.mtv.corp.google. \ |
| 17 com/official_builds/ --builds=19.0.1069.0,190.0.1070.0 |
| 18 """ |
| 19 |
| 20 import os |
| 21 import sys |
| 22 import unittest |
| 23 |
| 24 os.sys.path.append(os.path.join(os.path.pardir, 'pyautolib')) |
| 25 from install_test import InstallTest |
| 26 from py_unittest_util import GTestTextTestRunner |
| 27 |
| 28 |
| 29 class ProtectorUpdater(InstallTest): |
| 30 """Class to run Protector Updater tests.""" |
| 31 |
| 32 def __init__(self, methodName='runTest'): |
| 33 InstallTest.__init__(self, methodName) |
| 34 |
| 35 def testNoChangeOnCleanProfile(self): |
| 36 """Sample Protector test""" |
| 37 self.assertFalse(self._pyauto.GetProtectorState()['showing_change']) |
| 38 self.UpdateBuild() |
| 39 self.assertFalse(self._pyauto.GetProtectorState()['showing_change']) |
| 40 |
| 41 |
| 42 if __name__ == '__main__': |
| 43 suite = unittest.TestLoader().loadTestsFromTestCase(ProtectorUpdater) |
| 44 sys.exit(GTestTextTestRunner(verbosity=1).run(suite)) |
| OLD | NEW |