blob: 1a703cc6731e8d1f4bbf30bec40ace4d401ad038 [file] [log] [blame]
<!DOCTYPE html><!-- webkit-test-runner [ isAppInitiated=true ] -->
<head>
<script src="../resources/js-test-pre.js"></script>
</head>
<body onload="runTest()">
<script>
description('Ensure web socket loads are attributed correctly.');
window.jsTestIsAsync = true;
if (window.testRunner)
testRunner.setAllowsAnySSLCertificate(true);
function log(message)
{
document.getElementById('console').appendChild(document.createTextNode(message + '\n'));
}
function askForAttribution() {
var didLoadAppBoundRequest = testRunner.didLoadAppInitiatedRequest();
var didLoadNonAppBoundRequest = testRunner.didLoadNonAppInitiatedRequest();
if (didLoadNonAppBoundRequest) {
log("FAIL did load non app initiated request");
finishJSTest();
return;
}
if (!didLoadAppBoundRequest) {
log("FAIL did not load app initiated request");
finishJSTest();
return;
}
log("PASS successfully loaded only app initiated requests");
finishJSTest();
}
function runTest() {
new WebSocket('ws://localhost:8880/websocket/tests/hybi/simple');
setTimeout(askForAttribution, 0);
}
</script>
<script src="../resources/js-test-post.js"></script>
</body>