haikuwebkit/LayoutTests/resources/window-postmessage-open-clo...

10 lines
221 B
HTML
Raw Permalink Normal View History

Add initial support for navigator.sendBeacon https://bugs.webkit.org/show_bug.cgi?id=175007 <rdar://problem/33547728> Reviewed by Sam Weinig. LayoutTests/imported/w3c: Import more beacon web-platform-tests and rebaseline the one we had already imported now that navigator.sendBeacon is exposed. * resources/import-expectations.json: * resources/resource-files.json: * web-platform-tests/beacon/beacon-basic-blob-expected.txt: Added. * web-platform-tests/beacon/beacon-basic-blob.html: Added. * web-platform-tests/beacon/beacon-basic-blobMax-expected.txt: Added. * web-platform-tests/beacon/beacon-basic-blobMax.html: Added. * web-platform-tests/beacon/beacon-basic-buffersource-expected.txt: Added. * web-platform-tests/beacon/beacon-basic-buffersource.html: Added. * web-platform-tests/beacon/beacon-basic-buffersourceMax-expected.txt: Added. * web-platform-tests/beacon/beacon-basic-buffersourceMax.html: Added. * web-platform-tests/beacon/beacon-basic-formdata-expected.txt: Added. * web-platform-tests/beacon/beacon-basic-formdata.html: Added. * web-platform-tests/beacon/beacon-basic-formdataMax-expected.txt: Added. * web-platform-tests/beacon/beacon-basic-formdataMax.html: Added. * web-platform-tests/beacon/beacon-basic-string-expected.txt: Added. * web-platform-tests/beacon/beacon-basic-string.html: Added. * web-platform-tests/beacon/beacon-basic-stringMax-expected.txt: Added. * web-platform-tests/beacon/beacon-basic-stringMax.html: Added. * web-platform-tests/beacon/beacon-common.js: Added. (allTests.forEach): (CreateArrayBufferFromPayload): (CreateEmptyFormDataPayload): (CreateFormDataFromPayload): (initSession.return.add): (initSession): (runTests.): (runTests): (continueAfterSendingBeacon): (waitForResults.): (waitForResults): (runSendInIframeAndNavigateTests.self.buildId): (runSendInIframeAndNavigateTests.window.onmessage): (runSendInIframeAndNavigateTests.self.sendFunc): (runSendInIframeAndNavigateTests.iframe.onload): * web-platform-tests/beacon/beacon-cors.window.js: Added. (false.forEach.self.buildId): (false.forEach.self.buildBaseUrl): (false.forEach.self.buildTargetUrl): (false.forEach): * web-platform-tests/beacon/beacon-error.window.js: Added. (test): * web-platform-tests/beacon/beacon-redirect.window.js: Added. (308.forEach.self.buildId): (308.forEach.self.buildTargetUrl): (308.forEach): * web-platform-tests/beacon/fetch-keepalive-navigate.iFrame.html: Added. * web-platform-tests/beacon/headers/header-content-type-expected.txt: * web-platform-tests/beacon/headers/header-referrer-no-referrer-expected.txt: * web-platform-tests/beacon/headers/header-referrer-no-referrer-when-downgrade.https-expected.txt: * web-platform-tests/beacon/headers/header-referrer-origin-expected.txt: * web-platform-tests/beacon/headers/header-referrer-origin-when-cross-origin-expected.txt: * web-platform-tests/beacon/headers/header-referrer-same-origin-expected.txt: * web-platform-tests/beacon/headers/header-referrer-strict-origin-when-cross-origin.https-expected.txt: * web-platform-tests/beacon/headers/header-referrer-strict-origin.https-expected.txt: * web-platform-tests/beacon/headers/header-referrer-unsafe-url.https-expected.txt: * web-platform-tests/beacon/resources/beacon.py: Added. (build_stash_key): (main): (main.wrap_key): * web-platform-tests/beacon/resources/w3c-import.log: * web-platform-tests/beacon/w3c-import.log: Added. * web-platform-tests/url/failure-expected.txt: Source/WebCore: Add initial support for navigator.sendBeacon behind an experimental feature runtime flag. The specification is available at: - https://w3c.github.io/beacon/ The current implementation supports sending beacons with all types of payloads except for ReadableStream. Some functionality is incomplete and will be taken care of in follow-up patches: - Support for CORS preflight for the cases where it is required. We currently return false and do not send the beacon in such cases. - Better support for redirects. - Use a more power-friendly network priority for beacon requests. Tests: http/tests/blink/sendbeacon/* http/tests/security/mixedContent/beacon/insecure-beacon-in-iframe.html http/wpt/beacon/* imported/blink/fast/beacon/* imported/w3c/web-platform-tests/beacon/* * CMakeLists.txt: * DerivedSources.make: * Modules/beacon/NavigatorBeacon.cpp: Added. (WebCore::NavigatorBeacon::sendBeacon): * Modules/beacon/NavigatorBeacon.h: Added. * Modules/beacon/NavigatorBeacon.idl: Added. * WebCore.xcodeproj/project.pbxproj: * loader/PingLoader.cpp: (WebCore::PingLoader::sendBeacon): * loader/PingLoader.h: Source/WebKit: Add experimental feature flag for the Beacon API, disabled by default. * Shared/WebPreferencesDefinitions.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Source/WebKitLegacy/mac: Add setting to toggle support for the Beacon API (it is disabled by default). * WebView/WebPreferenceKeysPrivate.h: * WebView/WebPreferences.mm: (+[WebPreferences initialize]): (-[WebPreferences beaconAPIEnabled]): (-[WebPreferences setBeaconAPIEnabled:]): * WebView/WebPreferencesPrivate.h: * WebView/WebView.mm: (-[WebView _preferencesChanged:]): Tools: Enable the Beacon API at runtime in the context of layout tests since the feature is currently disabled by default. * DumpRenderTree/mac/DumpRenderTree.mm: (enableExperimentalFeatures): * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: (WTR::InjectedBundle::beginTesting): * WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::setModernMediaControlsEnabled): (WTR::TestRunner::setBeaconAPIEnabled): * WebKitTestRunner/InjectedBundle/TestRunner.h: LayoutTests: * fast/dom/navigator-detached-no-crash-expected.txt: Rebaseline test now that sendBeacon is exposed on navigator. * http/tests/blink/sendbeacon/beacon-cookie-expected.txt: Added. * http/tests/blink/sendbeacon/beacon-cookie.html: Added. * http/tests/blink/sendbeacon/beacon-cross-origin-expected.txt: Added. * http/tests/blink/sendbeacon/beacon-cross-origin-redirect-blob-expected.txt: Added. * http/tests/blink/sendbeacon/beacon-cross-origin-redirect-blob.html: Added. * http/tests/blink/sendbeacon/beacon-cross-origin-redirect-expected.txt: Added. * http/tests/blink/sendbeacon/beacon-cross-origin-redirect.html: Added. * http/tests/blink/sendbeacon/beacon-cross-origin.html: Added. * http/tests/blink/sendbeacon/beacon-cross-origin.https-expected.txt: Added. * http/tests/blink/sendbeacon/beacon-cross-origin.https.html: Added. * http/tests/blink/sendbeacon/beacon-detached-no-crash-expected.txt: Added. * http/tests/blink/sendbeacon/beacon-detached-no-crash.html: Added. * http/tests/blink/sendbeacon/beacon-same-origin-expected.txt: Added. * http/tests/blink/sendbeacon/beacon-same-origin.html: Added. * http/tests/blink/sendbeacon/connect-src-beacon-allowed-expected.txt: Added. * http/tests/blink/sendbeacon/connect-src-beacon-allowed.html: Added. * http/tests/blink/sendbeacon/resources/check-beacon.php: Added. * http/tests/blink/sendbeacon/resources/save-beacon.php: Added. Import more beacon test coverage from Blink. * http/wpt/beacon/connect-src-beacon-blocked.sub-expected.txt: Added. * http/wpt/beacon/connect-src-beacon-blocked.sub.html: Added. Improve test coverage for sendBeacon and CSP. * http/wpt/beacon/headers/header-content-type-same-origin-expected.txt: Added. * http/wpt/beacon/headers/header-content-type-same-origin.html: Added. Improve test coverage for sendBeacon with various types of payload. The test is done using same origin as we do not currently support sending some of those payloads cross origin yet. * imported/blink/fast/beacon/beacon-basic-expected.txt: Added. * imported/blink/fast/beacon/beacon-basic.html: Added. Import basic Beacon test coverage from Blink. * resources/window-postmessage-open-close.html: Added. * tests-options.json: Canonical link: https://commits.webkit.org/191828@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220121 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-08-02 04:44:23 +00:00
<!DOCTYPE html>
<!-- Used when testing access of a closed/detached window's properties -->
<html>
<body onunload="opener.postMessage('closed', '*');">
<script>
opener.postMessage("opened", "*");
</script>
</body>
</html>