forked from kissyteam/kissy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.php
More file actions
62 lines (53 loc) · 1.62 KB
/
test.php
File metadata and controls
62 lines (53 loc) · 1.62 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
header("Content-Type:text/html; charset=utf-8");
header("Expires:-1");
header("Cache-Control:private, max-age=0, must-revalidate");
?>
<html>
<head>
<script src="../build/kissy.js"></script>
</head>
<h1>KISSY 集成化测试</h1>
<iframe id="test" src=''
scrolling="no"
style="width:100%;height:600px;border:1px solid red;"></iframe>
<script type="text/javascript">
// document.domain='ali.com';
var index = 0;
var tests = [];
var loc = window.location.href.replace(/test.php/, "");
var jasmine = {};
jasmine.kissyNext = function(failedCount) {
if (!failedCount) {
// event hash change ,ie error
index++;
if (tests[index]) {
if ((true || KISSY.UA.ie || KISSY.UA.webkit) && tests[index].match(/event\//)) {
window.open(loc + tests[index] + "?" + (+new Date()));
index++;
}
}
if (tests[index]) {
document.getElementById("test").src = tests[index] + "?" + (+new Date());
}
}
};
<?php
$baseDir = "./";
$fso = opendir($baseDir);
while ($file = readdir($fso)) {
if (is_dir($file) && $file != "." && $file != "..") {
$testfile = $file . "/tests/test.html";
if (file_exists($testfile)) {
echo "tests.push('" . ($testfile) . "');\n";
}
}
}
closedir($fso);
?>
window.onload = function() {
document.getElementById("test").src = tests[0] + "?" + (+new Date());
};
document.writeln(tests.join("<br>"));
</script>
</html>