Home | History | Annotate | Download | only in install_test
      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
      3 # found in the LICENSE file.
      4 
      5 """Tests that demonstrate use of install test framework."""
      6 
      7 import os
      8 import sys
      9 import unittest
     10 
     11 from install_test import InstallTest
     12 
     13 
     14 class SampleUpdater(InstallTest):
     15   """Sample update tests."""
     16 
     17   def testCanOpenGoogle(self):
     18     """Simple Navigation.
     19 
     20     This test case illustrates how to run an update test. Update tests require
     21     two or more builds.
     22     """
     23     self.Install(self.GetUpdateBuilds()[0])
     24     self.StartChrome()
     25     self._driver.get('http://www.google.com/')
     26     self.Install(self.GetUpdateBuilds()[1])
     27     self.StartChrome()
     28     self._driver.get('http://www.google.org/')
     29 
     30   def testCanOpenGoogleOrg(self):
     31     """Simple Navigation.
     32 
     33     This test case illustrates how to run a fresh install test. Simple install
     34     tests, unlike update test, require only a single build.
     35     """
     36     self.Install(self.GetInstallBuild())
     37     self.StartChrome()
     38     self._driver.get('http://www.google.org/')
     39 
     40   def testCanOpenNewTab(self):
     41     """Sample of using the extended webdriver interface."""
     42     self.Install(self.GetInstallBuild())
     43     self.StartChrome()
     44     self._driver.create_blank_tab()
     45