| <!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] --> |
| <html lang="en"> |
| <head> |
| <meta charset="UTF-8"> |
| <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> |
| <script src="/js-test-resources/ui-helper.js"></script> |
| <script src="resources/util.js"></script> |
| </head> |
| <body onload="setTimeout(runTest, 0)"> |
| <div id="description">Tests that storage of ad click attribution is disabled in ephemeral sessions.</div> |
| <a id="targetLink" href="http://localhost:8000/adClickAttribution/store-disabled-in-ephemeral-session.html?stepTwo" adcampaignid="3" addestination="http://localhost:8000">Link</a><br> |
| <div id="output"></div> |
| <script> |
| prepareTest(); |
| |
| if (window.testRunner) |
| testRunner.setPrivateBrowsingEnabled(true); |
| |
| function activateElement(elementID) { |
| var element = document.getElementById(elementID); |
| var centerX = element.offsetLeft + element.offsetWidth / 2; |
| var centerY = element.offsetTop + element.offsetHeight / 2; |
| UIHelper.activateAt(centerX, centerY).then( |
| function () { |
| }, |
| function () { |
| document.getElementById("output").innerText = "FAIL Promise rejected."; |
| tearDownAndFinish(); |
| } |
| ); |
| } |
| |
| function runTest() { |
| if (window.testRunner) { |
| if (window.location.search === "?stepTwo") { |
| testRunner.dumpAdClickAttribution(); |
| document.body.removeChild(document.getElementById("targetLink")); |
| tearDownAndFinish(); |
| } else { |
| activateElement("targetLink"); |
| } |
| } else { |
| document.getElementById("output").innerText = "FAIL No testRunner."; |
| } |
| } |
| </script> |
| </body> |
| </html> |