Backed out changeset a762568b0299 (bug 1328532) for clipboard bustage a=backout

This commit is contained in:
Wes Kocher 2017-01-04 18:23:22 -08:00
Родитель fb74e5d705
Коммит ab53837a32
4 изменённых файлов: 24 добавлений и 30 удалений

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

@ -711,12 +711,6 @@ NetworkEventsHandler.prototype = {
* are available, or rejected if something goes wrong.
*/
getString: function (stringGrip) {
// FIXME: this.webConsoleClient will be undefined in mochitest,
// so we return string instantly to skip undefined error
if (typeof stringGrip === "string") {
return stringGrip;
}
return this.webConsoleClient.getString(stringGrip);
}
};

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

@ -208,25 +208,30 @@ RequestsMenuView.prototype = {
if (responseContent && responseContent.content) {
let request = getRequestById(this.store.getState(), action.id);
let { text, encoding } = responseContent.content;
if (request) {
let { mimeType } = request;
let { text, encoding } = responseContent.content;
let response = yield gNetwork.getString(text);
let payload = {};
if (mimeType.includes("image/")) {
payload.responseContentDataUri = formDataURI(mimeType, encoding, response);
}
if (mimeType.includes("text/")) {
responseContent.content.text = response;
payload.responseContent = responseContent;
}
yield this.store.dispatch(Actions.updateRequest(action.id, payload, true));
// Fetch response data if the response is an image (to display thumbnail)
if (mimeType.includes("image/")) {
let responseBody = yield gNetwork.getString(text);
const dataUri = formDataURI(mimeType, encoding, responseBody);
yield this.store.dispatch(Actions.updateRequest(
action.id,
{ responseContentDataUri: dataUri },
true
));
window.emit(EVENTS.RESPONSE_IMAGE_THUMBNAIL_DISPLAYED);
// Fetch response text only if the response is html, but not all text/*
} else if (mimeType.includes("text/html") && typeof text !== "string") {
let responseBody = yield gNetwork.getString(text);
responseContent.content.text = responseBody;
responseContent = Object.assign({}, responseContent);
yield this.store.dispatch(Actions.updateRequest(
action.id,
{ responseContent },
true
));
}
}
}
@ -240,12 +245,9 @@ RequestsMenuView.prototype = {
const headersSize = headers.reduce((acc, { name, value }) => {
return acc + name.length + value.length + 2;
}, 0);
let payload = {};
requestPostData.postData.text = postData;
payload.requestPostData = Object.assign({}, requestPostData);
payload.requestHeadersFromUploadStream = { headers, headersSize };
yield this.store.dispatch(Actions.updateRequest(action.id, payload, true));
yield this.store.dispatch(Actions.updateRequest(action.id, {
requestHeadersFromUploadStream: { headers, headersSize }
}, true));
}
}),

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

@ -17,8 +17,6 @@ add_task(function* () {
gStore } = monitor.panelWin;
let { RequestsMenu } = NetMonitorView;
RequestsMenu.lazyUpdate = false;
let wait = waitForEvents();
yield performRequests();
yield wait;

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

@ -51,9 +51,9 @@ add_task(function* () {
// the hls-m3u8 part
testEditorContent(editor, REQUESTS[0]);
wait = panelWin.once(panelWin.EVENTS.RESPONSE_BODY_DISPLAYED);
RequestsMenu.selectedIndex = 1;
yield wait;
yield panelWin.once(panelWin.EVENTS.TAB_UPDATED);
yield panelWin.once(panelWin.EVENTS.RESPONSE_BODY_DISPLAYED);
// the mpeg-dash part
testEditorContent(editor, REQUESTS[1]);