| <!DOCTYPE html><!-- webkit-test-runner [ BroadcastChannelOriginPartitioningEnabled=true ] --> |
| <html> |
| <body> |
| <script src="/js-test-resources/js-test.js"></script> |
| <script> |
| description("Tests that BroadcastChannel's origin partitioning can be relaxed via requestStorageAccess()"); |
| jsTestIsAsync = true; |
| |
| let bc = new BroadcastChannel("broadcastchannel-partitioning-with-storage-access"); |
| |
| let gotMessageFromSameOriginIframeUnderCrossOriginPopup = false; |
| bc.onmessage = (message) => { |
| if (message.data == "same-origin-iframe-under-cross-origin-popup-with-storage-access") { |
| testPassed("Received message from same-origin iframe with storage access under cross-origin popup"); |
| shouldBeFalse("gotMessageFromSameOriginIframeUnderCrossOriginPopup"); |
| gotMessageFromSameOriginIframeUnderCrossOriginPopup = true; |
| } else { |
| testFailed("Received unexpected message: " + message.data); |
| } |
| |
| if (gotMessageFromSameOriginIframeUnderCrossOriginPopup) |
| setTimeout(finishJSTest, 1000); |
| }; |
| |
| onload = () => { |
| open("http://localhost:8000/messaging/resources/broadcastchannel-partitioning-with-storage-access-popup.html"); |
| }; |
| </script> |
| </body> |
| </html> |