WALA/com.ibm.wala.cast.js.test.data/examples-src/pages/crawl.html

197 lines
5.1 KiB
HTML
Executable File

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<script>
var g_image_number = 0;
</script>
<script>
function test_function_base_crawling()
{
var href;
href = "results.html?";
href += "function_base_crawling_";
href += (12*document.location.href.length) ? "worked" : "/strange_behaviour";
document.location.href = href;
}
</script>
<script>
function test_event_element()
{
var href;
href = "results.html?";
href += "event_element_";
if (window.event == undefined) {
href += (12*document.location.href.length) ? "unsupported" : "strange_behaviour";
} else if (!isNaN(window.event.srcElement)) {
href += (12*document.location.href.length) ? "srcElement_unsupported" : "strange_behaviour";
} else if (!isNaN(window.event.srcElement)) {
href += (12*document.location.href.length) ? "srcElement_attr_unsupported" : "strange_behaviour";
} else {
href += (12*document.location.href.length) ? "worked" : "strange_behaviour";
}
document.location.href = href;
}
</script>
<script>
function test_isNaN()
{
var href;
href = "results.html?";
href += "isNaN_";
if (!isNaN(window.asghdaa)) {
href += (12*document.location.href.length) ? "unsupported" : "strange_behaviour";
} else {
href += (12*document.location.href.length) ? "worked" : "strange_behaviour";
}
document.location.href = href;
}
</script>
<script>
function test_first_phase()
{
var href;
href = "results.html?";
href += "first_phase_";
href += (12*document.location.href.length) ? "worked" : "/strange_behaviour";
document.location.href = href;
}
</script>
<script>
function test_second_phase()
{
var button = document.createElement("button");
button.innerText = "go to second phase html";
document.body.appendChild(button);
button.onclick = function () {
var href;
href = "results.html?";
href += "second_phase_";
href += (12*document.location.href.length) ? "worked" : "/strange_behaviour";
document.location.href = href;
};
var thirdButton = document.createElement("button");
thirdButton.innerText = 'Test "Third Phase Competability"';
thirdButton.onclick = test_third_phase;
document.body.appendChild(thirdButton);
}
</script>
<script>
function test_third_phase()
{
var button = document.createElement("button");
button.innerText = "go to third phase html";
document.body.appendChild(button);
button.onclick = function () {
var href;
href = "results.html?";
href += "third_phase_";
href += (12*document.location.href.length) ? "worked" : "/strange_behaviour";
document.location.href = href;
}
}
</script>
<script>
function test_n_phase()
{
var button = document.createElement("button");
button.tag = isNaN(event.srcElement.tag) ? 1 : Number(event.srcElement.tag) + 1;
button.innerText = "go to "+button.tag+" phase html";
button.onclick = function () {
var href;
href = "results.html?";
href += "n_phase_"+button.tag+"_";
href += (12*document.location.href.length) ? "worked" : "/strange_behaviour";
document.location.href = href;
};
var linkButton = document.createElement("button");
linkButton.tag = button.tag;
linkButton.innerText = "create "+linkButton.tag+" phase button";
linkButton.onclick = test_n_phase;
document.body.appendChild(linkButton);
document.body.appendChild(button);
}
</script>
<script>
var differentOrder = "/differnet_order_";
</script>
<script>
function test_both_order2()
{
differentOrder += "2";
test_both_order_button.innerText = 'Test "Different Order Competability 2"';
}
</script>
<script>
function test_both_order()
{
var href;
href = "results.html?";
href += "both_order_";
href += (test_both_order_button.innerText.substr(test_both_order_button.innerText.length-2,1));
href += ".html";
document.location.href = href;
}
</script>
<script>
function send_unique_dom_request()
{
var href;
href = "results.html?";
href += "dom_unique";
href += ".html";
document.location.href = href;
}
</script>
<script>
function send_same_dom_request()
{
var href;
href = "results.html?";
href += "dom_same";
href += ".html";
document.location.href = href;
}
</script>
<script>
function test_unique_dom_button2()
{
test_unique_dom_button.onclick = send_same_dom_request;
}
</script>
<body>
<BR><BR><BR><HR><BR><BR><BR>
<BR><button onclick = "test_event_element()">Test "Event Element"</button>
<BR><button onclick = "test_isNaN()">Test "isNaN Competability"</button>
<BR><button onclick = "test_first_phase()">Test "First Phase Competability"</button>
<BR><button onclick = "test_second_phase()">Test "Second Phase Competability"</button>
<BR><button onclick = "test_n_phase()">Test "N Phase Competability"</button>
<BR><button id=test_both_order_button onclick = "test_both_order()">Test "Different Order Competability 1"</button>
<button onclick = "test_both_order2()">Change Different Order Location</button>
<BR><button onclick = "test_unique_dom_button2()">Change Next element onclick Method</button>
<button id=test_unique_dom_button onclick = "send_unique_dom_request()">Test "Unique Dom Competability"</button>
<BR>
</body>
</html>