2010-10-11 09:57:56 -07:00
|
|
|
/* vim:set ts=2 sw=2 sts=2 et: */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2010-10-11 09:57:56 -07:00
|
|
|
|
|
|
|
// Tests that the network panel works.
|
|
|
|
|
2012-01-17 06:04:23 -08:00
|
|
|
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console.html";
|
|
|
|
const TEST_IMG = "http://example.com/browser/browser/devtools/webconsole/test/test-image.png";
|
|
|
|
const TEST_ENCODING_ISO_8859_1 = "http://example.com/browser/browser/devtools/webconsole/test/test-encoding-ISO-8859-1.html";
|
2010-10-11 09:57:56 -07:00
|
|
|
|
|
|
|
let testDriver;
|
|
|
|
|
|
|
|
function test() {
|
|
|
|
addTab(TEST_URI);
|
2012-05-10 08:01:37 -07:00
|
|
|
browser.addEventListener("load", function onLoad() {
|
|
|
|
browser.removeEventListener("load", onLoad, true);
|
|
|
|
openConsole(null, testNetworkPanel);
|
|
|
|
}, true);
|
2010-10-11 09:57:56 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
function testNetworkPanel() {
|
|
|
|
testDriver = testGen();
|
|
|
|
testDriver.next();
|
|
|
|
}
|
|
|
|
|
|
|
|
function checkIsVisible(aPanel, aList) {
|
|
|
|
for (let id in aList) {
|
|
|
|
let node = aPanel.document.getElementById(id);
|
|
|
|
let isVisible = aList[id];
|
|
|
|
is(node.style.display, (isVisible ? "block" : "none"), id + " isVisible=" + isVisible);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function checkNodeContent(aPanel, aId, aContent) {
|
|
|
|
let node = aPanel.document.getElementById(aId);
|
|
|
|
if (node == null) {
|
|
|
|
ok(false, "Tried to access node " + aId + " that doesn't exist!");
|
|
|
|
}
|
|
|
|
else if (node.textContent.indexOf(aContent) != -1) {
|
|
|
|
ok(true, "checking content of " + aId);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
ok(false, "Got false value for " + aId + ": " + node.textContent + " doesn't have " + aContent);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function checkNodeKeyValue(aPanel, aId, aKey, aValue) {
|
|
|
|
let node = aPanel.document.getElementById(aId);
|
|
|
|
|
2011-01-04 09:47:34 -08:00
|
|
|
let headers = node.querySelectorAll("th");
|
|
|
|
for (let i = 0; i < headers.length; i++) {
|
|
|
|
if (headers[i].textContent == (aKey + ":")) {
|
|
|
|
is(headers[i].nextElementSibling.textContent, aValue,
|
|
|
|
"checking content of " + aId + " for key " + aKey);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ok(false, "content check failed for " + aId + ", key " + aKey);
|
2010-10-11 09:57:56 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
function testGen() {
|
2012-07-26 08:06:04 -07:00
|
|
|
let hud = HUDService.getHudByWindow(content);
|
|
|
|
let filterBox = hud.ui.filterBox;
|
2010-10-11 09:57:56 -07:00
|
|
|
|
2012-05-10 08:01:37 -07:00
|
|
|
let tempScope = {};
|
|
|
|
Cu.import("resource:///modules/WebConsoleUtils.jsm", tempScope);
|
|
|
|
let l10n = tempScope.WebConsoleUtils.l10n;
|
|
|
|
tempScope = null;
|
2012-05-10 06:15:10 -07:00
|
|
|
|
2012-05-29 05:48:05 -07:00
|
|
|
let httpActivity = {
|
|
|
|
meta: {
|
|
|
|
stages: [],
|
|
|
|
discardRequestBody: true,
|
|
|
|
discardResponseBody: true,
|
|
|
|
},
|
|
|
|
log: {
|
|
|
|
entries: [{
|
|
|
|
startedDateTime: (new Date()).toISOString(),
|
|
|
|
request: {
|
|
|
|
url: "http://www.testpage.com",
|
|
|
|
method: "GET",
|
|
|
|
cookies: [],
|
|
|
|
headers: [
|
|
|
|
{ name: "foo", value: "bar" },
|
|
|
|
],
|
|
|
|
},
|
|
|
|
response: {
|
|
|
|
headers: [],
|
|
|
|
content: {},
|
|
|
|
},
|
|
|
|
timings: {},
|
|
|
|
}],
|
2010-10-11 09:57:56 -07:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2012-05-29 05:48:05 -07:00
|
|
|
let entry = httpActivity.log.entries[0];
|
|
|
|
|
2012-07-26 08:06:04 -07:00
|
|
|
let networkPanel = hud.ui.openNetworkPanel(filterBox, httpActivity);
|
2010-10-11 09:57:56 -07:00
|
|
|
|
2012-05-29 05:48:05 -07:00
|
|
|
is(filterBox._netPanel, networkPanel,
|
|
|
|
"Network panel stored on the anchor object");
|
|
|
|
|
2010-10-11 09:57:56 -07:00
|
|
|
networkPanel.panel.addEventListener("load", function onLoad() {
|
|
|
|
networkPanel.panel.removeEventListener("load", onLoad, true);
|
|
|
|
testDriver.next();
|
|
|
|
}, true);
|
2010-10-13 05:05:51 -07:00
|
|
|
|
2010-10-11 09:57:56 -07:00
|
|
|
yield;
|
|
|
|
|
2012-05-29 05:48:05 -07:00
|
|
|
info("test 1");
|
|
|
|
|
2010-10-11 09:57:56 -07:00
|
|
|
checkIsVisible(networkPanel, {
|
|
|
|
requestCookie: false,
|
|
|
|
requestFormData: false,
|
|
|
|
requestBody: false,
|
|
|
|
responseContainer: false,
|
|
|
|
responseBody: false,
|
|
|
|
responseNoBody: false,
|
|
|
|
responseImage: false,
|
|
|
|
responseImageCached: false
|
|
|
|
});
|
|
|
|
|
|
|
|
checkNodeContent(networkPanel, "header", "http://www.testpage.com");
|
|
|
|
checkNodeContent(networkPanel, "header", "GET");
|
|
|
|
checkNodeKeyValue(networkPanel, "requestHeadersContent", "foo", "bar");
|
|
|
|
|
|
|
|
// Test request body.
|
2012-05-29 05:48:05 -07:00
|
|
|
info("test 2: request body");
|
|
|
|
httpActivity.meta.discardRequestBody = false;
|
|
|
|
entry.request.postData = { text: "hello world" };
|
2010-10-11 09:57:56 -07:00
|
|
|
networkPanel.update();
|
2012-05-29 05:48:05 -07:00
|
|
|
|
2010-10-11 09:57:56 -07:00
|
|
|
checkIsVisible(networkPanel, {
|
|
|
|
requestBody: true,
|
|
|
|
requestFormData: false,
|
|
|
|
requestCookie: false,
|
|
|
|
responseContainer: false,
|
|
|
|
responseBody: false,
|
|
|
|
responseNoBody: false,
|
|
|
|
responseImage: false,
|
|
|
|
responseImageCached: false
|
|
|
|
});
|
|
|
|
checkNodeContent(networkPanel, "requestBodyContent", "hello world");
|
|
|
|
|
|
|
|
// Test response header.
|
2012-05-29 05:48:05 -07:00
|
|
|
info("test 3: response header");
|
|
|
|
entry.timings.wait = 10;
|
|
|
|
entry.response.httpVersion = "HTTP/3.14";
|
|
|
|
entry.response.status = 999;
|
|
|
|
entry.response.statusText = "earthquake win";
|
|
|
|
entry.response.content.mimeType = "text/html";
|
|
|
|
entry.response.headers.push(
|
|
|
|
{ name: "Content-Type", value: "text/html" },
|
|
|
|
{ name: "leaveHouses", value: "true" }
|
|
|
|
);
|
|
|
|
|
2010-10-11 09:57:56 -07:00
|
|
|
networkPanel.update();
|
2012-05-29 05:48:05 -07:00
|
|
|
|
2010-10-11 09:57:56 -07:00
|
|
|
checkIsVisible(networkPanel, {
|
|
|
|
requestBody: true,
|
|
|
|
requestFormData: false,
|
|
|
|
requestCookie: false,
|
|
|
|
responseContainer: true,
|
|
|
|
responseBody: false,
|
|
|
|
responseNoBody: false,
|
|
|
|
responseImage: false,
|
|
|
|
responseImageCached: false
|
|
|
|
});
|
|
|
|
|
2012-05-29 05:48:05 -07:00
|
|
|
checkNodeContent(networkPanel, "header", "HTTP/3.14 999 earthquake win");
|
2010-10-11 09:57:56 -07:00
|
|
|
checkNodeKeyValue(networkPanel, "responseHeadersContent", "leaveHouses", "true");
|
2012-05-29 05:48:05 -07:00
|
|
|
checkNodeContent(networkPanel, "responseHeadersInfo", "10ms");
|
2010-10-11 09:57:56 -07:00
|
|
|
|
2012-05-29 05:48:05 -07:00
|
|
|
info("test 4");
|
|
|
|
|
|
|
|
httpActivity.meta.discardResponseBody = false;
|
|
|
|
entry.timings.receive = 2;
|
2010-10-11 09:57:56 -07:00
|
|
|
networkPanel.update();
|
|
|
|
|
|
|
|
checkIsVisible(networkPanel, {
|
|
|
|
requestBody: true,
|
|
|
|
requestCookie: false,
|
|
|
|
requestFormData: false,
|
|
|
|
responseContainer: true,
|
|
|
|
responseBody: false,
|
|
|
|
responseNoBody: false,
|
|
|
|
responseImage: false,
|
|
|
|
responseImageCached: false
|
|
|
|
});
|
|
|
|
|
2012-05-29 05:48:05 -07:00
|
|
|
info("test 5");
|
|
|
|
|
|
|
|
httpActivity.meta.stages.push("REQUEST_STOP", "TRANSACTION_CLOSE");
|
2010-10-11 09:57:56 -07:00
|
|
|
networkPanel.update();
|
|
|
|
|
|
|
|
checkNodeContent(networkPanel, "responseNoBodyInfo", "2ms");
|
|
|
|
checkIsVisible(networkPanel, {
|
|
|
|
requestBody: true,
|
|
|
|
requestCookie: false,
|
|
|
|
responseContainer: true,
|
|
|
|
responseBody: false,
|
|
|
|
responseNoBody: true,
|
|
|
|
responseImage: false,
|
|
|
|
responseImageCached: false
|
|
|
|
});
|
|
|
|
|
|
|
|
networkPanel.panel.hidePopup();
|
|
|
|
|
|
|
|
// Second run: Test for cookies and response body.
|
2012-05-29 05:48:05 -07:00
|
|
|
info("test 6: cookies and response body");
|
|
|
|
entry.request.cookies.push(
|
|
|
|
{ name: "foo", value: "bar" },
|
|
|
|
{ name: "hello", value: "world" }
|
|
|
|
);
|
|
|
|
entry.response.content.text = "get out here";
|
2010-10-11 09:57:56 -07:00
|
|
|
|
2012-07-26 08:06:04 -07:00
|
|
|
networkPanel = hud.ui.openNetworkPanel(filterBox, httpActivity);
|
2012-05-29 05:48:05 -07:00
|
|
|
is(filterBox._netPanel, networkPanel,
|
|
|
|
"Network panel stored on httpActivity object");
|
|
|
|
|
2010-10-11 09:57:56 -07:00
|
|
|
networkPanel.panel.addEventListener("load", function onLoad() {
|
|
|
|
networkPanel.panel.removeEventListener("load", onLoad, true);
|
|
|
|
testDriver.next();
|
|
|
|
}, true);
|
2010-10-13 05:05:51 -07:00
|
|
|
|
2010-10-11 09:57:56 -07:00
|
|
|
yield;
|
|
|
|
|
|
|
|
checkIsVisible(networkPanel, {
|
|
|
|
requestBody: true,
|
|
|
|
requestFormData: false,
|
|
|
|
requestCookie: true,
|
|
|
|
responseContainer: true,
|
|
|
|
responseBody: true,
|
|
|
|
responseNoBody: false,
|
|
|
|
responseImage: false,
|
|
|
|
responseImageCached: false
|
|
|
|
});
|
|
|
|
|
|
|
|
checkNodeKeyValue(networkPanel, "requestCookieContent", "foo", "bar");
|
|
|
|
checkNodeKeyValue(networkPanel, "requestCookieContent", "hello", "world");
|
|
|
|
checkNodeContent(networkPanel, "responseBodyContent", "get out here");
|
|
|
|
checkNodeContent(networkPanel, "responseBodyInfo", "2ms");
|
|
|
|
|
|
|
|
networkPanel.panel.hidePopup();
|
|
|
|
|
|
|
|
// Check image request.
|
2012-05-29 05:48:05 -07:00
|
|
|
info("test 7: image request");
|
|
|
|
entry.response.headers[1].value = "image/png";
|
|
|
|
entry.response.content.mimeType = "image/png";
|
|
|
|
entry.request.url = TEST_IMG;
|
2010-10-11 09:57:56 -07:00
|
|
|
|
2012-07-26 08:06:04 -07:00
|
|
|
networkPanel = hud.ui.openNetworkPanel(filterBox, httpActivity);
|
2010-10-11 09:57:56 -07:00
|
|
|
networkPanel.panel.addEventListener("load", function onLoad() {
|
|
|
|
networkPanel.panel.removeEventListener("load", onLoad, true);
|
|
|
|
testDriver.next();
|
|
|
|
}, true);
|
2010-10-13 05:05:51 -07:00
|
|
|
|
2010-10-11 09:57:56 -07:00
|
|
|
yield;
|
|
|
|
|
|
|
|
checkIsVisible(networkPanel, {
|
|
|
|
requestBody: true,
|
|
|
|
requestFormData: false,
|
|
|
|
requestCookie: true,
|
|
|
|
responseContainer: true,
|
|
|
|
responseBody: false,
|
|
|
|
responseNoBody: false,
|
|
|
|
responseImage: true,
|
|
|
|
responseImageCached: false
|
|
|
|
});
|
|
|
|
|
|
|
|
let imgNode = networkPanel.document.getElementById("responseImageNode");
|
|
|
|
is(imgNode.getAttribute("src"), TEST_IMG, "Displayed image is correct");
|
|
|
|
|
|
|
|
function checkImageResponseInfo() {
|
|
|
|
checkNodeContent(networkPanel, "responseImageInfo", "2ms");
|
|
|
|
checkNodeContent(networkPanel, "responseImageInfo", "16x16px");
|
|
|
|
}
|
|
|
|
|
|
|
|
// Check if the image is loaded already.
|
|
|
|
if (imgNode.width == 0) {
|
|
|
|
imgNode.addEventListener("load", function onLoad() {
|
|
|
|
imgNode.removeEventListener("load", onLoad, false);
|
|
|
|
checkImageResponseInfo();
|
|
|
|
networkPanel.panel.hidePopup();
|
|
|
|
testDriver.next();
|
|
|
|
}, false);
|
|
|
|
// Wait until the image is loaded.
|
|
|
|
yield;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
checkImageResponseInfo();
|
|
|
|
networkPanel.panel.hidePopup();
|
|
|
|
}
|
|
|
|
|
|
|
|
// Check cached image request.
|
2012-05-29 05:48:05 -07:00
|
|
|
info("test 8: cached image request");
|
|
|
|
entry.response.httpVersion = "HTTP/1.1";
|
|
|
|
entry.response.status = 304;
|
|
|
|
entry.response.statusText = "Not Modified";
|
2010-10-11 09:57:56 -07:00
|
|
|
|
2012-07-26 08:06:04 -07:00
|
|
|
networkPanel = hud.ui.openNetworkPanel(filterBox, httpActivity);
|
2010-10-11 09:57:56 -07:00
|
|
|
networkPanel.panel.addEventListener("load", function onLoad() {
|
|
|
|
networkPanel.panel.removeEventListener("load", onLoad, true);
|
|
|
|
testDriver.next();
|
|
|
|
}, true);
|
2010-10-13 05:05:51 -07:00
|
|
|
|
2010-10-11 09:57:56 -07:00
|
|
|
yield;
|
|
|
|
|
|
|
|
checkIsVisible(networkPanel, {
|
|
|
|
requestBody: true,
|
|
|
|
requestFormData: false,
|
|
|
|
requestCookie: true,
|
|
|
|
responseContainer: true,
|
|
|
|
responseBody: false,
|
|
|
|
responseNoBody: false,
|
|
|
|
responseImage: false,
|
|
|
|
responseImageCached: true
|
|
|
|
});
|
|
|
|
|
|
|
|
let imgNode = networkPanel.document.getElementById("responseImageCachedNode");
|
|
|
|
is(imgNode.getAttribute("src"), TEST_IMG, "Displayed image is correct");
|
|
|
|
|
|
|
|
networkPanel.panel.hidePopup();
|
|
|
|
|
|
|
|
// Test sent form data.
|
2012-05-29 05:48:05 -07:00
|
|
|
info("test 9: sent form data");
|
|
|
|
entry.request.postData.text = [
|
|
|
|
"Content-Type: application/x-www-form-urlencoded",
|
|
|
|
"Content-Length: 59",
|
2010-10-11 09:57:56 -07:00
|
|
|
"name=rob&age=20"
|
2012-05-29 05:48:05 -07:00
|
|
|
].join("\n");
|
2010-10-11 09:57:56 -07:00
|
|
|
|
2012-07-26 08:06:04 -07:00
|
|
|
networkPanel = hud.ui.openNetworkPanel(filterBox, httpActivity);
|
2010-10-11 09:57:56 -07:00
|
|
|
networkPanel.panel.addEventListener("load", function onLoad() {
|
|
|
|
networkPanel.panel.removeEventListener("load", onLoad, true);
|
|
|
|
testDriver.next();
|
|
|
|
}, true);
|
2010-10-13 05:05:51 -07:00
|
|
|
|
2010-10-11 09:57:56 -07:00
|
|
|
yield;
|
|
|
|
|
|
|
|
checkIsVisible(networkPanel, {
|
|
|
|
requestBody: false,
|
|
|
|
requestFormData: true,
|
|
|
|
requestCookie: true,
|
|
|
|
responseContainer: true,
|
|
|
|
responseBody: false,
|
|
|
|
responseNoBody: false,
|
|
|
|
responseImage: false,
|
|
|
|
responseImageCached: true
|
|
|
|
});
|
|
|
|
|
|
|
|
checkNodeKeyValue(networkPanel, "requestFormDataContent", "name", "rob");
|
|
|
|
checkNodeKeyValue(networkPanel, "requestFormDataContent", "age", "20");
|
|
|
|
networkPanel.panel.hidePopup();
|
|
|
|
|
|
|
|
// Test no space after Content-Type:
|
2012-05-29 05:48:05 -07:00
|
|
|
info("test 10: no space after Content-Type header in post data");
|
|
|
|
entry.request.postData.text = "Content-Type:application/x-www-form-urlencoded\n";
|
2010-10-11 09:57:56 -07:00
|
|
|
|
2012-07-26 08:06:04 -07:00
|
|
|
networkPanel = hud.ui.openNetworkPanel(filterBox, httpActivity);
|
2010-10-11 09:57:56 -07:00
|
|
|
networkPanel.panel.addEventListener("load", function onLoad() {
|
|
|
|
networkPanel.panel.removeEventListener("load", onLoad, true);
|
|
|
|
testDriver.next();
|
|
|
|
}, true);
|
2010-10-13 05:05:51 -07:00
|
|
|
|
2010-10-11 09:57:56 -07:00
|
|
|
yield;
|
|
|
|
|
|
|
|
checkIsVisible(networkPanel, {
|
|
|
|
requestBody: false,
|
|
|
|
requestFormData: true,
|
|
|
|
requestCookie: true,
|
|
|
|
responseContainer: true,
|
|
|
|
responseBody: false,
|
|
|
|
responseNoBody: false,
|
|
|
|
responseImage: false,
|
|
|
|
responseImageCached: true
|
|
|
|
});
|
|
|
|
|
|
|
|
networkPanel.panel.hidePopup();
|
|
|
|
|
|
|
|
// Test cached data.
|
|
|
|
|
2012-05-29 05:48:05 -07:00
|
|
|
info("test 11: cached data");
|
2010-10-11 09:57:56 -07:00
|
|
|
|
2012-05-29 05:48:05 -07:00
|
|
|
entry.request.url = TEST_ENCODING_ISO_8859_1;
|
|
|
|
entry.response.headers[1].value = "application/json";
|
|
|
|
entry.response.content.mimeType = "application/json";
|
|
|
|
entry.response.content.text = "my cached data is here!";
|
2010-10-11 09:57:56 -07:00
|
|
|
|
2012-07-26 08:06:04 -07:00
|
|
|
networkPanel = hud.ui.openNetworkPanel(filterBox, httpActivity);
|
2012-05-29 05:48:05 -07:00
|
|
|
networkPanel.panel.addEventListener("load", function onLoad() {
|
|
|
|
networkPanel.panel.removeEventListener("load", onLoad, true);
|
2010-10-13 05:05:51 -07:00
|
|
|
testDriver.next();
|
2012-05-29 05:48:05 -07:00
|
|
|
}, true);
|
2010-10-11 09:57:56 -07:00
|
|
|
|
2010-10-13 05:05:51 -07:00
|
|
|
yield;
|
|
|
|
|
|
|
|
checkIsVisible(networkPanel, {
|
|
|
|
requestBody: false,
|
|
|
|
requestFormData: true,
|
|
|
|
requestCookie: true,
|
|
|
|
responseContainer: true,
|
|
|
|
responseBody: false,
|
|
|
|
responseBodyCached: true,
|
|
|
|
responseNoBody: false,
|
|
|
|
responseImage: false,
|
|
|
|
responseImageCached: false
|
|
|
|
});
|
|
|
|
|
2012-05-29 05:48:05 -07:00
|
|
|
checkNodeContent(networkPanel, "responseBodyCachedContent",
|
|
|
|
"my cached data is here!");
|
|
|
|
|
2010-10-13 05:05:51 -07:00
|
|
|
networkPanel.panel.hidePopup();
|
|
|
|
|
|
|
|
// Test a response with a content type that can't be displayed in the
|
|
|
|
// NetworkPanel.
|
2012-05-29 05:48:05 -07:00
|
|
|
info("test 12: unknown content type");
|
|
|
|
entry.response.headers[1].value = "application/x-shockwave-flash";
|
|
|
|
entry.response.content.mimeType = "application/x-shockwave-flash";
|
2010-10-13 05:05:51 -07:00
|
|
|
|
2012-07-26 08:06:04 -07:00
|
|
|
networkPanel = hud.ui.openNetworkPanel(filterBox, httpActivity);
|
2012-05-29 05:48:05 -07:00
|
|
|
networkPanel.panel.addEventListener("load", function onLoad() {
|
|
|
|
networkPanel.panel.removeEventListener("load", onLoad, true);
|
|
|
|
testDriver.next();
|
|
|
|
}, true);
|
2010-10-11 09:57:56 -07:00
|
|
|
|
|
|
|
yield;
|
|
|
|
|
2010-10-13 05:05:51 -07:00
|
|
|
checkIsVisible(networkPanel, {
|
|
|
|
requestBody: false,
|
|
|
|
requestFormData: true,
|
|
|
|
requestCookie: true,
|
|
|
|
responseContainer: true,
|
|
|
|
responseBody: false,
|
|
|
|
responseBodyCached: false,
|
|
|
|
responseBodyUnknownType: true,
|
|
|
|
responseNoBody: false,
|
|
|
|
responseImage: false,
|
|
|
|
responseImageCached: false
|
|
|
|
});
|
|
|
|
|
2012-05-10 06:15:10 -07:00
|
|
|
let responseString =
|
|
|
|
l10n.getFormatStr("NetworkPanel.responseBodyUnableToDisplay.content",
|
|
|
|
["application/x-shockwave-flash"]);
|
2010-10-13 05:05:51 -07:00
|
|
|
checkNodeContent(networkPanel, "responseBodyUnknownTypeContent", responseString);
|
|
|
|
networkPanel.panel.hidePopup();
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
// This test disabled. See bug 603620.
|
|
|
|
|
|
|
|
// Test if the NetworkPanel figures out the content type based on an URL as
|
|
|
|
// well.
|
|
|
|
delete httpActivity.response.header["Content-Type"];
|
|
|
|
httpActivity.url = "http://www.test.com/someCrazyFile.swf?done=right&ending=txt";
|
|
|
|
|
2012-07-26 08:06:04 -07:00
|
|
|
networkPanel = hud.ui.openNetworkPanel(filterBox, httpActivity);
|
2010-10-13 05:05:51 -07:00
|
|
|
networkPanel.isDoneCallback = function NP_doneCallback() {
|
|
|
|
networkPanel.isDoneCallback = null;
|
|
|
|
testDriver.next();
|
|
|
|
}
|
|
|
|
|
|
|
|
yield;
|
|
|
|
|
|
|
|
checkIsVisible(networkPanel, {
|
|
|
|
requestBody: false,
|
|
|
|
requestFormData: true,
|
|
|
|
requestCookie: true,
|
|
|
|
responseContainer: true,
|
|
|
|
responseBody: false,
|
|
|
|
responseBodyCached: false,
|
|
|
|
responseBodyUnknownType: true,
|
|
|
|
responseNoBody: false,
|
|
|
|
responseImage: false,
|
|
|
|
responseImageCached: false
|
|
|
|
});
|
|
|
|
|
|
|
|
// Systems without Flash installed will return an empty string here. Ignore.
|
|
|
|
if (networkPanel.document.getElementById("responseBodyUnknownTypeContent").textContent !== "")
|
|
|
|
checkNodeContent(networkPanel, "responseBodyUnknownTypeContent", responseString);
|
|
|
|
else
|
|
|
|
ok(true, "Flash not installed");
|
|
|
|
|
|
|
|
networkPanel.panel.hidePopup(); */
|
|
|
|
|
|
|
|
// All done!
|
2012-05-10 08:01:37 -07:00
|
|
|
testDriver = null;
|
|
|
|
executeSoon(finishTest);
|
2012-05-29 05:48:05 -07:00
|
|
|
|
|
|
|
yield;
|
2010-10-13 05:05:51 -07:00
|
|
|
}
|