Skip to content

Conversation

@cmonfortep
Copy link
Contributor

@cmonfortep cmonfortep commented May 7, 2020

Task/Issue URL: https://app.asana.com/0/414730916066338/1173393687766921/f
Tech Design URL:
CC:

Description:
When authentication popup is show, previous website is still loaded in the background. This could add some confusion to users if the popup is triggered by an non related website.

Update the URL and hide web content if authentication popup is triggered by a host different to the website currently being displayed. Display content again when dialog dismissed.

Steps to test this PR:

Test 1

  1. visit http://lcamtuf.coredump.cx/authspoof/
  2. click on the button
  3. browser navigates to google.com
  4. wait 3 sec for the authentication popup
  5. Ensure url gets updated and web content hides

Test 2

  1. visit http://lcamtuf.coredump.cx/authspoof/
  2. click on the button
  3. browser navigates to google.com
  4. wait 3 sec for the authentication popup
  5. Ensure url gets updated and web content hides
  6. press cancel
  7. Ensure web content appears and content is updated

Test 3

  1. visit http://lcamtuf.coredump.cx/authspoof/
  2. click on the button
  3. browser navigates to google.com
  4. wait 3 sec for the authentication popup
  5. Ensure url gets updated and web content hides
  6. press back or click outside the dialog
  7. Ensure web content appears and content is updated

Test 4

  1. visit http://lcamtuf.coredump.cx/authspoof/
  2. click on the button
  3. browser navigates to google.com
  4. wait 3 sec for the authentication popup
  5. Ensure url gets updated and web content hides
  6. Send the app to background
  7. Bring back the app to foreground
  8. Ensure web content is visible and updated like user canceled the popup

Test 5

  1. visit http://lcamtuf.coredump.cx/authspoof/
  2. click on the button
  3. browser navigates to google.com
  4. wait 3 sec for the authentication popup
  5. Ensure url gets updated and web content hides
  6. Send the app to background
  7. press sign in
  8. Ensure web content appears and content is updated

Test 6

  1. visit http://httpbin.org/basic-auth/test/12345
  2. Ensure authentication popup appears
  3. introduce wrong credentials (eg.: fake - fake)
  4. Ensure authentication popup appears again
  5. introduce correct credentials ( test - 12345)
  6. Ensure web content is displayed and popup dismissed

Internal references:

Software Engineering Expectations
Technical Design Template

@cmonfortep cmonfortep marked this pull request as ready for review May 8, 2020 07:06
@subsymbolic
Copy link
Contributor

@cmonfortep thanks for fixing this, I'll review it today.

Copy link
Contributor

@subsymbolic subsymbolic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of small suggestion otherwise this LGTM. Merge when you're ready.

loadUrl(url = "http://example.com", isBrowserShowing = true)
testee.requiresAuthentication(authenticationRequest)

assertEquals("http://example.com", omnibarViewState().omnibarText)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the opposite test (the next one) checks that that the HideWebViewContent command is sent does it make sense to check that the HideWebViewContent command is not sent here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good 👍


override fun onDismiss(dialog: DialogInterface) {
super.onDismiss(dialog)
//if listener is not null, user didn't press any button. We proceed to cancel.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this self documenting? We could add a boolean method called didUserCompleteAuthentication or something similar and that would let us delete this comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I didn't think about that. I like the idea of self documenting 💯

@cmonfortep cmonfortep merged commit b132c4a into develop May 15, 2020
@cmonfortep cmonfortep deleted the feature/cristian/lhf/auth_popup_tab branch May 15, 2020 09:00
@CDRussell CDRussell removed their request for review May 15, 2020 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants