Added async performance test

This commit is contained in:
Shing Lyu 2017-01-11 10:20:47 +08:00
parent 363f590019
commit 7aa3350d45
9 changed files with 122 additions and 17 deletions

View file

@ -0,0 +1,3 @@
http://localhost:8000/page_load_test/example/example_sync.html
async http://localhost:8000/page_load_test/example/example_async.html

View file

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title></title>
</head>
<body>
Hello World
<!-- Remember to include the /harness/harness.js file
for the mark() and done() function -->
<script src="/harness/harness.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
// Create a timestamp before the test
mark("test start");
// Do something slow here
// Create another timestamp after the test
mark("test end");
// Tell the test harness you're done, otherwise it will keep waiting
done();
</script>
</body>
</html>

View file

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title></title>
</head>
<body>
Hello World
<!-- window.performance.timing are recorded.
Window closes after onLoad event triggered -->
</body>
</html>