[WebAuthN] Polish WebAuthN auto-test environment
authorjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 29 Sep 2018 00:02:39 +0000 (00:02 +0000)
committerjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 29 Sep 2018 00:02:39 +0000 (00:02 +0000)
commitd9e2e8b2092c0463a15a98e7e9b299fbe5d2f707
tree8a2a7073da5d25c232cd627e88bb6f2f46950610
parentb65a8ea7c37fcc9e4b835b7e4140c72a6bb279ac
[WebAuthN] Polish WebAuthN auto-test environment
https://bugs.webkit.org/show_bug.cgi?id=189283
<rdar://problem/44117828>

Reviewed by Chris Dumez.

Source/WebCore:

This patch removes the old mocking mechanism.

Tests: http/wpt/webauthn/public-key-credential-create-with-invalid-parameters.https.html
       http/wpt/webauthn/public-key-credential-get-with-invalid-parameters.https.html
       http/wpt/webauthn/public-key-credential-same-origin-with-ancestors.https.html

* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* testing/Internals.cpp:
(WebCore::Internals::Internals):
(WebCore::Internals::mockAuthenticatorCoordinator const): Deleted.
* testing/Internals.h:
* testing/Internals.idl:
* testing/MockAuthenticatorCoordinator.cpp: Removed.
* testing/MockAuthenticatorCoordinator.h: Removed.
* testing/MockAuthenticatorCoordinator.idl: Removed.

Source/WebKit:

This patch changes MockWebAuthenticationConfiguration.local to optional such that tests can express
absence of local authenticators.

* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
* UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:
(WebKit::MockLocalConnection::getUserConsent const):
(WebKit::MockLocalConnection::getAttestation const):
* UIProcess/WebAuthentication/Mock/MockLocalService.cpp:
(WebKit::MockLocalService::platformStartDiscovery const):
* UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h:

Tools:

* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setWebAuthenticationMockConfiguration):

LayoutTests:

This patch does the following few things:
1. Update tests that employ old mocking mechnism to the new one.
2. Move tests from http/tests/webauthn to http/wpt/webauthn. As a result, we have one unified place for
all WebAuthN tests: http/wpt/webauthn.
3. Add a helper function to check DOMException message as well.

* TestExpectations:
* http/tests/webauthn/public-key-credential-create-with-invalid-parameters.https-expected.txt: Removed.
* http/tests/webauthn/public-key-credential-get-with-invalid-parameters.https-expected.txt: Removed.
* http/tests/webauthn/public-key-credential-same-origin-with-ancestors-2.https-expected.txt: Removed.
* http/tests/webauthn/public-key-credential-same-origin-with-ancestors-2.https.html: Removed.
* http/tests/webauthn/public-key-credential-same-origin-with-ancestors.https-expected.txt: Removed.
* http/tests/webauthn/public-key-credential-same-origin-with-ancestors.https.html: Removed.
* http/tests/webauthn/resources/last-layer-frame.https.html: Removed.
* http/tests/webauthn/resources/util.js: Removed.
* http/wpt/credential-management/credentialscontainer-store-basics.https.html:
* http/wpt/webauthn/idl.https.html:
* http/wpt/webauthn/public-key-credential-create-failure-local.https.html:
* http/wpt/webauthn/public-key-credential-create-failure.https-expected.txt:
* http/wpt/webauthn/public-key-credential-create-failure.https.html:
* http/wpt/webauthn/public-key-credential-create-success.https-expected.txt: Removed.
* http/wpt/webauthn/public-key-credential-create-success.https.html: Removed.
* http/wpt/webauthn/public-key-credential-create-with-invalid-parameters.https-expected.txt: Added.
* http/wpt/webauthn/public-key-credential-create-with-invalid-parameters.https.html: Renamed from LayoutTests/http/tests/webauthn/public-key-credential-create-with-invalid-parameters.https.html.
* http/wpt/webauthn/public-key-credential-get-failure-local.https.html:
* http/wpt/webauthn/public-key-credential-get-failure.https-expected.txt:
* http/wpt/webauthn/public-key-credential-get-failure.https.html:
* http/wpt/webauthn/public-key-credential-get-success.https-expected.txt: Removed.
* http/wpt/webauthn/public-key-credential-get-success.https.html: Removed.
* http/wpt/webauthn/public-key-credential-get-with-invalid-parameters.https-expected.txt: Added.
* http/wpt/webauthn/public-key-credential-get-with-invalid-parameters.https.html: Renamed from LayoutTests/http/tests/webauthn/public-key-credential-get-with-invalid-parameters.https.html.
* http/wpt/webauthn/public-key-credential-same-origin-with-ancestors.https-expected.txt: Added.
* http/wpt/webauthn/public-key-credential-same-origin-with-ancestors.https.html: Added.
* http/wpt/webauthn/resources/last-layer-frame.https.html: Added.
* http/wpt/webauthn/resources/second-layer-frame.https.html: Renamed from LayoutTests/http/tests/webauthn/resources/second-layer-frame.https.html.
* http/wpt/webauthn/resources/util.js:
* platform/gtk/TestExpectations:
* platform/ios-wk1/TestExpectations:
* platform/mac-wk1/TestExpectations:
* platform/mac-wk2/TestExpectations:
* platform/win/TestExpectations:
* platform/wincairo/TestExpectations:
* platform/wpe/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236625 268f45cc-cd09-0410-ab3c-d52691b4dbfc
54 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/http/tests/webauthn/public-key-credential-create-with-invalid-parameters.https-expected.txt [deleted file]
LayoutTests/http/tests/webauthn/public-key-credential-get-with-invalid-parameters.https-expected.txt [deleted file]
LayoutTests/http/tests/webauthn/public-key-credential-same-origin-with-ancestors-2.https-expected.txt [deleted file]
LayoutTests/http/tests/webauthn/public-key-credential-same-origin-with-ancestors-2.https.html [deleted file]
LayoutTests/http/tests/webauthn/public-key-credential-same-origin-with-ancestors.https-expected.txt [deleted file]
LayoutTests/http/tests/webauthn/public-key-credential-same-origin-with-ancestors.https.html [deleted file]
LayoutTests/http/tests/webauthn/resources/last-layer-frame.https.html [deleted file]
LayoutTests/http/tests/webauthn/resources/util.js [deleted file]
LayoutTests/http/wpt/credential-management/credentialscontainer-store-basics.https.html
LayoutTests/http/wpt/webauthn/idl.https.html
LayoutTests/http/wpt/webauthn/public-key-credential-create-failure-local.https.html
LayoutTests/http/wpt/webauthn/public-key-credential-create-failure.https-expected.txt
LayoutTests/http/wpt/webauthn/public-key-credential-create-failure.https.html
LayoutTests/http/wpt/webauthn/public-key-credential-create-success.https-expected.txt [deleted file]
LayoutTests/http/wpt/webauthn/public-key-credential-create-success.https.html [deleted file]
LayoutTests/http/wpt/webauthn/public-key-credential-create-with-invalid-parameters.https-expected.txt [new file with mode: 0644]
LayoutTests/http/wpt/webauthn/public-key-credential-create-with-invalid-parameters.https.html [moved from LayoutTests/http/tests/webauthn/public-key-credential-create-with-invalid-parameters.https.html with 91% similarity]
LayoutTests/http/wpt/webauthn/public-key-credential-get-failure-local.https.html
LayoutTests/http/wpt/webauthn/public-key-credential-get-failure.https-expected.txt
LayoutTests/http/wpt/webauthn/public-key-credential-get-failure.https.html
LayoutTests/http/wpt/webauthn/public-key-credential-get-success.https-expected.txt [deleted file]
LayoutTests/http/wpt/webauthn/public-key-credential-get-success.https.html [deleted file]
LayoutTests/http/wpt/webauthn/public-key-credential-get-with-invalid-parameters.https-expected.txt [new file with mode: 0644]
LayoutTests/http/wpt/webauthn/public-key-credential-get-with-invalid-parameters.https.html [moved from LayoutTests/http/tests/webauthn/public-key-credential-get-with-invalid-parameters.https.html with 82% similarity]
LayoutTests/http/wpt/webauthn/public-key-credential-same-origin-with-ancestors.https-expected.txt [new file with mode: 0644]
LayoutTests/http/wpt/webauthn/public-key-credential-same-origin-with-ancestors.https.html [new file with mode: 0644]
LayoutTests/http/wpt/webauthn/resources/last-layer-frame.https.html [new file with mode: 0644]
LayoutTests/http/wpt/webauthn/resources/second-layer-frame.https.html [moved from LayoutTests/http/tests/webauthn/resources/second-layer-frame.https.html with 100% similarity]
LayoutTests/http/wpt/webauthn/resources/util.js
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/ios-wk1/TestExpectations
LayoutTests/platform/mac-wk1/TestExpectations
LayoutTests/platform/mac-wk2/TestExpectations
LayoutTests/platform/win/TestExpectations
LayoutTests/platform/wincairo/TestExpectations
LayoutTests/platform/wpe/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.make
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl
Source/WebCore/testing/MockAuthenticatorCoordinator.cpp [deleted file]
Source/WebCore/testing/MockAuthenticatorCoordinator.h [deleted file]
Source/WebCore/testing/MockAuthenticatorCoordinator.idl [deleted file]
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp
Source/WebKit/UIProcess/WebAuthentication/Mock/MockLocalConnection.mm
Source/WebKit/UIProcess/WebAuthentication/Mock/MockLocalService.cpp
Source/WebKit/UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp