| <!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] --> |
| <meta name="viewport" content="initial-scale=5, width=device-width"> |
| <script src="../../resources/ui-helper.js"></script> |
| testRunner.waitUntilDone(); |
| internals.setTransientActivationDuration(0.01); // Use very short 10ms transient activation duration for testing. |
| let write = (message) => output.innerHTML += (message + "<br>"); |
| document.getElementById("target").addEventListener("click", () => { |
| fetch("../files/resources/abe.png").then(() => { |
| // Cause the transient activation to expire with a setTimeout. |
| navigator.share({ title: "Example Page", url: "url", text: "text" }).then((result) => { |
| write("FAIL: Share sheet invoked."); |
| write("PASS: Share promise was rejected: " + exception); |
| write("FAIL: Fetch promise was rejected"); |
| UIHelper.setShareSheetCompletesImmediatelyWithResolution(true).then(() => { |
| UIHelper.activateAt(50, 50); |
| background-color: silver; |
| <body onload="runTest()"> |