haikuwebkit/LayoutTests/contact-picker/contacts-interfaces-expecte...

22 lines
1.1 KiB
Plaintext
Raw Permalink Normal View History

[Contact Picker API] Introduce bindings for the Contact Picker API https://bugs.webkit.org/show_bug.cgi?id=216793 <rdar://problem/69317957> Reviewed by Wenson Hsieh. Source/WebCore: Added IDL for the Contact Picker API, with the exception of the address and icon contact properties (which will be added after an initial implemention is complete). See: https://wicg.github.io/contact-api/spec/ for more information. Test: contact-picker/contacts-interfaces.html * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/contact-picker/ContactInfo.h: Added. * Modules/contact-picker/ContactInfo.idl: Added. * Modules/contact-picker/ContactProperty.h: Added. * Modules/contact-picker/ContactProperty.idl: Added. * Modules/contact-picker/ContactsManager.cpp: Added. (WebCore::ContactsManager::create): (WebCore::ContactsManager::ContactsManager): (WebCore::ContactsManager::navigator): (WebCore::ContactsManager::getProperties): (WebCore::ContactsManager::select): Stub out these API calls for now by immediately rejecting the given promise. * Modules/contact-picker/ContactsManager.h: Added. * Modules/contact-picker/ContactsManager.idl: Added. * Modules/contact-picker/ContactsSelectOptions.h: Added. * Modules/contact-picker/ContactsSelectOptions.idl: Added. * Modules/contact-picker/NavigatorContacts.cpp: Added. (WebCore::NavigatorContacts::NavigatorContacts): (WebCore::NavigatorContacts::contacts): (WebCore::NavigatorContacts::from): (WebCore::NavigatorContacts::supplementName): * Modules/contact-picker/NavigatorContacts.h: Added. * Modules/contact-picker/Navigator+Contacts.idl: Added. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: * page/Settings.yaml: Source/WebKit: Added a new experimental feature flag. See WebCore Changelog for more details. * Shared/WebPreferencesExperimental.yaml: Source/WebKitLegacy/mac: Added plumbing to support the associated experimental test option. * WebView/WebPreferenceKeysPrivate.h: * WebView/WebPreferences.mm: (-[WebPreferences contactPickerAPIEnabled]): (-[WebPreferences setContactPickerAPIEnabled:]): * WebView/WebPreferencesPrivate.h: Source/WebKitLegacy/win: Added plumbing to support the associated experimental test option. * Interfaces/IWebPreferencesPrivate.idl: * WebPreferenceKeysPrivate.h: * WebPreferences.cpp: (WebPreferences::initializeDefaultSettings): (WebPreferences::contactPickerAPIEnabled): (WebPreferences::setContactPickerAPIEnabled): * WebPreferences.h: * WebView.cpp: (WebView::notifyPreferencesChanged): Source/WTF: * Scripts/Preferences/WebPreferencesExperimental.yaml: Add experimental preference for the Contact Picker API. Tools: Added plumbing to support the associated experimental test option. * DumpRenderTree/TestOptions.cpp: (TestOptions::TestOptions): * DumpRenderTree/TestOptions.h: * DumpRenderTree/mac/DumpRenderTree.mm: (setWebPreferencesForTestOptions): * DumpRenderTree/win/DumpRenderTree.cpp: (setWebPreferencesForTestOptions): LayoutTests: * contact-picker/contacts-interfaces-expected.txt: Added. * contact-picker/contacts-interfaces.html: Added. Added a new test to verify the new API interfaces. * fast/dom/navigator-detached-no-crash-expected.txt: * platform/gtk/fast/dom/navigator-detached-no-crash-expected.txt: * platform/mac-wk2/fast/dom/navigator-detached-no-crash-expected.txt: * platform/mac/fast/dom/navigator-detached-no-crash-expected.txt: * platform/win/fast/dom/navigator-detached-no-crash-expected.txt: * platform/wincairo/fast/dom/navigator-detached-no-crash-expected.txt: * platform/wpe/fast/dom/navigator-detached-no-crash-expected.txt: Updated an existing test to include "navigator.contacts". Canonical link: https://commits.webkit.org/230095@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267988 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-10-05 18:56:12 +00:00
Tests the interfaces of the Contact Picker API, which include ContactsManager and extensions to Navigator.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS ContactsManager instanceof Function is true
PASS typeof ContactsManager is "function"
PASS navigator.contacts instanceof ContactsManager is true
PASS Object.getPrototypeOf(navigator.contacts) === ContactsManager.prototype is true
PASS ContactsManager.prototype.getProperties instanceof Function is true
PASS ContactsManager.prototype.select instanceof Function is true
PASS ContactsManager() threw exception TypeError: Illegal constructor.
PASS new ContactsManager() threw exception TypeError: Illegal constructor.
PASS ContactsManager.toString() is "function ContactsManager() {\n [native code]\n}"
PASS navigator.contacts.toString() is "[object ContactsManager]"
PASS navigator.contacts.getProperties() instanceof Promise is true
PASS navigator.contacts.select(['name', 'email'], {multiple: true}) instanceof Promise is true
PASS successfullyParsed is true
TEST COMPLETE