forked from WebKit/WebKit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgeturl-replace-query.html
36 lines (31 loc) · 1.04 KB
/
geturl-replace-query.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<html>
<body>
<embed name="plg" type="application/x-webkit-test-netscape"></embed>
<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=7656">bug 7656<a/>:
Query string always appended to Flash URLs, instead of being replaced</p>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
try {
loc = window.location.href;
if (loc.indexOf('?') == -1) {
window.location.href = loc + "?1";
} else {
if (loc.substring(loc.indexOf('?'), loc.length) == "?1") {
plg.getURL("?2", "_self");
} else {
query = loc.substring(loc.indexOf('?'), loc.length);
document.write(query == "?2" ?
"SUCCESS" : "FAILURE: " + query);
if (window.testRunner)
testRunner.notifyDone();
}
}
} catch (ex) {
alert("Exception: " + ex.description);
}
</script>
</body>
</html>