gecko/dom/tests/mochitest/localstorage/test_bug624047.html
Rafael Ávila de Espíndola 7dc8a30f17 Bug 697989 - don't use domstorage-flush-timer test_bug624047.html. r=mak77.
Use a new domstorage-flush-force message for testing calling
FlushAndDeleteTemporaryTables with a 'true' argument. We want to add more
work to profile-before-change and that would interfere with the testing
in dom/tests/mochitest/localstorage/test_bug624047.html.

Also move the NS_DOMSTORAGE_FLUSH_TIMER_OBSERVER define to the .cpp file
since that is the only place it is used and rename it to end in _TOPIC.
2011-11-04 18:27:59 -04:00

65 lines
1.7 KiB
HTML

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>bug 624047</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="interOriginTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<script type="text/javascript">
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
/*
This test does the folliwing:
- loads a page in an iframe that stores a value to localStorage
- sooner then in 5 seconds reloads the page
- now the page later then 5 seconds after load in the first step checks the
value is still present in localStorage (what is expected)
- if not, the bug is still present
*/
function flushTables()
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var storageManager = Components.classes["@mozilla.org/dom/storagemanager;1"]
.getService(Components.interfaces.nsIObserver);
storageManager.observe(null, "domstorage-flush-force", null);
}
function startTest()
{
slaveOrigin = "http://sub2.test2.example.org";
slave = document.getElementById("__test_frame").contentWindow;
flushTables();
slave.location = slaveOrigin + slavePath + "frameBug624047.html";
setTimeout(function() {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
slaveLoadsPending = 1;
slave.location.reload();
}, 2000);
}
function doNextTest()
{
SimpleTest.finish();
}
function doStep()
{
}
SimpleTest.waitForExplicitFinish();
</script>
</head>
<body onload="startTest();">
This test takes about 15s to complete... Please wait...
<br/>
<iframe src="" id="__test_frame"></iframe>
</body>
</html>