| <!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 storage of private click measurement.</div> |
| <a id="targetLink" href="http://localhost:8000/privateClickMeasurement/store-private-click-measurement.html?stepTwo" attributionsourceid=3 attributiondestination="http://localhost:8000">Link</a><br> |
| <div id="output"></div> |
| <script> |
| prepareTest(); |
| |
| 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.dumpPrivateClickMeasurement(); |
| document.body.removeChild(document.getElementById("targetLink")); |
| tearDownAndFinish(); |
| } else { |
| activateElement("targetLink"); |
| } |
| } else { |
| document.getElementById("output").innerText = "FAIL No testRunner."; |
| } |
| } |
| </script> |
| </body> |
| </html> |