-
Notifications
You must be signed in to change notification settings - Fork 10
Enterprise: Handle browser crash #291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -160,3 +160,15 @@ body:has(#notification-popup-box[open]) .felt:not(#notification-popup-box .felt) | |
| opacity: 0.5; | ||
| pointer-events: none; | ||
| } | ||
|
|
||
| .felt-browser-error { | ||
| position: absolute; | ||
| /* stylelint-disable-next-line */ | ||
| bottom: 32px; | ||
| /* stylelint-disable-next-line */ | ||
| left: 8px; | ||
| font-size: medium; | ||
| /* stylelint-disable-next-line stylelint-plugin-mozilla/use-design-tokens */ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Was this lint exception actually needed? Didn't you forget to remove this?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, https://treeherder.mozilla.org/logviewer?job_id=543562202&repo=enterprise-firefox-pr&task=DGk37lvMQKqsKjfUW9OEYA.0&lineNumber=212. We agreed that once we have a well defined crash ux, this will be revamped anyhow. |
||
| color: var(--icon-color-critical); | ||
| font-weight: var(--font-weight-bold); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| { | ||
lissyx marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "test_felt_00_chrome_on_email_submit": {}, | ||
| "test_felt_0_load_sso": { | ||
| "elements": [ | ||
| ["#login", "login"], | ||
| ["#password", "password"] | ||
| ] | ||
| }, | ||
| "test_felt_1_perform_sso_auth": {}, | ||
| "test_felt_2_crash_parent_once": {}, | ||
| "test_felt_3_proper_restart": {}, | ||
| "test_felt_4_crash_parent_twice": {}, | ||
| "test_felt_5_check_error_message": {} | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| { | ||
| "test_felt_00_chrome_on_email_submit": {}, | ||
| "test_felt_0_load_sso": { | ||
| "elements": [ | ||
| ["#login", "login"], | ||
| ["#password", "password"] | ||
| ] | ||
| }, | ||
| "test_felt_1_perform_sso_auth": {}, | ||
| "test_felt_2_crash_parent_once": {}, | ||
| "test_felt_3_proper_restart": {}, | ||
| "test_felt_4_crash_parent_twice": {}, | ||
| "test_felt_5_proper_restart_again": {} | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| #!/usr/bin/env python3 | ||
| # This Source Code Form is subject to the terms of the Mozilla Public | ||
| # License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| # file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
|
||
|
|
||
| from felt_tests import FeltTests | ||
| from selenium.webdriver.support import expected_conditions as EC | ||
|
|
||
|
|
||
| class BrowserCrashes(FeltTests): | ||
| def __init__(self, *args, **kwargs): | ||
| super().__init__(*args, **kwargs) | ||
|
|
||
| def record_felt_no_window(self): | ||
| self._window_handles = self._driver.window_handles | ||
|
|
||
| def await_felt_auth_window(self): | ||
| if len(self._window_handles) == 1 and self._window_handles[0] is None: | ||
| self._window_handles = [] | ||
| self._wait.until(EC.new_window_is_opened(self._window_handles)) | ||
|
|
||
| def force_window(self): | ||
| self._driver.set_context("chrome") | ||
| assert len(self._driver.window_handles) == 1, "One window exists" | ||
| self._driver.switch_to.window(self._driver.window_handles[0]) | ||
| self._driver.set_context("content") | ||
|
|
||
| def crash_parent(self): | ||
| self._browser_pid = self._child_driver.capabilities["moz:processID"] | ||
| self._logger.info(f"Crashing browser at {self._browser_pid}") | ||
| try: | ||
| # This is going to trigger exception for sure | ||
| self._logger.info("Crashing main process") | ||
| self.open_tab_child("about:crashparent") | ||
| except Exception as ex: | ||
| self._logger.info(f"Caught exception {ex}") | ||
| pass | ||
lissyx marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| def connect_and_crash(self): | ||
| # Make sure we record the proper state of window handles of FELT before | ||
| # we may re-open the window | ||
| self.record_felt_no_window() | ||
|
|
||
| self.connect_child_browser() | ||
| self.crash_parent() | ||
Uh oh!
There was an error while loading. Please reload this page.