Bug 752319 - Use testharness.js for the cross-origin localStorage tests; r=mayhemer

This commit is contained in:
Ms2ger 2012-05-18 10:29:38 +02:00
parent b1c83bd74f
commit a16e8f4659
8 changed files with 25 additions and 38 deletions

View File

@ -1,3 +1,5 @@
var t = async_test(document.title);
var frameLoadsPending = 2; var frameLoadsPending = 2;
var callMasterFrame = true; var callMasterFrame = true;
@ -7,7 +9,6 @@ var masterFrameOrigin = "";
var slaveFrameOrigin = ""; var slaveFrameOrigin = "";
var failureRegExp = new RegExp("^FAILURE"); var failureRegExp = new RegExp("^FAILURE");
var todoRegExp = new RegExp("^TODO");
const framePath = "/tests/dom/tests/mochitest/localstorage/"; const framePath = "/tests/dom/tests/mochitest/localstorage/";
@ -39,15 +40,14 @@ function onMessageReceived(event)
break; break;
testDone = true; testDone = true;
SimpleTest.finish(); t.done();
break; break;
// Any other message indicates error, succes or todo message of a test // Any other message indicates error, succes or todo message of a test
default: default:
if (event.data.match(todoRegExp)) t.step(function() {
SimpleTest.todo(false, event.data); assert_true(!event.data.match(failureRegExp), event.data);
else });
SimpleTest.ok(!event.data.match(failureRegExp), event.data);
break; break;
} }
} }

View File

@ -2,9 +2,9 @@
<head> <head>
<title>localStorage equal origins</title> <title>localStorage equal origins</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> <script src="/resources/testharness.js"></script>
<script type="text/javascript" src="interOriginTest2.js"></script> <script src="/resources/testharnessreport.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> <script src="interOriginTest2.js"></script>
<!-- <!--
This test loads two frames from the same origin, clears in one frame, This test loads two frames from the same origin, clears in one frame,
@ -22,8 +22,6 @@ function startTest()
slaveFrame.location = slaveFrameOrigin + framePath + "frameKeySync.html?2"; slaveFrame.location = slaveFrameOrigin + framePath + "frameKeySync.html?2";
} }
SimpleTest.waitForExplicitFinish();
</script> </script>
</head> </head>

View File

@ -2,9 +2,9 @@
<head> <head>
<title>localStorage different origins</title> <title>localStorage different origins</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> <script src="/resources/testharness.js"></script>
<script type="text/javascript" src="interOriginTest2.js"></script> <script src="/resources/testharnessreport.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> <script src="interOriginTest2.js"></script>
<!-- <!--
This test loads two frames from different This test loads two frames from different
@ -30,8 +30,6 @@ function startTest()
slaveFrame.location = slaveFrameOrigin + framePath + "frameSlaveNotEqual.html"; slaveFrame.location = slaveFrameOrigin + framePath + "frameSlaveNotEqual.html";
} }
SimpleTest.waitForExplicitFinish();
</script> </script>
</head> </head>

View File

@ -2,9 +2,9 @@
<head> <head>
<title>localStorage different domains</title> <title>localStorage different domains</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> <script src="/resources/testharness.js"></script>
<script type="text/javascript" src="interOriginTest2.js"></script> <script src="/resources/testharnessreport.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> <script src="interOriginTest2.js"></script>
<!-- <!--
This test loads two frames from different This test loads two frames from different
@ -30,8 +30,6 @@ function startTest()
slaveFrame.location = slaveFrameOrigin + framePath + "frameSlaveNotEqual.html"; slaveFrame.location = slaveFrameOrigin + framePath + "frameSlaveNotEqual.html";
} }
SimpleTest.waitForExplicitFinish();
</script> </script>
</head> </head>

View File

@ -2,9 +2,9 @@
<head> <head>
<title>localStorage equal origins</title> <title>localStorage equal origins</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> <script src="/resources/testharness.js"></script>
<script type="text/javascript" src="interOriginTest2.js"></script> <script src="/resources/testharnessreport.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> <script src="interOriginTest2.js"></script>
<!-- <!--
This test loads two frames from equal This test loads two frames from equal
@ -31,8 +31,6 @@ function startTest()
slaveFrame.location = slaveFrameOrigin + framePath + "frameSlaveEqual.html"; slaveFrame.location = slaveFrameOrigin + framePath + "frameSlaveEqual.html";
} }
SimpleTest.waitForExplicitFinish();
</script> </script>
</head> </head>

View File

@ -2,9 +2,9 @@
<head> <head>
<title>localStorage different port numbers</title> <title>localStorage different port numbers</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> <script src="/resources/testharness.js"></script>
<script type="text/javascript" src="interOriginTest2.js"></script> <script src="/resources/testharnessreport.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> <script src="interOriginTest2.js"></script>
<!-- <!--
This test loads two frames from different This test loads two frames from different
@ -30,8 +30,6 @@ function startTest()
slaveFrame.location = slaveFrameOrigin + framePath + "frameSlaveNotEqual.html"; slaveFrame.location = slaveFrameOrigin + framePath + "frameSlaveNotEqual.html";
} }
SimpleTest.waitForExplicitFinish();
</script> </script>
</head> </head>

View File

@ -2,9 +2,9 @@
<head> <head>
<title>localStorage different domains</title> <title>localStorage different domains</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> <script src="/resources/testharness.js"></script>
<script type="text/javascript" src="interOriginTest2.js"></script> <script src="/resources/testharnessreport.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> <script src="interOriginTest2.js"></script>
<!-- <!--
This test loads two frames from different This test loads two frames from different
@ -30,8 +30,6 @@ function startTest()
slaveFrame.location = slaveFrameOrigin + framePath + "frameSlaveNotEqual.html"; slaveFrame.location = slaveFrameOrigin + framePath + "frameSlaveNotEqual.html";
} }
SimpleTest.waitForExplicitFinish();
</script> </script>
</head> </head>

View File

@ -1,9 +1,8 @@
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<title>localStorage different port numbers</title> <title>Storage interface</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="interOriginTest2.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<script type="text/javascript"> <script type="text/javascript">