Home | History | Annotate | Download | only in autoupdate_CrashBrowserAfterUpdate
      1 # Copyright 2018 The Chromium OS 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 import logging
      6 
      7 from autotest_lib.client.common_lib import error
      8 from autotest_lib.client.common_lib.cros import chrome
      9 from autotest_lib.client.cros.update_engine import update_engine_test
     10 
     11 class autoupdate_CrashBrowserAfterUpdate(update_engine_test.UpdateEngineTest):
     12     """Tests creating a new user and crashing the browser during an update."""
     13     version = 1
     14 
     15     def run_once(self):
     16         try:
     17             # Login as a new user.
     18             with chrome.Chrome(logged_in=True, dont_override_profile=False) \
     19                 as cr:
     20                 self._wait_for_update_to_complete()
     21                 tab = cr.browser.tabs[0]
     22                 tab.Navigate('chrome://inducebrowsercrashforrealz')
     23         except Exception as e:
     24             logging.info('Browser crashed as expected.')
     25             logging.error(e)
     26             return
     27 
     28         raise error.TestFail('Browser did not crash! Check the logs.')
     29