Bug 196031 - REGRESSION (r243153): [iPhone] TestWebKitAPI.FocusPreservationTests.ChangingFocusedNodeResetsFocusPreservationState is failing
Summary: REGRESSION (r243153): [iPhone] TestWebKitAPI.FocusPreservationTests.ChangingF...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: iPhone / iPad iOS 12
: P2 Normal
Assignee: Daniel Bates
URL:
Keywords: InRadar, PlatformOnly, Regression
Depends on: 195820
Blocks:
  Show dependency treegraph
 
Reported: 2019-03-20 13:56 PDT by Ryan Haddad
Modified: 2019-03-20 15:48 PDT (History)
5 users (show)

See Also:


Attachments
Patch (1.96 KB, patch)
2019-03-20 15:28 PDT, Daniel Bates
thorton: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan Haddad 2019-03-20 13:56:49 PDT
The following API test is failing on iOS bots:

    TestWebKitAPI.FocusPreservationTests.ChangingFocusedNodeResetsFocusPreservationState
        
        /Volumes/Data/slave/ios-simulator-12-release/build/Tools/TestWebKitAPI/Tests/ios/FocusPreservationTests.mm:100
        Value of: [webView stringByEvaluatingJavaScript:@"document.activeElement == document.querySelector('select')"].boolValue
          Actual: true
        Expected: false

https://build.webkit.org/builders/Apple%20iOS%2012%20Simulator%20Release%20WK2%20%28Tests%29/builds/3212/steps/run-api-tests/logs/stdio
Comment 1 Ryan Haddad 2019-03-20 13:57:45 PDT
This appears to have started with:
"[iOS] Focus not preserved when switching between tabs"
https://trac.webkit.org/changeset/243153/webkit

Dan, would you please take a look?
Comment 2 Radar WebKit Bug Importer 2019-03-20 14:13:29 PDT
<rdar://problem/49078172>
Comment 3 Daniel Bates 2019-03-20 14:36:19 PDT
(In reply to Ryan Haddad from comment #0)
> The following API test is failing on iOS bots:
> 
>    
> TestWebKitAPI.FocusPreservationTests.
> ChangingFocusedNodeResetsFocusPreservationState
>         
>        
> /Volumes/Data/slave/ios-simulator-12-release/build/Tools/TestWebKitAPI/Tests/
> ios/FocusPreservationTests.mm:100
>         Value of: [webView
> stringByEvaluatingJavaScript:@"document.activeElement ==
> document.querySelector('select')"].boolValue
>           Actual: true
>         Expected: false
> 
> https://build.webkit.org/builders/
> Apple%20iOS%2012%20Simulator%20Release%20WK2%20%28Tests%29/builds/3212/steps/
> run-api-tests/logs/stdio

Progression. Will update test.
Comment 4 Daniel Bates 2019-03-20 14:47:17 PDT
(In reply to Daniel Bates from comment #3)
> (In reply to Ryan Haddad from comment #0)
> > The following API test is failing on iOS bots:
> > 
> >    
> > TestWebKitAPI.FocusPreservationTests.
> > ChangingFocusedNodeResetsFocusPreservationState
> >         
> >        
> > /Volumes/Data/slave/ios-simulator-12-release/build/Tools/TestWebKitAPI/Tests/
> > ios/FocusPreservationTests.mm:100
> >         Value of: [webView
> > stringByEvaluatingJavaScript:@"document.activeElement ==
> > document.querySelector('select')"].boolValue
> >           Actual: true
> >         Expected: false
> > 
> > https://build.webkit.org/builders/
> > Apple%20iOS%2012%20Simulator%20Release%20WK2%20%28Tests%29/builds/3212/steps/
> > run-api-tests/logs/stdio
> 
> Progression. Will update test.

This would be a progression on iPad, but these tests are run using an iPhone I think so this is a regression.
Comment 5 Daniel Bates 2019-03-20 14:59:47 PDT
Test needs to be updated. It was written with blackbox knowledge of the fact that -[WKWebView resignFirstResponder] is what is called when the <select> picker is dismissed when the Done button is pressed. The test wants to press the Done button, but does it in an indirect way. Need to fix test to do what it actually wants to do.
Comment 6 Daniel Bates 2019-03-20 15:28:38 PDT
Created attachment 365411 [details]
Patch
Comment 7 Daniel Bates 2019-03-20 15:48:11 PDT
Committed r243248: <https://trac.webkit.org/changeset/243248>