Bug 185440 - Add tests to ensure that the Strong Password appearance is removed on form reset
Summary: Add tests to ensure that the Strong Password appearance is removed on form reset
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Daniel Bates
URL:
Keywords: InRadar
Depends on: 185433
Blocks:
  Show dependency treegraph
 
Reported: 2018-05-08 12:01 PDT by Daniel Bates
Modified: 2018-05-08 16:23 PDT (History)
6 users (show)

See Also:


Attachments
Tests (6.01 KB, patch)
2018-05-08 12:04 PDT, Daniel Bates
rniwa: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Bates 2018-05-08 12:01:03 PDT
Add a unit test to ensure that the embedding client is notified when the Strong Password appearance is removed on form reset.
Comment 1 Daniel Bates 2018-05-08 12:02:49 PDT
(In reply to Daniel Bates from comment #0)
> Add a unit test to ensure that the embedding client is notified when the
> Strong Password appearance is removed on form reset.

Actually we should add both a unit test and a layout test.
Comment 2 Daniel Bates 2018-05-08 12:04:12 PDT
Created attachment 339854 [details]
Tests

This patch depends on the refactoring done in the patch for bug #185433.
Comment 3 Ryosuke Niwa 2018-05-08 14:39:58 PDT
Comment on attachment 339854 [details]
Tests

View in context: https://bugs.webkit.org/attachment.cgi?id=339854&action=review

> LayoutTests/fast/forms/auto-fill-button/hide-auto-fill-strong-password-button-when-form-is-reset.html:14
> +    let form = document.querySelector("form");
> +    form.reset();

It seems like we don't need this local variable.
Just do: document.querySelector("form").reset(). Or simply document.forms[0].reset()?
Comment 4 Daniel Bates 2018-05-08 16:18:09 PDT
(In reply to Ryosuke Niwa from comment #3)
> Comment on attachment 339854 [details]
> Tests
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=339854&action=review
> 
> > LayoutTests/fast/forms/auto-fill-button/hide-auto-fill-strong-password-button-when-form-is-reset.html:14
> > +    let form = document.querySelector("form");
> > +    form.reset();
> 
> It seems like we don't need this local variable.
> Just do: document.querySelector("form").reset(). Or simply
> document.forms[0].reset()?

Will fix before landing.
Comment 5 Daniel Bates 2018-05-08 16:19:43 PDT
(In reply to Daniel Bates from comment #4)
> (In reply to Ryosuke Niwa from comment #3)
> > Comment on attachment 339854 [details]
> > Tests
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=339854&action=review
> > 
> > > LayoutTests/fast/forms/auto-fill-button/hide-auto-fill-strong-password-button-when-form-is-reset.html:14
> > > +    let form = document.querySelector("form");
> > > +    form.reset();
> > 
> > It seems like we don't need this local variable.
> > Just do: document.querySelector("form").reset(). Or simply
> > document.forms[0].reset()?
> 
> Will fix before landing.

Will use document.forms[0].reset().
Comment 6 Daniel Bates 2018-05-08 16:22:19 PDT
Committed r231519: <https://trac.webkit.org/changeset/231519>
Comment 7 Radar WebKit Bug Importer 2018-05-08 16:23:19 PDT
<rdar://problem/40075899>