mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset 26f7974bf6ef
This commit is contained in:
parent
f5428e410b
commit
4b7fe56c88
@ -14,10 +14,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="application/javascript"><![CDATA[
|
<script type="application/javascript"><![CDATA[
|
||||||
const Ci = Components.interfaces;
|
|
||||||
const Cc = Components.classes;
|
|
||||||
Components.utils.import("resource://gre/modules/NetUtil.jsm");
|
|
||||||
|
|
||||||
// Define the generator-iterator for the tests.
|
// Define the generator-iterator for the tests.
|
||||||
var tests = testIterator();
|
var tests = testIterator();
|
||||||
|
|
||||||
@ -27,40 +24,18 @@
|
|||||||
function nextTest() {
|
function nextTest() {
|
||||||
tests.next();
|
tests.next();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return the Element object for the specified element id
|
// Return the Element object for the specified element id
|
||||||
function $(id) { return TestWindow.getDocument().getElementById(id); }
|
function $(id) { return TestWindow.getDocument().getElementById(id); }
|
||||||
|
|
||||||
////
|
////
|
||||||
// Generator function for test steps for bug 293235:
|
// Generator function for test steps for bug 293235:
|
||||||
// A visited link should have the :visited style applied
|
// A visited link should have the :visited style applied
|
||||||
// to it when displayed on a page which was fetched from
|
// to it when displayed on a page which was fetched from
|
||||||
// the bfcache.
|
// the bfcache.
|
||||||
//
|
//
|
||||||
function testIterator()
|
function testIterator()
|
||||||
{
|
{
|
||||||
// Register our observer to know when the link lookup is complete.
|
|
||||||
let testURI = NetUtil.newURI(getHttpUrl("bug293235_p2.html"));
|
|
||||||
let os = Cc["@mozilla.org/observer-service;1"].
|
|
||||||
getService(Ci.nsIObserverService);
|
|
||||||
const URI_VISITED_RESOLUTION_TOPIC = "visited-status-resolution";
|
|
||||||
let observer = {
|
|
||||||
notified: false,
|
|
||||||
observe: function(aSubject, aTopic, aData)
|
|
||||||
{
|
|
||||||
if (!testURI.equals(aSubject.QueryInterface(Ci.nsIURI))) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
is(aTopic, URI_VISITED_RESOLUTION_TOPIC, "Unexpected topic");
|
|
||||||
this.notified = true;
|
|
||||||
|
|
||||||
// Cleanup after ourselves...
|
|
||||||
os.removeObserver(this, URI_VISITED_RESOLUTION_TOPIC);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
os.addObserver(observer, URI_VISITED_RESOLUTION_TOPIC, false);
|
|
||||||
function notified() observer.notified;
|
|
||||||
|
|
||||||
// Load a test page containing a link that should be initially
|
// Load a test page containing a link that should be initially
|
||||||
// blue, per the :link style.
|
// blue, per the :link style.
|
||||||
doPageNavigation({
|
doPageNavigation({
|
||||||
@ -68,14 +43,9 @@
|
|||||||
onNavComplete: nextTest
|
onNavComplete: nextTest
|
||||||
});
|
});
|
||||||
yield;
|
yield;
|
||||||
|
|
||||||
// Before we go any further, make sure our link has been notified.
|
is(TestWindow.getWindow().getComputedStyle($("link1"), "").color,
|
||||||
waitForTrue(notified, nextTest);
|
"rgb(0, 0, 128)",
|
||||||
yield;
|
|
||||||
|
|
||||||
// Now that we've been notified, we can check our link color.
|
|
||||||
is(TestWindow.getWindow().getComputedStyle($("link1"), "").color,
|
|
||||||
"rgb(0, 0, 128)",
|
|
||||||
"link not initially blue");
|
"link not initially blue");
|
||||||
|
|
||||||
// Load the page that the link on the previous page points to.
|
// Load the page that the link on the previous page points to.
|
||||||
@ -85,16 +55,6 @@
|
|||||||
});
|
});
|
||||||
yield;
|
yield;
|
||||||
|
|
||||||
// Because of LAZY_ADD, we will not be notified for three seconds
|
|
||||||
// Wait for four seconds just to be safe.
|
|
||||||
setTimeout(nextTest, 4000);
|
|
||||||
yield;
|
|
||||||
|
|
||||||
// And the nodes get notified after the "link-visited" topic, so
|
|
||||||
// we need to execute soon...
|
|
||||||
SimpleTest.executeSoon(nextTest);
|
|
||||||
yield;
|
|
||||||
|
|
||||||
// Go back, verify the original page was loaded from the bfcache,
|
// Go back, verify the original page was loaded from the bfcache,
|
||||||
// and verify that the link is now purple, per the
|
// and verify that the link is now purple, per the
|
||||||
// :visited style.
|
// :visited style.
|
||||||
@ -108,17 +68,16 @@
|
|||||||
});
|
});
|
||||||
yield;
|
yield;
|
||||||
|
|
||||||
// Now we can test the link color.
|
is(TestWindow.getWindow().getComputedStyle($("link1"), "").color,
|
||||||
is(TestWindow.getWindow().getComputedStyle($("link1"), "").color,
|
"rgb(128, 0, 128)",
|
||||||
"rgb(128, 0, 128)",
|
|
||||||
":visited link wrong color");
|
":visited link wrong color");
|
||||||
|
|
||||||
// Tell the framework the test is finished. Include the final 'yield'
|
// Tell the framework the test is finished. Include the final 'yield'
|
||||||
// statement to prevent a StopIteration exception from being thrown.
|
// statement to prevent a StopIteration exception from being thrown.
|
||||||
finish();
|
finish();
|
||||||
yield;
|
yield;
|
||||||
}
|
}
|
||||||
|
|
||||||
]]></script>
|
]]></script>
|
||||||
|
|
||||||
<browser type="content-primary" flex="1" id="content" src="about:blank"/>
|
<browser type="content-primary" flex="1" id="content" src="about:blank"/>
|
||||||
|
Loading…
Reference in New Issue
Block a user