Bug 559998. Add some debug output to diagnose random orange.

This commit is contained in:
Timothy Nikkel 2010-04-29 20:15:44 -05:00
Родитель eeea9e8083
Коммит ffe465e1c5
1 изменённых файлов: 20 добавлений и 0 удалений

Просмотреть файл

@ -53,6 +53,8 @@ function finishTest()
function obs () {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
ok(true, "adding observer");
this.window = window;
this.os = Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService);
@ -65,8 +67,24 @@ obs.prototype = {
this.window.netscape.security
.PrivilegeManager.enablePrivilege("UniversalXPConnect");
ok(true, "theSubject " + theSubject);
ok(true, "theTopic " + theTopic);
ok(true, "theData " + theData);
var channel = theSubject.QueryInterface(
this.window.Components.interfaces.nsIHttpChannel);
ok(true, "channel " + channel);
try {
ok(true, "channel.URI " + channel.URI);
ok(true, "channel.URI.spec " + channel.URI.spec);
channel.visitRequestHeaders({
visitHeader: function(aHeader, aValue) {
ok(true, aHeader + ": " + aValue);
}});
} catch (err) {
ok(false, "catch error " + err);
}
this.window.isnot(channel.getRequestHeader("Cookie").indexOf("oh=hai"), -1,
"cookie 'oh=hai' is in header for " + channel.URI.spec);
++gHeaders;
@ -76,6 +94,8 @@ obs.prototype = {
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
ok(true, "removing observer");
this.os.removeObserver(this, "http-on-modify-request");
this.os = null;
this.window = null;