Merge fx-team to central, a=merge

This commit is contained in:
Wes Kocher 2015-05-27 17:18:48 -07:00
commit 556eca5c50
226 changed files with 1863 additions and 1089 deletions

View File

@ -6414,97 +6414,32 @@ function BrowserOpenApps() {
switchToTabHavingURI(appsURL, true) switchToTabHavingURI(appsURL, true)
} }
function GetSearchFieldBookmarkData(node) {
var charset = node.ownerDocument.characterSet;
var formBaseURI = makeURI(node.form.baseURI,
charset);
var formURI = makeURI(node.form.getAttribute("action"),
charset,
formBaseURI);
var spec = formURI.spec;
var isURLEncoded =
(node.form.method.toUpperCase() == "POST"
&& (node.form.enctype == "application/x-www-form-urlencoded" ||
node.form.enctype == ""));
var title = gNavigatorBundle.getFormattedString("addKeywordTitleAutoFill",
[node.ownerDocument.title]);
var description = PlacesUIUtils.getDescriptionFromDocument(node.ownerDocument);
var formData = [];
function escapeNameValuePair(aName, aValue, aIsFormUrlEncoded) {
if (aIsFormUrlEncoded)
return escape(aName + "=" + aValue);
else
return escape(aName) + "=" + escape(aValue);
}
for (let el of node.form.elements) {
if (!el.type) // happens with fieldsets
continue;
if (el == node) {
formData.push((isURLEncoded) ? escapeNameValuePair(el.name, "%s", true) :
// Don't escape "%s", just append
escapeNameValuePair(el.name, "", false) + "%s");
continue;
}
let type = el.type.toLowerCase();
if (((el instanceof HTMLInputElement && el.mozIsTextField(true)) ||
type == "hidden" || type == "textarea") ||
((type == "checkbox" || type == "radio") && el.checked)) {
formData.push(escapeNameValuePair(el.name, el.value, isURLEncoded));
} else if (el instanceof HTMLSelectElement && el.selectedIndex >= 0) {
for (var j=0; j < el.options.length; j++) {
if (el.options[j].selected)
formData.push(escapeNameValuePair(el.name, el.options[j].value,
isURLEncoded));
}
}
}
var postData;
if (isURLEncoded)
postData = formData.join("&");
else {
let separator = spec.includes("?") ? "&" : "?";
spec += separator + formData.join("&");
}
return {
spec: spec,
title: title,
description: description,
postData: postData,
charSet: charset
};
}
function AddKeywordForSearchField() { function AddKeywordForSearchField() {
let bookmarkData = GetSearchFieldBookmarkData(gContextMenu.target); let mm = gBrowser.selectedBrowser.messageManager;
PlacesUIUtils.showBookmarkDialog({ action: "add" let onMessage = (message) => {
, type: "bookmark" mm.removeMessageListener("ContextMenu:SearchFieldBookmarkData:Result", onMessage);
, uri: makeURI(bookmarkData.spec)
, title: bookmarkData.title let bookmarkData = message.data;
, description: bookmarkData.description let title = gNavigatorBundle.getFormattedString("addKeywordTitleAutoFill",
, keyword: "" [bookmarkData.title]);
, postData: bookmarkData.postData PlacesUIUtils.showBookmarkDialog({ action: "add"
, charSet: bookmarkData.charset , type: "bookmark"
, hiddenRows: [ "location" , uri: makeURI(bookmarkData.spec)
, "description" , title: title
, "tags" , description: bookmarkData.description
, "loadInSidebar" ] , keyword: ""
}, window); , postData: bookmarkData.postData
, charSet: bookmarkData.charset
, hiddenRows: [ "location"
, "description"
, "tags"
, "loadInSidebar" ]
}, window);
}
mm.addMessageListener("ContextMenu:SearchFieldBookmarkData:Result", onMessage);
mm.sendAsyncMessage("ContextMenu:SearchFieldBookmarkData", {}, { target: gContextMenu.target });
} }
function convertFromUnicode(charset, str) function convertFromUnicode(charset, str)

View File

@ -664,3 +664,73 @@ addMessageListener("ContextMenu:BookmarkFrame", (message) => {
{ title: frame.title, { title: frame.title,
description: PlacesUIUtils.getDescriptionFromDocument(frame) }); description: PlacesUIUtils.getDescriptionFromDocument(frame) });
}); });
addMessageListener("ContextMenu:SearchFieldBookmarkData", (message) => {
let node = message.objects.target;
let charset = node.ownerDocument.characterSet;
let formBaseURI = BrowserUtils.makeURI(node.form.baseURI,
charset);
let formURI = BrowserUtils.makeURI(node.form.getAttribute("action"),
charset,
formBaseURI);
let spec = formURI.spec;
let isURLEncoded =
(node.form.method.toUpperCase() == "POST"
&& (node.form.enctype == "application/x-www-form-urlencoded" ||
node.form.enctype == ""));
let title = node.ownerDocument.title;
let description = PlacesUIUtils.getDescriptionFromDocument(node.ownerDocument);
let formData = [];
function escapeNameValuePair(aName, aValue, aIsFormUrlEncoded) {
if (aIsFormUrlEncoded)
return escape(aName + "=" + aValue);
else
return escape(aName) + "=" + escape(aValue);
}
for (let el of node.form.elements) {
if (!el.type) // happens with fieldsets
continue;
if (el == node) {
formData.push((isURLEncoded) ? escapeNameValuePair(el.name, "%s", true) :
// Don't escape "%s", just append
escapeNameValuePair(el.name, "", false) + "%s");
continue;
}
let type = el.type.toLowerCase();
if (((el instanceof content.HTMLInputElement && el.mozIsTextField(true)) ||
type == "hidden" || type == "textarea") ||
((type == "checkbox" || type == "radio") && el.checked)) {
formData.push(escapeNameValuePair(el.name, el.value, isURLEncoded));
} else if (el instanceof content.HTMLSelectElement && el.selectedIndex >= 0) {
for (let j=0; j < el.options.length; j++) {
if (el.options[j].selected)
formData.push(escapeNameValuePair(el.name, el.options[j].value,
isURLEncoded));
}
}
}
let postData;
if (isURLEncoded)
postData = formData.join("&");
else {
let separator = spec.includes("?") ? "&" : "?";
spec += separator + formData.join("&");
}
sendAsyncMessage("ContextMenu:SearchFieldBookmarkData:Result",
{ spec, title, description, postData, charset });
});

View File

@ -1,49 +1,82 @@
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * http://creativecommons.org/publicdomain/zero/1.0/ */
function test() { let testData = [
waitForExplicitFinish(); /* baseURI, field name, expected */
[ 'http://example.com/', 'q', 'http://example.com/?q=%s' ],
[ 'http://example.com/new-path-here/', 'q', 'http://example.com/new-path-here/?q=%s' ],
[ '', 'q', 'http://example.org/browser/browser/base/content/test/general/dummy_page.html?q=%s' ],
// Tests for proper behaviour when called on a form whose action contains a question mark.
[ 'http://example.com/search?oe=utf-8', 'q', 'http://example.com/search?oe=utf-8&q=%s' ],
];
gBrowser.selectedTab = gBrowser.addTab("http://example.org/browser/browser/base/content/test/general/dummy_page.html"); let mm = gBrowser.selectedBrowser.messageManager;
gBrowser.selectedBrowser.addEventListener("load", function runTests() { add_task(function*() {
gBrowser.selectedBrowser.removeEventListener("load", runTests, true); yield BrowserTestUtils.withNewTab({
gBrowser,
url: "http://example.org/browser/browser/base/content/test/general/dummy_page.html",
}, function* (browser) {
yield ContentTask.spawn(browser, null, function* () {
let doc = content.document;
let base = doc.createElement("base");
doc.head.appendChild(base);
});
let doc = gBrowser.contentDocument; for (let [baseURI, fieldName, expected] of testData) {
let base = doc.createElement("base"); let popupShownPromise = BrowserTestUtils.waitForEvent(document.getElementById("contentAreaContextMenu"),
doc.head.appendChild(base); "popupshown");
let check = function (baseURI, fieldName, expected) { yield ContentTask.spawn(browser, { baseURI, fieldName }, function* (args) {
base.href = baseURI; let doc = content.document;
let form = doc.createElement("form"); let base = doc.querySelector('head > base');
let element = doc.createElement("input"); base.href = args.baseURI;
element.setAttribute("type", "text");
element.setAttribute("name", fieldName);
form.appendChild(element);
doc.body.appendChild(form);
let data = GetSearchFieldBookmarkData(element); let form = doc.createElement("form");
is(data.spec, expected, "Bookmark spec for search field named " + fieldName + " and baseURI " + baseURI + " incorrect"); form.id = "keyword-form";
let element = doc.createElement("input");
element.setAttribute("type", "text");
element.setAttribute("name", args.fieldName);
form.appendChild(element);
doc.body.appendChild(form);
doc.body.removeChild(form); /* Open context menu so chrome can access the element */
const domWindowUtils =
content.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIDOMWindowUtils);
let rect = element.getBoundingClientRect();
let left = rect.left + rect.width / 2;
let top = rect.top + rect.height / 2;
domWindowUtils.sendMouseEvent("contextmenu", left, top, 2,
1, 0, false, 0, 0, true);
});
yield popupShownPromise;
let target = gContextMenuContentData.popupNode;
let urlCheck = new Promise((resolve, reject) => {
let onMessage = (message) => {
mm.removeMessageListener("ContextMenu:SearchFieldBookmarkData:Result", onMessage);
is(message.data.spec, expected,
`Bookmark spec for search field named ${fieldName} and baseURI ${baseURI} incorrect`);
resolve();
};
mm.addMessageListener("ContextMenu:SearchFieldBookmarkData:Result", onMessage);
mm.sendAsyncMessage("ContextMenu:SearchFieldBookmarkData", null, { target });
});
yield urlCheck;
document.getElementById("contentAreaContextMenu").hidePopup();
yield ContentTask.spawn(browser, null, function* () {
let doc = content.document;
doc.body.removeChild(doc.getElementById("keyword-form"));
});
} }
});
let testData = [ });
/* baseURI, field name, expected */
[ 'http://example.com/', 'q', 'http://example.com/?q=%s' ],
[ 'http://example.com/new-path-here/', 'q', 'http://example.com/new-path-here/?q=%s' ],
[ '', 'q', 'http://example.org/browser/browser/base/content/test/general/dummy_page.html?q=%s' ],
// Tests for proper behaviour when called on a form whose action contains a question mark.
[ 'http://example.com/search?oe=utf-8', 'q', 'http://example.com/search?oe=utf-8&q=%s' ],
]
for (let data of testData) {
check(data[0], data[1], data[2]);
}
// cleanup
gBrowser.removeCurrentTab();
finish();
}, true);
}

View File

@ -81,7 +81,7 @@
height: 40px; height: 40px;
background-color: #ccc; background-color: #ccc;
border-radius: 50%; border-radius: 50%;
margin-right: 10px; -moz-margin-end: 10px;
overflow: hidden; overflow: hidden;
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
background-image: url("../shared/img/audio-call-avatar.svg"); background-image: url("../shared/img/audio-call-avatar.svg");
@ -134,6 +134,11 @@
background-color: #fff; background-color: #fff;
} }
body[dir="rtl"] .contact > .details > .username > i.icon-google {
left: 1rem;
right: auto;
}
.contact > .details > .email { .contact > .details > .email {
color: #999; color: #999;
font-size: 11px; font-size: 11px;
@ -143,7 +148,7 @@
.icons { .icons {
cursor: pointer; cursor: pointer;
display: none; display: none;
margin-left: auto; -moz-margin-start: auto;
padding: 10px; padding: 10px;
border-radius: 2px; border-radius: 2px;
background-color: #5bc0a4; background-color: #5bc0a4;
@ -188,6 +193,11 @@
left: auto; left: auto;
} }
body[dir="rtl"] .contact > .dropdown-menu {
right: auto;
left: 3em;
}
.contact > .dropdown-menu-up { .contact > .dropdown-menu-up {
bottom: 10px; bottom: 10px;
top: auto; top: auto;
@ -201,6 +211,10 @@
margin-top: 3px; margin-top: 3px;
} }
body[dir="rtl"] .contact > .dropdown-menu > .dropdown-menu-item > .icon {
background-position: center right;
}
.contact > .dropdown-menu > .dropdown-menu-item > .icon-audio-call { .contact > .dropdown-menu > .dropdown-menu-item > .icon-audio-call {
background-image: url("../shared/img/icons-16x16.svg#audio"); background-image: url("../shared/img/icons-16x16.svg#audio");
} }

View File

@ -339,7 +339,7 @@ body[dir=rtl] .new-room-view > .context > .context-content > .context-preview {
width: 8px; width: 8px;
height: 8px; height: 8px;
border-radius: 50%; border-radius: 50%;
margin-right: .3rem; -moz-margin-end: .3rem;
} }
.room-list > .room-entry.room-active > h2 > .room-notification { .room-list > .room-entry.room-active > h2 > .room-notification {
@ -383,7 +383,8 @@ body[dir=rtl] .new-room-view > .context > .context-content > .context-preview {
width: 24px; width: 24px;
height: 24px; height: 24px;
border: none; border: none;
margin: .1em .1em .1em .5em; /* relative to _this_ line's font, not the document's */ margin: .1em; /* relative to _this_ line's font, not the document's */
-moz-margin-start: .5em;
background-color: transparent; /* override browser default for button tags */ background-color: transparent; /* override browser default for button tags */
top: -15px; top: -15px;
} }
@ -424,7 +425,7 @@ body[dir=rtl] .new-room-view > .context > .context-content > .context-preview {
.room-entry-context-item { .room-entry-context-item {
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
margin-left: 1rem; -moz-margin-start: 1rem;
height: 16px; height: 16px;
} }
@ -752,11 +753,19 @@ body[dir=rtl] .generate-url-spinner {
right: 14px; right: 14px;
} }
body[dir="rtl"] .settings-menu .dropdown-menu {
/* This is specified separately rather than using -moz-margin-start etc, as
we need to override .dropdown-menu's values which can't use the gecko
specific extensions. */
left: 14px;
right: auto;
}
.settings-menu .icon { .settings-menu .icon {
background-size: contain; background-size: contain;
width: 12px; width: 12px;
height: 12px; height: 12px;
margin-right: 1em; -moz-margin-end: 1em;
margin-top: 2px; margin-top: 2px;
} }

View File

@ -1027,10 +1027,6 @@ body[dir=rtl] .share-service-dropdown .share-panel-header {
flex: 0 1 auto; flex: 0 1 auto;
} }
body[dir=rtl] .room-context-thumbnail {
order: 2;
}
.room-context-thumbnail[src=""] { .room-context-thumbnail[src=""] {
display: none; display: none;
} }
@ -1041,10 +1037,6 @@ body[dir=rtl] .room-context-thumbnail {
text-align: start; text-align: start;
} }
body[dir=rtl] .room-context-content {
order: 1;
}
.room-context-content > .error-display-area.error { .room-context-content > .error-display-area.error {
display: block; display: block;
background-color: rgba(215,67,69,.8); background-color: rgba(215,67,69,.8);

View File

@ -67,8 +67,28 @@ loop.store.ActiveRoomStore = (function() {
this._isDesktop = options.isDesktop || false; this._isDesktop = options.isDesktop || false;
}, },
/**
* This is a list of states that need resetting when the room is left,
* due to user choice, failure or other reason. It is a subset of
* getInitialStoreState as some items (e.g. roomState, failureReason,
* context information) can persist across room exit & re-entry.
*
* @type {Array}
*/
_statesToResetOnLeave: [
"audioMuted",
"localVideoDimensions",
"receivingScreenShare",
"remoteVideoDimensions",
"screenSharingState",
"videoMuted"
],
/** /**
* Returns initial state data for this active room. * Returns initial state data for this active room.
*
* When adding states, consider if _statesToResetOnLeave needs updating
* as well.
*/ */
getInitialStoreState: function() { getInitialStoreState: function() {
return { return {
@ -750,6 +770,15 @@ loop.store.ActiveRoomStore = (function() {
// We probably don't need to end screen share separately, but lets be safe. // We probably don't need to end screen share separately, but lets be safe.
this._sdkDriver.disconnectSession(); this._sdkDriver.disconnectSession();
// Reset various states.
var originalStoreState = this.getInitialStoreState();
var newStoreState = {};
this._statesToResetOnLeave.forEach(function(state) {
newStoreState[state] = originalStoreState[state];
});
this.setStoreState(newStoreState);
if (this._timeout) { if (this._timeout) {
clearTimeout(this._timeout); clearTimeout(this._timeout);
delete this._timeout; delete this._timeout;
@ -768,12 +797,16 @@ loop.store.ActiveRoomStore = (function() {
}, },
/** /**
* When feedback is complete, we reset the room to the initial state. * When feedback is complete, we go back to the ready state, rather than
* init or gather, as we don't need to get the data from the server again.
*/ */
feedbackComplete: function() { feedbackComplete: function() {
// Note, that we want some values, such as the windowId, so we don't this.setStoreState({
// do a full reset here. roomState: ROOM_STATES.READY,
this.setStoreState(this.getInitialStoreState()); // Reset the used state here as the user has now given feedback and the
// next time they enter the room, the other person might not be there.
used: false
});
}, },
/** /**

View File

@ -493,18 +493,26 @@ describe("loop.store.ActiveRoomStore", function () {
}); });
describe("#feedbackComplete", function() { describe("#feedbackComplete", function() {
it("should reset the room store state", function() { it("should set the room state to READY", function() {
var initialState = store.getInitialStoreState();
store.setStoreState({ store.setStoreState({
roomState: ROOM_STATES.ENDED, roomState: ROOM_STATES.ENDED,
audioMuted: true, used: true
videoMuted: true,
failureReason: "foo"
}); });
store.feedbackComplete(new sharedActions.FeedbackComplete()); store.feedbackComplete(new sharedActions.FeedbackComplete());
expect(store.getStoreState()).eql(initialState); expect(store.getStoreState().roomState).eql(ROOM_STATES.READY);
});
it("should reset the 'used' state", function() {
store.setStoreState({
roomState: ROOM_STATES.ENDED,
used: true
});
store.feedbackComplete(new sharedActions.FeedbackComplete());
expect(store.getStoreState().used).eql(false);
}); });
}); });
@ -1302,6 +1310,38 @@ describe("loop.store.ActiveRoomStore", function () {
expect(store._storeState.roomState).eql(ROOM_STATES.ENDED); expect(store._storeState.roomState).eql(ROOM_STATES.ENDED);
}); });
it("should reset various store states", function() {
store.setStoreState({
audioMuted: true,
localVideoDimensions: { x: 10 },
receivingScreenShare: true,
remoteVideoDimensions: { y: 10 },
screenSharingState: true,
videoMuted: true
});
store.leaveRoom();
expect(store._storeState.audioMuted).eql(false);
expect(store._storeState.localVideoDimensions).eql({});
expect(store._storeState.receivingScreenShare).eql(false);
expect(store._storeState.remoteVideoDimensions).eql({});
expect(store._storeState.screenSharingState).eql(SCREEN_SHARE_STATES.INACTIVE);
expect(store._storeState.videoMuted).eql(false);
});
it("should not reset the room context", function() {
store.setStoreState({
roomContextUrls: [{ fake: 1 }],
roomName: "fred"
});
store.leaveRoom();
expect(store._storeState.roomName).eql("fred");
expect(store._storeState.roomContextUrls).eql([{ fake: 1 }]);
});
}); });
describe("#_handleSocialShareUpdate", function() { describe("#_handleSocialShareUpdate", function() {

View File

@ -375,7 +375,7 @@ BrowserGlue.prototype = {
case "handle-xul-text-link": case "handle-xul-text-link":
let linkHandled = subject.QueryInterface(Ci.nsISupportsPRBool); let linkHandled = subject.QueryInterface(Ci.nsISupportsPRBool);
if (!linkHandled.data) { if (!linkHandled.data) {
let win = this.getMostRecentBrowserWindow(); let win = RecentWindow.getMostRecentBrowserWindow();
if (win) { if (win) {
win.openUILinkIn(data, "tab"); win.openUILinkIn(data, "tab");
linkHandled.data = true; linkHandled.data = true;
@ -393,7 +393,7 @@ BrowserGlue.prototype = {
// browser.js:BrowserSearch.recordSearchInHealthReport(). The code could // browser.js:BrowserSearch.recordSearchInHealthReport(). The code could
// be consolidated if there is will. We need the observer in // be consolidated if there is will. We need the observer in
// nsBrowserGlue to prevent double counting. // nsBrowserGlue to prevent double counting.
let win = this.getMostRecentBrowserWindow(); let win = RecentWindow.getMostRecentBrowserWindow();
BrowserUITelemetry.countSearchEvent("urlbar", win.gURLBar.value); BrowserUITelemetry.countSearchEvent("urlbar", win.gURLBar.value);
let engine = null; let engine = null;
@ -813,7 +813,7 @@ BrowserGlue.prototype = {
}, },
_showSlowStartupNotification: function () { _showSlowStartupNotification: function () {
let win = this.getMostRecentBrowserWindow(); let win = RecentWindow.getMostRecentBrowserWindow();
if (!win) if (!win)
return; return;
@ -847,7 +847,7 @@ BrowserGlue.prototype = {
* Show a notification bar offering a reset if the profile has been unused for some time. * Show a notification bar offering a reset if the profile has been unused for some time.
*/ */
_resetUnusedProfileNotification: function () { _resetUnusedProfileNotification: function () {
let win = this.getMostRecentBrowserWindow(); let win = RecentWindow.getMostRecentBrowserWindow();
if (!win) if (!win)
return; return;
@ -877,7 +877,7 @@ BrowserGlue.prototype = {
}, },
_notifyUnsignedAddonsDisabled: function () { _notifyUnsignedAddonsDisabled: function () {
let win = this.getMostRecentBrowserWindow(); let win = RecentWindow.getMostRecentBrowserWindow();
if (!win) if (!win)
return; return;
@ -1075,7 +1075,7 @@ BrowserGlue.prototype = {
// them to the user. // them to the user.
let changedIDs = AddonManager.getStartupChanges(AddonManager.STARTUP_CHANGE_INSTALLED); let changedIDs = AddonManager.getStartupChanges(AddonManager.STARTUP_CHANGE_INSTALLED);
if (changedIDs.length > 0) { if (changedIDs.length > 0) {
let win = this.getMostRecentBrowserWindow(); let win = RecentWindow.getMostRecentBrowserWindow();
AddonManager.getAddonsByIDs(changedIDs, function(aAddons) { AddonManager.getAddonsByIDs(changedIDs, function(aAddons) {
aAddons.forEach(function(aAddon) { aAddons.forEach(function(aAddon) {
// If the add-on isn't user disabled or can't be enabled then skip it. // If the add-on isn't user disabled or can't be enabled then skip it.
@ -1115,7 +1115,7 @@ BrowserGlue.prototype = {
if (shouldCheck && !isDefault && !willRecoverSession) { if (shouldCheck && !isDefault && !willRecoverSession) {
Services.tm.mainThread.dispatch(function() { Services.tm.mainThread.dispatch(function() {
DefaultBrowserCheck.prompt(this.getMostRecentBrowserWindow()); DefaultBrowserCheck.prompt(RecentWindow.getMostRecentBrowserWindow());
}.bind(this), Ci.nsIThread.DISPATCH_NORMAL); }.bind(this), Ci.nsIThread.DISPATCH_NORMAL);
} }
} }
@ -1339,7 +1339,7 @@ BrowserGlue.prototype = {
let key = getNotifyString({propName: "notificationButtonAccessKey", let key = getNotifyString({propName: "notificationButtonAccessKey",
stringName: "pu.notifyButton.accesskey"}); stringName: "pu.notifyButton.accesskey"});
let win = this.getMostRecentBrowserWindow(); let win = RecentWindow.getMostRecentBrowserWindow();
let notifyBox = win.document.getElementById("high-priority-global-notificationbox"); let notifyBox = win.document.getElementById("high-priority-global-notificationbox");
let buttons = [ let buttons = [
@ -1380,12 +1380,11 @@ BrowserGlue.prototype = {
let url = getNotifyString({propName: "alertURL", let url = getNotifyString({propName: "alertURL",
prefName: "startup.homepage_override_url"}); prefName: "startup.homepage_override_url"});
var self = this;
function clickCallback(subject, topic, data) { function clickCallback(subject, topic, data) {
// This callback will be called twice but only once with this topic // This callback will be called twice but only once with this topic
if (topic != "alertclickcallback") if (topic != "alertclickcallback")
return; return;
let win = self.getMostRecentBrowserWindow(); let win = RecentWindow.getMostRecentBrowserWindow();
win.openUILinkIn(data, "tab"); win.openUILinkIn(data, "tab");
} }
@ -1406,7 +1405,7 @@ BrowserGlue.prototype = {
getService(Ci.nsIURLFormatter); getService(Ci.nsIURLFormatter);
var updateUrl = formatter.formatURLPref(PREF_PLUGINS_UPDATEURL); var updateUrl = formatter.formatURLPref(PREF_PLUGINS_UPDATEURL);
var win = this.getMostRecentBrowserWindow(); var win = RecentWindow.getMostRecentBrowserWindow();
win.openUILinkIn(updateUrl, "tab"); win.openUILinkIn(updateUrl, "tab");
}, },
@ -1655,7 +1654,7 @@ BrowserGlue.prototype = {
formatURLPref("app.support.baseURL"); formatURLPref("app.support.baseURL");
url += helpTopic; url += helpTopic;
var win = this.getMostRecentBrowserWindow(); var win = RecentWindow.getMostRecentBrowserWindow();
var buttons = [ var buttons = [
{ {
@ -2201,11 +2200,6 @@ BrowserGlue.prototype = {
} }
}), }),
// this returns the most recent non-popup browser window
getMostRecentBrowserWindow: function BG_getMostRecentBrowserWindow() {
return RecentWindow.getMostRecentBrowserWindow();
},
#ifdef MOZ_SERVICES_SYNC #ifdef MOZ_SERVICES_SYNC
/** /**
* Called as an observer when Sync's "display URI" notification is fired. * Called as an observer when Sync's "display URI" notification is fired.
@ -2252,7 +2246,7 @@ BrowserGlue.prototype = {
Services.prefs.setBoolPref("dom.ipc.plugins.flash.disable-protected-mode", true); Services.prefs.setBoolPref("dom.ipc.plugins.flash.disable-protected-mode", true);
Services.prefs.setBoolPref("browser.flash-protected-mode-flip.done", true); Services.prefs.setBoolPref("browser.flash-protected-mode-flip.done", true);
let win = this.getMostRecentBrowserWindow(); let win = RecentWindow.getMostRecentBrowserWindow();
if (!win) { if (!win) {
return; return;
} }

View File

@ -23,7 +23,7 @@ interface nsIDOMWindow;
* *
*/ */
[scriptable, uuid(ea083cb7-6b9d-4695-8b34-2e8f6ce2a860)] [scriptable, uuid(b0e7c156-d00c-4605-a77d-27c7418f23ae)]
interface nsIBrowserGlue : nsISupports interface nsIBrowserGlue : nsISupports
{ {
/** /**
@ -34,9 +34,4 @@ interface nsIBrowserGlue : nsISupports
* *
*/ */
void sanitize(in nsIDOMWindow aParentWindow); void sanitize(in nsIDOMWindow aParentWindow);
/**
* Gets the most recent window that's a browser (but not a popup)
*/
nsIDOMWindow getMostRecentBrowserWindow();
}; };

View File

@ -102,21 +102,6 @@ let SessionHistoryInternal = {
return data; return data;
}, },
/**
* Determines whether a given session history entry has been added dynamically.
*
* @param shEntry
* The session history entry.
* @return bool
*/
isDynamic: function (shEntry) {
// shEntry.isDynamicallyAdded() is true for dynamically added
// <iframe> and <frameset>, but also for <html> (the root of the
// document) so we use shEntry.parent to ensure that we're not looking
// at the root of the document
return shEntry.parent && shEntry.isDynamicallyAdded();
},
/** /**
* Get an object that is a serialized representation of a History entry. * Get an object that is a serialized representation of a History entry.
* *
@ -195,12 +180,12 @@ let SessionHistoryInternal = {
return entry; return entry;
} }
if (shEntry.childCount > 0) { if (shEntry.childCount > 0 && !shEntry.hasDynamicallyAddedChild()) {
let children = []; let children = [];
for (let i = 0; i < shEntry.childCount; i++) { for (let i = 0; i < shEntry.childCount; i++) {
let child = shEntry.GetChildAt(i); let child = shEntry.GetChildAt(i);
if (child && !this.isDynamic(child)) { if (child) {
// Don't try to restore framesets containing wyciwyg URLs. // Don't try to restore framesets containing wyciwyg URLs.
// (cf. bug 424689 and bug 450595) // (cf. bug 424689 and bug 450595)
if (child.URI.schemeIs("wyciwyg")) { if (child.URI.schemeIs("wyciwyg")) {

View File

@ -175,17 +175,8 @@ function createTabWithStorageData(urls, win = window) {
}); });
} }
function waitForStorageEvent(browser) {
return promiseContentMessage(browser, "ss-test:MozStorageChanged");
}
function sendQuitApplicationRequested() { function sendQuitApplicationRequested() {
let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"] let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"]
.createInstance(Ci.nsISupportsPRBool); .createInstance(Ci.nsISupportsPRBool);
Services.obs.notifyObservers(cancelQuit, "quit-application-requested", null); Services.obs.notifyObservers(cancelQuit, "quit-application-requested", null);
} }
function modifySessionStorage(browser, data) {
browser.messageManager.sendAsyncMessage("ss-test:modifySessionStorage", data);
return waitForStorageEvent(browser);
}

View File

@ -66,11 +66,7 @@ add_task(function () {
// Check URLs. // Check URLs.
ok(entries[0].url.startsWith("data:text/html"), "correct root url"); ok(entries[0].url.startsWith("data:text/html"), "correct root url");
is(entries[0].children[0].url, "about:mozilla", "correct url for static frame"); ok(!entries[0].children, "no children collected");
// Check the number of children.
is(entries.length, 1, "there is one root entry ...");
is(entries[0].children.length, 1, "... with a single child entry");
// Navigate the subframe. // Navigate the subframe.
browser.messageManager.sendAsyncMessage("ss-test:click", {id: "lnk"}); browser.messageManager.sendAsyncMessage("ss-test:click", {id: "lnk"});
@ -82,13 +78,9 @@ add_task(function () {
// Check URLs. // Check URLs.
ok(entries[0].url.startsWith("data:text/html"), "correct 1st root url"); ok(entries[0].url.startsWith("data:text/html"), "correct 1st root url");
ok(entries[1].url.startsWith("data:text/html"), "correct 2nd root url"); ok(entries[1].url.startsWith("data:text/html"), "correct 2nd root url");
is(entries[0].children[0].url, "about:mozilla", "correct url for 1st static frame"); ok(!entries.children, "no children collected");
is(entries[1].children[0].url, "about:robots", "correct url for 2ns static frame"); ok(!entries[0].children, "no children collected");
ok(!entries[1].children, "no children collected");
// Check the number of children.
is(entries.length, 2, "there are two root entries ...");
is(entries[0].children.length, 1, "... with a single child entry ...");
is(entries[1].children.length, 1, "... each");
// Cleanup. // Cleanup.
gBrowser.removeTab(tab); gBrowser.removeTab(tab);

View File

@ -30,7 +30,7 @@ add_task(function session_storage() {
"sessionStorage data for mochi.test has been serialized correctly"); "sessionStorage data for mochi.test has been serialized correctly");
// Ensure that modifying sessionStore values works for the inner frame only. // Ensure that modifying sessionStore values works for the inner frame only.
yield modifySessionStorage2(browser, {test: "modified1"}); yield modifySessionStorage(browser, {test: "modified1"}, {frameIndex: 0});
yield TabStateFlusher.flush(browser); yield TabStateFlusher.flush(browser);
({storage} = JSON.parse(ss.getTabState(tab))); ({storage} = JSON.parse(ss.getTabState(tab)));
@ -41,7 +41,7 @@ add_task(function session_storage() {
// Ensure that modifying sessionStore values works for both frames. // Ensure that modifying sessionStore values works for both frames.
yield modifySessionStorage(browser, {test: "modified"}); yield modifySessionStorage(browser, {test: "modified"});
yield modifySessionStorage2(browser, {test: "modified2"}); yield modifySessionStorage(browser, {test: "modified2"}, {frameIndex: 0});
yield TabStateFlusher.flush(browser); yield TabStateFlusher.flush(browser);
({storage} = JSON.parse(ss.getTabState(tab))); ({storage} = JSON.parse(ss.getTabState(tab)));
@ -176,20 +176,6 @@ add_task(function respect_privacy_level() {
"https sessionStorage data has been saved"); "https sessionStorage data has been saved");
}); });
function waitForStorageEvent(browser) {
return promiseContentMessage(browser, "ss-test:MozStorageChanged");
}
function modifySessionStorage(browser, data) {
browser.messageManager.sendAsyncMessage("ss-test:modifySessionStorage", data);
return waitForStorageEvent(browser);
}
function modifySessionStorage2(browser, data) {
browser.messageManager.sendAsyncMessage("ss-test:modifySessionStorage2", data);
return waitForStorageEvent(browser);
}
function purgeDomainData(browser, domain) { function purgeDomainData(browser, domain) {
return sendMessage(browser, "ss-test:purgeDomainData", domain); return sendMessage(browser, "ss-test:purgeDomainData", domain);
} }

View File

@ -79,26 +79,6 @@ addEventListener("hashchange", function () {
sendAsyncMessage("ss-test:hashchange"); sendAsyncMessage("ss-test:hashchange");
}); });
addEventListener("MozStorageChanged", function () {
// It's possible that this event handler runs before the one in
// content-sessionStore.js. We run ours a little later to make sure
// that the session store code has seen the event before we allow
// the test to proceed.
executeSoon(() => sendAsyncMessage("ss-test:MozStorageChanged"));
}, true);
addMessageListener("ss-test:modifySessionStorage", function (msg) {
for (let key of Object.keys(msg.data)) {
content.sessionStorage[key] = msg.data[key];
}
});
addMessageListener("ss-test:modifySessionStorage2", function (msg) {
for (let key of Object.keys(msg.data)) {
content.frames[0].sessionStorage[key] = msg.data[key];
}
});
addMessageListener("ss-test:purgeDomainData", function ({data: domain}) { addMessageListener("ss-test:purgeDomainData", function ({data: domain}) {
Services.obs.notifyObservers(null, "browser:purge-domain-data", domain); Services.obs.notifyObservers(null, "browser:purge-domain-data", domain);
content.setTimeout(() => sendAsyncMessage("ss-test:purgeDomainData")); content.setTimeout(() => sendAsyncMessage("ss-test:purgeDomainData"));

View File

@ -637,3 +637,33 @@ function crashBrowser(browser) {
is(tab.getAttribute("crashed"), "true", "Tab should be marked as crashed"); is(tab.getAttribute("crashed"), "true", "Tab should be marked as crashed");
}); });
} }
// Write DOMSessionStorage data to the given browser.
function modifySessionStorage(browser, data, options = {}) {
return ContentTask.spawn(browser, [data, options], function* ([data, options]) {
let frame = content;
if (options && "frameIndex" in options) {
frame = content.frames[options.frameIndex];
}
let keys = new Set(Object.keys(data));
let storage = frame.sessionStorage;
return new Promise(resolve => {
addEventListener("MozStorageChanged", function onStorageChanged(event) {
if (event.storageArea == storage) {
keys.delete(event.key);
}
if (keys.size == 0) {
removeEventListener("MozStorageChanged", onStorageChanged, true);
resolve();
}
}, true);
for (let key of keys) {
frame.sessionStorage[key] = data[key];
}
});
});
}

View File

@ -48,7 +48,7 @@ function waitForUpdate() {
} }
function changeManifestValue(key, value) { function changeManifestValue(key, value) {
return Task.spawn(function() { return Task.spawn(function*() {
let propElem = gManifestWindow.document let propElem = gManifestWindow.document
.querySelector("[id ^= '" + key + "']"); .querySelector("[id ^= '" + key + "']");
is(propElem.querySelector(".name").value, key, is(propElem.querySelector(".name").value, key,
@ -74,7 +74,7 @@ function changeManifestValue(key, value) {
} }
function changeManifestValueBad(key, value) { function changeManifestValueBad(key, value) {
return Task.spawn(function() { return Task.spawn(function*() {
let propElem = gManifestWindow.document let propElem = gManifestWindow.document
.querySelector("[id ^= '" + key + "']"); .querySelector("[id ^= '" + key + "']");
is(propElem.querySelector(".name").value, key, is(propElem.querySelector(".name").value, key,
@ -102,7 +102,7 @@ function changeManifestValueBad(key, value) {
function addNewManifestProperty(parent, key, value) { function addNewManifestProperty(parent, key, value) {
info("Adding new property - parent: " + parent + "; key: " + key + "; value: " + value + "\n\n"); info("Adding new property - parent: " + parent + "; key: " + key + "; value: " + value + "\n\n");
return Task.spawn(function() { return Task.spawn(function*() {
let parentElem = gManifestWindow.document let parentElem = gManifestWindow.document
.querySelector("[id ^= '" + parent + "']"); .querySelector("[id ^= '" + parent + "']");
ok(parentElem, "Found parent element: " + parentElem.id); ok(parentElem, "Found parent element: " + parentElem.id);
@ -143,7 +143,7 @@ function addNewManifestProperty(parent, key, value) {
} }
function addNewManifestPropertyBad(parent, key, value) { function addNewManifestPropertyBad(parent, key, value) {
return Task.spawn(function() { return Task.spawn(function*() {
let parentElem = gManifestWindow.document let parentElem = gManifestWindow.document
.querySelector("[id ^= '" + parent + "']"); .querySelector("[id ^= '" + parent + "']");
ok(parentElem, ok(parentElem,
@ -176,7 +176,7 @@ function addNewManifestPropertyBad(parent, key, value) {
function removeManifestProperty(parent, key) { function removeManifestProperty(parent, key) {
info("*** Remove property test ***"); info("*** Remove property test ***");
return Task.spawn(function() { return Task.spawn(function*() {
let parentElem = gManifestWindow.document let parentElem = gManifestWindow.document
.querySelector("[id ^= '" + parent + "']"); .querySelector("[id ^= '" + parent + "']");
ok(parentElem, "Found parent element"); ok(parentElem, "Found parent element");

View File

@ -127,7 +127,7 @@ function waitForProjectsPanel(deferred = promise.defer()) {
} }
function selectProjectsPanel() { function selectProjectsPanel() {
return Task.spawn(function() { return Task.spawn(function*() {
let projectsButton = content.document.querySelector(".projects-button"); let projectsButton = content.document.querySelector(".projects-button");
EventUtils.sendMouseEvent({ type: "click" }, projectsButton, content); EventUtils.sendMouseEvent({ type: "click" }, projectsButton, content);
@ -144,7 +144,7 @@ function waitForProjectSelection() {
} }
function selectFirstProject() { function selectFirstProject() {
return Task.spawn(function() { return Task.spawn(function*() {
let projectsFrame = content.document.querySelector(".projects-panel"); let projectsFrame = content.document.querySelector(".projects-panel");
let projectsWindow = projectsFrame.contentWindow; let projectsWindow = projectsFrame.contentWindow;
let projectsDoc = projectsWindow.document; let projectsDoc = projectsWindow.document;
@ -156,7 +156,7 @@ function selectFirstProject() {
} }
function showSampleProjectDetails() { function showSampleProjectDetails() {
return Task.spawn(function() { return Task.spawn(function*() {
yield selectProjectsPanel(); yield selectProjectsPanel();
yield selectFirstProject(); yield selectFirstProject();
}); });

View File

@ -25,7 +25,7 @@ function* spawnTest() {
pbWin.close(); pbWin.close();
} }
function addTabWithToolbarRunTests(win) { function* addTabWithToolbarRunTests(win) {
let options = yield helpers.openTab(TEST_URI, { chromeWindow: win }); let options = yield helpers.openTab(TEST_URI, { chromeWindow: win });
yield helpers.openToolbar(options); yield helpers.openToolbar(options);

View File

@ -70,10 +70,7 @@ function initialChecks() {
is(objectVar.expanded, false, is(objectVar.expanded, false,
"The 'largeObject' variable shouldn't be expanded."); "The 'largeObject' variable shouldn't be expanded.");
let finished = waitForDebuggerEvents(gPanel, gDebugger.EVENTS.FETCHED_PROPERTIES, 2); return promise.all([arrayVar.expand(),objectVar.expand()]);
arrayVar.expand();
objectVar.expand();
return finished;
} }
function verifyFirstLevel() { function verifyFirstLevel() {
@ -96,55 +93,56 @@ function verifyFirstLevel() {
"The 'largeObject' should contain all the created non-enumerable elements."); "The 'largeObject' should contain all the created non-enumerable elements.");
is(arrayVar.target.querySelectorAll(".variables-view-property .name")[0].getAttribute("value"), is(arrayVar.target.querySelectorAll(".variables-view-property .name")[0].getAttribute("value"),
0 + gEllipsis + 1999, "The first page in the 'largeArray' is named correctly."); "[0" + gEllipsis + "2499]", "The first page in the 'largeArray' is named correctly.");
is(arrayVar.target.querySelectorAll(".variables-view-property .value")[0].getAttribute("value"), is(arrayVar.target.querySelectorAll(".variables-view-property .value")[0].getAttribute("value"),
"", "The first page in the 'largeArray' should not have a corresponding value."); "", "The first page in the 'largeArray' should not have a corresponding value.");
is(arrayVar.target.querySelectorAll(".variables-view-property .name")[1].getAttribute("value"), is(arrayVar.target.querySelectorAll(".variables-view-property .name")[1].getAttribute("value"),
2000 + gEllipsis + 3999, "The second page in the 'largeArray' is named correctly."); "[2500" + gEllipsis + "4999]", "The second page in the 'largeArray' is named correctly.");
is(arrayVar.target.querySelectorAll(".variables-view-property .value")[1].getAttribute("value"), is(arrayVar.target.querySelectorAll(".variables-view-property .value")[1].getAttribute("value"),
"", "The second page in the 'largeArray' should not have a corresponding value."); "", "The second page in the 'largeArray' should not have a corresponding value.");
is(arrayVar.target.querySelectorAll(".variables-view-property .name")[2].getAttribute("value"), is(arrayVar.target.querySelectorAll(".variables-view-property .name")[2].getAttribute("value"),
4000 + gEllipsis + 5999, "The third page in the 'largeArray' is named correctly."); "[5000" + gEllipsis + "7499]", "The third page in the 'largeArray' is named correctly.");
is(arrayVar.target.querySelectorAll(".variables-view-property .value")[2].getAttribute("value"), is(arrayVar.target.querySelectorAll(".variables-view-property .value")[2].getAttribute("value"),
"", "The third page in the 'largeArray' should not have a corresponding value."); "", "The third page in the 'largeArray' should not have a corresponding value.");
is(arrayVar.target.querySelectorAll(".variables-view-property .name")[3].getAttribute("value"), is(arrayVar.target.querySelectorAll(".variables-view-property .name")[3].getAttribute("value"),
6000 + gEllipsis + 9999, "The fourth page in the 'largeArray' is named correctly."); "[7500" + gEllipsis + "9999]", "The fourth page in the 'largeArray' is named correctly.");
is(arrayVar.target.querySelectorAll(".variables-view-property .value")[3].getAttribute("value"), is(arrayVar.target.querySelectorAll(".variables-view-property .value")[3].getAttribute("value"),
"", "The fourth page in the 'largeArray' should not have a corresponding value."); "", "The fourth page in the 'largeArray' should not have a corresponding value.");
is(objectVar.target.querySelectorAll(".variables-view-property .name")[0].getAttribute("value"), is(objectVar.target.querySelectorAll(".variables-view-property .name")[0].getAttribute("value"),
0 + gEllipsis + 1999, "The first page in the 'largeObject' is named correctly."); "[0" + gEllipsis + "2499]", "The first page in the 'largeObject' is named correctly.");
is(objectVar.target.querySelectorAll(".variables-view-property .value")[0].getAttribute("value"), is(objectVar.target.querySelectorAll(".variables-view-property .value")[0].getAttribute("value"),
"", "The first page in the 'largeObject' should not have a corresponding value."); "", "The first page in the 'largeObject' should not have a corresponding value.");
is(objectVar.target.querySelectorAll(".variables-view-property .name")[1].getAttribute("value"), is(objectVar.target.querySelectorAll(".variables-view-property .name")[1].getAttribute("value"),
2000 + gEllipsis + 3999, "The second page in the 'largeObject' is named correctly."); "[2500" + gEllipsis + "4999]", "The second page in the 'largeObject' is named correctly.");
is(objectVar.target.querySelectorAll(".variables-view-property .value")[1].getAttribute("value"), is(objectVar.target.querySelectorAll(".variables-view-property .value")[1].getAttribute("value"),
"", "The second page in the 'largeObject' should not have a corresponding value."); "", "The second page in the 'largeObject' should not have a corresponding value.");
is(objectVar.target.querySelectorAll(".variables-view-property .name")[2].getAttribute("value"), is(objectVar.target.querySelectorAll(".variables-view-property .name")[2].getAttribute("value"),
4000 + gEllipsis + 5999, "The thrid page in the 'largeObject' is named correctly."); "[5000" + gEllipsis + "7499]", "The thrid page in the 'largeObject' is named correctly.");
is(objectVar.target.querySelectorAll(".variables-view-property .value")[2].getAttribute("value"), is(objectVar.target.querySelectorAll(".variables-view-property .value")[2].getAttribute("value"),
"", "The thrid page in the 'largeObject' should not have a corresponding value."); "", "The thrid page in the 'largeObject' should not have a corresponding value.");
is(objectVar.target.querySelectorAll(".variables-view-property .name")[3].getAttribute("value"), is(objectVar.target.querySelectorAll(".variables-view-property .name")[3].getAttribute("value"),
6000 + gEllipsis + 9999, "The fourth page in the 'largeObject' is named correctly."); "[7500" + gEllipsis + "9999]", "The fourth page in the 'largeObject' is named correctly.");
is(objectVar.target.querySelectorAll(".variables-view-property .value")[3].getAttribute("value"), is(objectVar.target.querySelectorAll(".variables-view-property .value")[3].getAttribute("value"),
"", "The fourth page in the 'largeObject' should not have a corresponding value."); "", "The fourth page in the 'largeObject' should not have a corresponding value.");
is(arrayVar.target.querySelectorAll(".variables-view-property .name")[4].getAttribute("value"), is(arrayVar.target.querySelectorAll(".variables-view-property .name")[4].getAttribute("value"),
"length", "The other properties 'largeArray' are named correctly.");
is(arrayVar.target.querySelectorAll(".variables-view-property .value")[4].getAttribute("value"),
"10000", "The other properties 'largeArray' have the correct value.");
is(arrayVar.target.querySelectorAll(".variables-view-property .name")[5].getAttribute("value"),
"buffer", "The other properties 'largeArray' are named correctly."); "buffer", "The other properties 'largeArray' are named correctly.");
is(arrayVar.target.querySelectorAll(".variables-view-property .value")[5].getAttribute("value"), is(arrayVar.target.querySelectorAll(".variables-view-property .value")[4].getAttribute("value"),
"ArrayBuffer", "The other properties 'largeArray' have the correct value."); "ArrayBuffer", "The other properties 'largeArray' have the correct value.");
is(arrayVar.target.querySelectorAll(".variables-view-property .name")[6].getAttribute("value"), is(arrayVar.target.querySelectorAll(".variables-view-property .name")[5].getAttribute("value"),
"byteLength", "The other properties 'largeArray' are named correctly."); "byteLength", "The other properties 'largeArray' are named correctly.");
is(arrayVar.target.querySelectorAll(".variables-view-property .value")[6].getAttribute("value"), is(arrayVar.target.querySelectorAll(".variables-view-property .value")[5].getAttribute("value"),
"10000", "The other properties 'largeArray' have the correct value."); "10000", "The other properties 'largeArray' have the correct value.");
is(arrayVar.target.querySelectorAll(".variables-view-property .name")[7].getAttribute("value"), is(arrayVar.target.querySelectorAll(".variables-view-property .name")[6].getAttribute("value"),
"byteOffset", "The other properties 'largeArray' are named correctly."); "byteOffset", "The other properties 'largeArray' are named correctly.");
is(arrayVar.target.querySelectorAll(".variables-view-property .value")[7].getAttribute("value"), is(arrayVar.target.querySelectorAll(".variables-view-property .value")[6].getAttribute("value"),
"0", "The other properties 'largeArray' have the correct value."); "0", "The other properties 'largeArray' have the correct value.");
is(arrayVar.target.querySelectorAll(".variables-view-property .name")[7].getAttribute("value"),
"length", "The other properties 'largeArray' are named correctly.");
is(arrayVar.target.querySelectorAll(".variables-view-property .value")[7].getAttribute("value"),
"10000", "The other properties 'largeArray' have the correct value.");
is(arrayVar.target.querySelectorAll(".variables-view-property .name")[8].getAttribute("value"), is(arrayVar.target.querySelectorAll(".variables-view-property .name")[8].getAttribute("value"),
"__proto__", "The other properties 'largeArray' are named correctly."); "__proto__", "The other properties 'largeArray' are named correctly.");
is(arrayVar.target.querySelectorAll(".variables-view-property .value")[8].getAttribute("value"), is(arrayVar.target.querySelectorAll(".variables-view-property .value")[8].getAttribute("value"),
@ -160,10 +158,13 @@ function verifyNextLevels() {
let localScope = gVariables.getScopeAtIndex(0); let localScope = gVariables.getScopeAtIndex(0);
let objectVar = localScope.get("largeObject"); let objectVar = localScope.get("largeObject");
let lastPage1 = objectVar.get(6000 + gEllipsis + 9999); let lastPage1 = objectVar.get("[7500" + gEllipsis + "9999]");
ok(lastPage1, "The last page in the first level was retrieved successfully."); ok(lastPage1, "The last page in the first level was retrieved successfully.");
lastPage1.expand(); return lastPage1.expand()
.then(verifyNextLevels2.bind(null, lastPage1));
}
function verifyNextLevels2(lastPage1) {
let pageEnums1 = lastPage1.target.querySelector(".variables-view-element-details.enum").childNodes; let pageEnums1 = lastPage1.target.querySelector(".variables-view-element-details.enum").childNodes;
let pageNonEnums1 = lastPage1.target.querySelector(".variables-view-element-details.nonenum").childNodes; let pageNonEnums1 = lastPage1.target.querySelector(".variables-view-element-details.nonenum").childNodes;
is(pageEnums1.length, 0, is(pageEnums1.length, 0,
@ -172,61 +173,44 @@ function verifyNextLevels() {
"The last page in the first level should contain all the created non-enumerable elements."); "The last page in the first level should contain all the created non-enumerable elements.");
is(lastPage1._nonenum.querySelectorAll(".variables-view-property .name")[0].getAttribute("value"), is(lastPage1._nonenum.querySelectorAll(".variables-view-property .name")[0].getAttribute("value"),
6000 + gEllipsis + 6999, "The first page in this level named correctly (1)."); "[7500" + gEllipsis + "8124]", "The first page in this level named correctly (1).");
is(lastPage1._nonenum.querySelectorAll(".variables-view-property .name")[1].getAttribute("value"), is(lastPage1._nonenum.querySelectorAll(".variables-view-property .name")[1].getAttribute("value"),
7000 + gEllipsis + 7999, "The second page in this level named correctly (1)."); "[8125" + gEllipsis + "8749]", "The second page in this level named correctly (1).");
is(lastPage1._nonenum.querySelectorAll(".variables-view-property .name")[2].getAttribute("value"), is(lastPage1._nonenum.querySelectorAll(".variables-view-property .name")[2].getAttribute("value"),
8000 + gEllipsis + 8999, "The third page in this level named correctly (1)."); "[8750" + gEllipsis + "9374]", "The third page in this level named correctly (1).");
is(lastPage1._nonenum.querySelectorAll(".variables-view-property .name")[3].getAttribute("value"), is(lastPage1._nonenum.querySelectorAll(".variables-view-property .name")[3].getAttribute("value"),
9000 + gEllipsis + 9999, "The fourth page in this level named correctly (1)."); "[9375" + gEllipsis + "9999]", "The fourth page in this level named correctly (1).");
let lastPage2 = lastPage1.get(9000 + gEllipsis + 9999); let lastPage2 = lastPage1.get("[9375" + gEllipsis + "9999]");
ok(lastPage2, "The last page in the second level was retrieved successfully."); ok(lastPage2, "The last page in the second level was retrieved successfully.");
lastPage2.expand(); return lastPage2.expand()
.then(verifyNextLevels3.bind(null, lastPage2));
}
function verifyNextLevels3(lastPage2) {
let pageEnums2 = lastPage2.target.querySelector(".variables-view-element-details.enum").childNodes; let pageEnums2 = lastPage2.target.querySelector(".variables-view-element-details.enum").childNodes;
let pageNonEnums2 = lastPage2.target.querySelector(".variables-view-element-details.nonenum").childNodes; let pageNonEnums2 = lastPage2.target.querySelector(".variables-view-element-details.nonenum").childNodes;
is(pageEnums2.length, 0, is(pageEnums2.length, 625,
"The last page in the second level shouldn't contain any enumerable elements.");
is(pageNonEnums2.length, 4,
"The last page in the second level should contain all the created non-enumerable elements.");
is(lastPage2._nonenum.querySelectorAll(".variables-view-property .name")[0].getAttribute("value"),
9000 + gEllipsis + 9199, "The first page in this level named correctly (2).");
is(lastPage2._nonenum.querySelectorAll(".variables-view-property .name")[1].getAttribute("value"),
9200 + gEllipsis + 9399, "The second page in this level named correctly (2).");
is(lastPage2._nonenum.querySelectorAll(".variables-view-property .name")[2].getAttribute("value"),
9400 + gEllipsis + 9599, "The third page in this level named correctly (2).");
is(lastPage2._nonenum.querySelectorAll(".variables-view-property .name")[3].getAttribute("value"),
9600 + gEllipsis + 9999, "The fourth page in this level named correctly (2).");
let lastPage3 = lastPage2.get(9600 + gEllipsis + 9999);
ok(lastPage3, "The last page in the third level was retrieved successfully.");
lastPage3.expand();
let pageEnums3 = lastPage3.target.querySelector(".variables-view-element-details.enum").childNodes;
let pageNonEnums3 = lastPage3.target.querySelector(".variables-view-element-details.nonenum").childNodes;
is(pageEnums3.length, 400,
"The last page in the third level should contain all the created enumerable elements."); "The last page in the third level should contain all the created enumerable elements.");
is(pageNonEnums3.length, 0, is(pageNonEnums2.length, 0,
"The last page in the third level shouldn't contain any non-enumerable elements."); "The last page in the third level shouldn't contain any non-enumerable elements.");
is(lastPage3._enum.querySelectorAll(".variables-view-property .name")[0].getAttribute("value"), is(lastPage2._enum.querySelectorAll(".variables-view-property .name")[0].getAttribute("value"),
9600, "The properties in this level are named correctly (3)."); 9375, "The properties in this level are named correctly (3).");
is(lastPage3._enum.querySelectorAll(".variables-view-property .name")[1].getAttribute("value"), is(lastPage2._enum.querySelectorAll(".variables-view-property .name")[1].getAttribute("value"),
9601, "The properties in this level are named correctly (3)."); 9376, "The properties in this level are named correctly (3).");
is(lastPage3._enum.querySelectorAll(".variables-view-property .name")[398].getAttribute("value"), is(lastPage2._enum.querySelectorAll(".variables-view-property .name")[623].getAttribute("value"),
9998, "The properties in this level are named correctly (3)."); 9998, "The properties in this level are named correctly (3).");
is(lastPage3._enum.querySelectorAll(".variables-view-property .name")[399].getAttribute("value"), is(lastPage2._enum.querySelectorAll(".variables-view-property .name")[624].getAttribute("value"),
9999, "The properties in this level are named correctly (3)."); 9999, "The properties in this level are named correctly (3).");
is(lastPage3._enum.querySelectorAll(".variables-view-property .value")[0].getAttribute("value"), is(lastPage2._enum.querySelectorAll(".variables-view-property .value")[0].getAttribute("value"),
399, "The properties in this level have the correct value (3)."); 624, "The properties in this level have the correct value (3).");
is(lastPage3._enum.querySelectorAll(".variables-view-property .value")[1].getAttribute("value"), is(lastPage2._enum.querySelectorAll(".variables-view-property .value")[1].getAttribute("value"),
398, "The properties in this level have the correct value (3)."); 623, "The properties in this level have the correct value (3).");
is(lastPage3._enum.querySelectorAll(".variables-view-property .value")[398].getAttribute("value"), is(lastPage2._enum.querySelectorAll(".variables-view-property .value")[623].getAttribute("value"),
1, "The properties in this level have the correct value (3)."); 1, "The properties in this level have the correct value (3).");
is(lastPage3._enum.querySelectorAll(".variables-view-property .value")[399].getAttribute("value"), is(lastPage2._enum.querySelectorAll(".variables-view-property .value")[624].getAttribute("value"),
0, "The properties in this level have the correct value (3)."); 0, "The properties in this level have the correct value (3).");
} }

View File

@ -368,7 +368,9 @@ function TargetEventsHandler() {
} }
TargetEventsHandler.prototype = { TargetEventsHandler.prototype = {
get target() NetMonitorController._target, get target() {
return NetMonitorController._target;
},
/** /**
* Listen for events emitted by the current tab target. * Listen for events emitted by the current tab target.
@ -448,8 +450,13 @@ function NetworkEventsHandler() {
} }
NetworkEventsHandler.prototype = { NetworkEventsHandler.prototype = {
get client() NetMonitorController._target.client, get client() {
get webConsoleClient() NetMonitorController.webConsoleClient, return NetMonitorController._target.client;
},
get webConsoleClient() {
return NetMonitorController.webConsoleClient;
},
/** /**
* Connect to the current target client. * Connect to the current target client.
@ -763,7 +770,9 @@ NetMonitorController.NetworkEventsHandler = new NetworkEventsHandler();
*/ */
Object.defineProperties(window, { Object.defineProperties(window, {
"gNetwork": { "gNetwork": {
get: function() NetMonitorController.NetworkEventsHandler, get: function() {
return NetMonitorController.NetworkEventsHandler;
},
configurable: true configurable: true
} }
}); });

View File

@ -948,19 +948,21 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
/** /**
* Returns an object with all the filter predicates as [key: function] pairs. * Returns an object with all the filter predicates as [key: function] pairs.
*/ */
get _allFilterPredicates() ({ get _allFilterPredicates() {
all: () => true, return {
html: this.isHtml, all: () => true,
css: this.isCss, html: this.isHtml,
js: this.isJs, css: this.isCss,
xhr: this.isXHR, js: this.isJs,
fonts: this.isFont, xhr: this.isXHR,
images: this.isImage, fonts: this.isFont,
media: this.isMedia, images: this.isImage,
flash: this.isFlash, media: this.isMedia,
other: this.isOther, flash: this.isFlash,
freetext: this.isFreetextMatch other: this.isOther,
}), freetext: this.isFreetextMatch
};
},
/** /**
* Sorts all network requests in this container by a specified detail. * Sorts all network requests in this container by a specified detail.
@ -1074,52 +1076,72 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
* @return boolean * @return boolean
* True if the item should be visible, false otherwise. * True if the item should be visible, false otherwise.
*/ */
isHtml: function({ attachment: { mimeType } }) isHtml: function({ attachment: { mimeType } }) {
mimeType && mimeType.includes("/html"), return mimeType && mimeType.includes("/html");
},
isCss: function({ attachment: { mimeType } }) isCss: function({ attachment: { mimeType } }) {
mimeType && mimeType.includes("/css"), return mimeType && mimeType.includes("/css");
},
isJs: function({ attachment: { mimeType } }) isJs: function({ attachment: { mimeType } }) {
mimeType && ( return mimeType && (
mimeType.includes("/ecmascript") || mimeType.includes("/ecmascript") ||
mimeType.includes("/javascript") || mimeType.includes("/javascript") ||
mimeType.includes("/x-javascript")), mimeType.includes("/x-javascript"));
},
isXHR: function({ attachment: { isXHR } }) isXHR: function({ attachment: { isXHR } }) {
isXHR, return isXHR;
},
isFont: function({ attachment: { url, mimeType } }) // Fonts are a mess. isFont: function({ attachment: { url, mimeType } }) {
(mimeType && ( // Fonts are a mess.
mimeType.includes("font/") || return (mimeType && (
mimeType.includes("/font"))) || mimeType.includes("font/") ||
url.includes(".eot") || mimeType.includes("/font"))) ||
url.includes(".ttf") || url.includes(".eot") ||
url.includes(".otf") || url.includes(".ttf") ||
url.includes(".woff"), url.includes(".otf") ||
url.includes(".woff");
},
isImage: function({ attachment: { mimeType } }) isImage: function({ attachment: { mimeType } }) {
mimeType && mimeType.includes("image/"), return mimeType && mimeType.includes("image/");
},
isMedia: function({ attachment: { mimeType } }) // Not including images. isMedia: function({ attachment: { mimeType } }) {
mimeType && ( // Not including images.
return mimeType && (
mimeType.includes("audio/") || mimeType.includes("audio/") ||
mimeType.includes("video/") || mimeType.includes("video/") ||
mimeType.includes("model/")), mimeType.includes("model/"));
},
isFlash: function({ attachment: { url, mimeType } }) // Flash is a mess. isFlash: function({ attachment: { url, mimeType } }) {
(mimeType && ( // Flash is a mess.
mimeType.includes("/x-flv") || return (mimeType && (
mimeType.includes("/x-shockwave-flash"))) || mimeType.includes("/x-flv") ||
url.includes(".swf") || mimeType.includes("/x-shockwave-flash"))) ||
url.includes(".flv"), url.includes(".swf") ||
url.includes(".flv");
},
isOther: function(e) isOther: function(e) {
!this.isHtml(e) && !this.isCss(e) && !this.isJs(e) && !this.isXHR(e) && return !this.isHtml(e) &&
!this.isFont(e) && !this.isImage(e) && !this.isMedia(e) && !this.isFlash(e), !this.isCss(e) &&
!this.isJs(e) &&
!this.isXHR(e) &&
!this.isFont(e) &&
!this.isImage(e) &&
!this.isMedia(e) &&
!this.isFlash(e);
},
isFreetextMatch: function({ attachment: { url } }, text) //no text is a positive match isFreetextMatch: function({ attachment: { url } }, text) {
!text || url.includes(text), //no text is a positive match
return !text || url.includes(text);
},
/** /**
* Predicates used when sorting items. * Predicates used when sorting items.
@ -1133,18 +1155,21 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
* 0 to leave aFirst and aSecond unchanged with respect to each other * 0 to leave aFirst and aSecond unchanged with respect to each other
* 1 to sort aSecond to a lower index than aFirst * 1 to sort aSecond to a lower index than aFirst
*/ */
_byTiming: function({ attachment: first }, { attachment: second }) _byTiming: function({ attachment: first }, { attachment: second }) {
first.startedMillis > second.startedMillis, return first.startedMillis > second.startedMillis;
},
_byStatus: function({ attachment: first }, { attachment: second }) _byStatus: function({ attachment: first }, { attachment: second }) {
first.status == second.status return first.status == second.status
? first.startedMillis > second.startedMillis ? first.startedMillis > second.startedMillis
: first.status > second.status, : first.status > second.status;
},
_byMethod: function({ attachment: first }, { attachment: second }) _byMethod: function({ attachment: first }, { attachment: second }) {
first.method == second.method return first.method == second.method
? first.startedMillis > second.startedMillis ? first.startedMillis > second.startedMillis
: first.method > second.method, : first.method > second.method;
},
_byFile: function({ attachment: first }, { attachment: second }) { _byFile: function({ attachment: first }, { attachment: second }) {
let firstUrl = this._getUriNameWithQuery(first.url).toLowerCase(); let firstUrl = this._getUriNameWithQuery(first.url).toLowerCase();
@ -3256,8 +3281,8 @@ PerformanceStatisticsView.prototype = {
/** /**
* DOM query helper. * DOM query helper.
*/ */
function $(aSelector, aTarget = document) aTarget.querySelector(aSelector); let $ = (aSelector, aTarget = document) => aTarget.querySelector(aSelector);
function $all(aSelector, aTarget = document) aTarget.querySelectorAll(aSelector); let $all = (aSelector, aTarget = document) => aTarget.querySelectorAll(aSelector);
/** /**
* Helper for getting an nsIURL instance out of a string. * Helper for getting an nsIURL instance out of a string.
@ -3352,7 +3377,7 @@ function parseRequestText(aText, aName, aDivider) {
* List of headers in text format * List of headers in text format
*/ */
function writeHeaderText(aHeaders) { function writeHeaderText(aHeaders) {
return [(name + ": " + value) for ({name, value} of aHeaders)].join("\n"); return aHeaders.map(({name, value}) => name + ": " + value).join("\n");
} }
/** /**
@ -3364,7 +3389,7 @@ function writeHeaderText(aHeaders) {
* List of query params in text format * List of query params in text format
*/ */
function writeQueryText(aParams) { function writeQueryText(aParams) {
return [(name + "=" + value) for ({name, value} of aParams)].join("\n"); return aParams.map(({name, value}) => name + "=" + value).join("\n");
} }
/** /**
@ -3376,7 +3401,7 @@ function writeQueryText(aParams) {
* Query string that can be appended to a url. * Query string that can be appended to a url.
*/ */
function writeQueryString(aParams) { function writeQueryString(aParams) {
return [(name + "=" + value) for ({name, value} of aParams)].join("&"); return aParams.map(({name, value}) => name + "=" + value).join("&");
} }
/** /**

View File

@ -56,7 +56,9 @@ NetMonitorPanel.prototype = {
// DevToolPanel API // DevToolPanel API
get target() this._toolbox.target, get target() {
return this._toolbox.target;
},
destroy: function() { destroy: function() {
// Make sure this panel is not already destroyed. // Make sure this panel is not already destroyed.

View File

@ -16,7 +16,7 @@ function test() {
RequestsMenu.lazyUpdate = false; RequestsMenu.lazyUpdate = false;
NetworkDetails._params.lazyEmpty = false; NetworkDetails._params.lazyEmpty = false;
Task.spawn(function () { Task.spawn(function*() {
yield waitForNetworkEvents(aMonitor, 1, 6); yield waitForNetworkEvents(aMonitor, 1, 6);
EventUtils.sendMouseEvent({ type: "mousedown" }, EventUtils.sendMouseEvent({ type: "mousedown" },

View File

@ -14,7 +14,7 @@ function test() {
let TAB_UPDATED = aMonitor.panelWin.EVENTS.TAB_UPDATED; let TAB_UPDATED = aMonitor.panelWin.EVENTS.TAB_UPDATED;
RequestsMenu.lazyUpdate = false; RequestsMenu.lazyUpdate = false;
Task.spawn(function () { Task.spawn(function*() {
yield waitForNetworkEvents(aMonitor, 1); yield waitForNetworkEvents(aMonitor, 1);
is(RequestsMenu.selectedItem, null, is(RequestsMenu.selectedItem, null,
"There shouldn't be any selected item in the requests menu."); "There shouldn't be any selected item in the requests menu.");
@ -174,7 +174,7 @@ function test() {
EventUtils.sendMouseEvent({ type: "mousedown" }, EventUtils.sendMouseEvent({ type: "mousedown" },
document.querySelectorAll("#details-pane tab")[3]); document.querySelectorAll("#details-pane tab")[3]);
return Task.spawn(function () { return Task.spawn(function*() {
yield waitFor(aMonitor.panelWin, TAB_UPDATED); yield waitFor(aMonitor.panelWin, TAB_UPDATED);
let tab = document.querySelectorAll("#details-pane tab")[3]; let tab = document.querySelectorAll("#details-pane tab")[3];

View File

@ -404,7 +404,7 @@ function testFilterButtons(aMonitor, aFilterType) {
let buttons = doc.querySelectorAll(".requests-menu-footer-button"); let buttons = doc.querySelectorAll(".requests-menu-footer-button");
// Only target should be checked. // Only target should be checked.
let checkStatus = [(button == target) ? 1 : 0 for (button of buttons)] let checkStatus = [...buttons].map(button => button == target ? 1 : 0);
testFilterButtonsCustom(aMonitor, checkStatus); testFilterButtonsCustom(aMonitor, checkStatus);
} }

View File

@ -56,7 +56,9 @@ PerformancePanel.prototype = {
// DevToolPanel API // DevToolPanel API
get target() this._toolbox.target, get target() {
return this._toolbox.target;
},
destroy: Task.async(function*() { destroy: Task.async(function*() {
// Make sure this panel is not already destroyed. // Make sure this panel is not already destroyed.

View File

@ -73,6 +73,8 @@
</popupset> </popupset>
<hbox class="theme-body" flex="1"> <hbox class="theme-body" flex="1">
<!-- Sidebar: controls and recording list -->
<vbox id="recordings-pane"> <vbox id="recordings-pane">
<toolbar id="recordings-toolbar" <toolbar id="recordings-toolbar"
class="devtools-toolbar"> class="devtools-toolbar">
@ -92,15 +94,21 @@
<vbox id="recordings-list" flex="1"/> <vbox id="recordings-list" flex="1"/>
</vbox> </vbox>
<!-- Main panel content -->
<vbox id="performance-pane" flex="1"> <vbox id="performance-pane" flex="1">
<toolbar id="performance-toolbar" class="devtools-toolbar">
<hbox id="performance-toolbar-control-other" class="devtools-toolbarbutton-group"> <!-- Top toolbar controls -->
<toolbar id="performance-toolbar"
class="devtools-toolbar">
<hbox id="performance-toolbar-controls-other"
class="devtools-toolbarbutton-group">
<toolbarbutton id="filter-button" <toolbarbutton id="filter-button"
class="devtools-toolbarbutton" class="devtools-toolbarbutton"
popup="performance-filter-menupopup" popup="performance-filter-menupopup"
tooltiptext="&profilerUI.options.filter.tooltiptext;"/> tooltiptext="&profilerUI.options.filter.tooltiptext;"/>
</hbox> </hbox>
<hbox id="performance-toolbar-controls-detail-views" class="devtools-toolbarbutton-group"> <hbox id="performance-toolbar-controls-detail-views"
class="devtools-toolbarbutton-group">
<toolbarbutton id="select-waterfall-view" <toolbarbutton id="select-waterfall-view"
class="devtools-toolbarbutton devtools-button" class="devtools-toolbarbutton devtools-button"
label="Waterfall" label="Waterfall"
@ -128,7 +136,8 @@
data-view="memory-flamegraph" /> data-view="memory-flamegraph" />
</hbox> </hbox>
<spacer flex="1"></spacer> <spacer flex="1"></spacer>
<hbox id="performance-toolbar-control-options" class="devtools-toolbarbutton-group"> <hbox id="performance-toolbar-controls-options"
class="devtools-toolbarbutton-group">
<toolbarbutton id="performance-options-button" <toolbarbutton id="performance-options-button"
class="devtools-toolbarbutton devtools-option-toolbarbutton" class="devtools-toolbarbutton devtools-option-toolbarbutton"
popup="performance-options-menupopup" popup="performance-options-menupopup"
@ -136,7 +145,10 @@
</hbox> </hbox>
</toolbar> </toolbar>
<!-- Recording contents and general notice messages -->
<deck id="performance-view" flex="1"> <deck id="performance-view" flex="1">
<!-- "Empty" notice, shown when there's no recordings available -->
<hbox id="empty-notice" <hbox id="empty-notice"
class="notice-container" class="notice-container"
align="center" align="center"
@ -149,13 +161,21 @@
standalone="true"/> standalone="true"/>
</hbox> </hbox>
</hbox> </hbox>
<!-- Recording contents -->
<vbox id="performance-view-content" flex="1"> <vbox id="performance-view-content" flex="1">
<!-- Overview graphs -->
<vbox id="overview-pane"> <vbox id="overview-pane">
<hbox id="markers-overview"/> <hbox id="markers-overview"/>
<hbox id="memory-overview"/> <hbox id="memory-overview"/>
<hbox id="time-framerate"/> <hbox id="time-framerate"/>
</vbox> </vbox>
<!-- Detail views and specific notice messages -->
<deck id="details-pane-container" flex="1"> <deck id="details-pane-container" flex="1">
<!-- "Loading" notice, shown when a recording is being loaded -->
<hbox id="loading-notice" <hbox id="loading-notice"
class="notice-container devtools-throbber" class="notice-container devtools-throbber"
align="center" align="center"
@ -163,61 +183,65 @@
flex="1"> flex="1">
<label value="&profilerUI.loadingNotice;"/> <label value="&profilerUI.loadingNotice;"/>
</hbox> </hbox>
<hbox id="recording-notice"
<!-- "Recording" notice, shown when a recording is in progress -->
<vbox id="recording-notice"
class="notice-container" class="notice-container"
align="center" align="center"
pack="center" pack="center"
flex="1"> flex="1">
<vbox> <hbox class="devtools-toolbarbutton-group"
<hbox class="devtools-toolbarbutton-group" pack="center">
pack="center"> <toolbarbutton class="devtools-toolbarbutton record-button"
<toolbarbutton class="devtools-toolbarbutton record-button" label="&profilerUI.stopRecording;"
label="&profilerUI.stopRecording;" standalone="true"/>
standalone="true"/> </hbox>
</hbox> <label class="realtime-disabled-message">
<label class="realtime-disabled-message"> Realtime recording data disabled on non-multiprocess Firefox.
Realtime recording data disabled on non-multiprocess Firefox. </label>
</label> <label class="realtime-disabled-on-e10s-message">
<label class="realtime-disabled-on-e10s-message"> Enable multiprocess Firefox in preferences for rendering recording data in realtime.
Enable multiprocess Firefox in preferences for rendering recording data in realtime. </label>
</label> <label class="buffer-status-message"
<label class="buffer-status-message" tooltiptext="&profilerUI.bufferStatusTooltip;"/>
tooltiptext="&profilerUI.bufferStatusTooltip;"/> <label class="buffer-status-message-full"
<label class="buffer-status-message-full" value="&profilerUI.bufferStatusFull;"/>
value="&profilerUI.bufferStatusFull;"/> </vbox>
</vbox>
</hbox> <!-- "Console" notice, shown when a console recording is in progress -->
<hbox id="console-recording-notice" <vbox id="console-recording-notice"
class="notice-container" class="notice-container"
align="center" align="center"
pack="center" pack="center"
flex="1"> flex="1">
<vbox flex="1" align="center"> <hbox class="console-profile-recording-notice">
<hbox class="console-profile-recording-notice"> <label value="&profilerUI.console.recordingNoticeStart;" />
<label value="&profilerUI.console.recordingNoticeStart;" /> <label class="console-profile-command" />
<label class="console-profile-command" /> <label value="&profilerUI.console.recordingNoticeEnd;" />
<label value="&profilerUI.console.recordingNoticeEnd;" /> </hbox>
</hbox> <hbox class="console-profile-stop-notice">
<hbox class="console-profile-stop-notice"> <label value="&profilerUI.console.stopCommandStart;" />
<label value="&profilerUI.console.stopCommandStart;" /> <label class="console-profile-command" />
<label class="console-profile-command" /> <label value="&profilerUI.console.stopCommandEnd;" />
<label value="&profilerUI.console.stopCommandEnd;" /> </hbox>
</hbox> <label class="realtime-disabled-message">
<label class="realtime-disabled-message"> Realtime recording data disabled on non-multiprocess Firefox.
Realtime recording data disabled on non-multiprocess Firefox. </label>
</label> <label class="realtime-disabled-on-e10s-message">
<label class="realtime-disabled-on-e10s-message"> Enable multiprocess Firefox in preferences for rendering recording data in realtime.
Enable multiprocess Firefox in preferences for rendering recording data in realtime. </label>
</label> <label class="buffer-status-message"
<label class="buffer-status-message" tooltiptext="&profilerUI.bufferStatusTooltip;"/>
tooltiptext="&profilerUI.bufferStatusTooltip;"/> <label class="buffer-status-message-full"
<label class="buffer-status-message-full" value="&profilerUI.bufferStatusFull;"/>
value="&profilerUI.bufferStatusFull;"/> </vbox>
</vbox>
</hbox> <!-- Detail views -->
<deck id="details-pane" flex="1"> <deck id="details-pane" flex="1">
<!-- Waterfall -->
<hbox id="waterfall-view" flex="1"> <hbox id="waterfall-view" flex="1">
<vbox id="waterfall-breakdown" flex="1" class="devtools-main-content" /> <vbox id="waterfall-breakdown" flex="1" />
<splitter class="devtools-side-splitter"/> <splitter class="devtools-side-splitter"/>
<vbox id="waterfall-details" <vbox id="waterfall-details"
class="theme-sidebar" class="theme-sidebar"
@ -225,6 +249,7 @@
height="150"/> height="150"/>
</hbox> </hbox>
<!-- JS Tree and JIT view -->
<hbox id="js-profile-view" flex="1"> <hbox id="js-profile-view" flex="1">
<vbox id="js-calltree-view" flex="1"> <vbox id="js-calltree-view" flex="1">
<hbox class="call-tree-headers-container"> <hbox class="call-tree-headers-container">
@ -261,7 +286,9 @@
</hbox> </hbox>
<vbox class="call-tree-cells-container" flex="1"/> <vbox class="call-tree-cells-container" flex="1"/>
</vbox> </vbox>
<splitter id="js-call-tree-splitter" class="devtools-side-splitter"/> <splitter id="js-call-tree-splitter" class="devtools-side-splitter"/>
<vbox id="jit-optimizations-view" hidden="true"> <vbox id="jit-optimizations-view" hidden="true">
<toolbar id="jit-optimizations-toolbar" class="devtools-toolbar"> <toolbar id="jit-optimizations-toolbar" class="devtools-toolbar">
<hbox id="jit-optimizations-header"> <hbox id="jit-optimizations-header">
@ -275,9 +302,11 @@
</vbox> </vbox>
</hbox> </hbox>
<!-- JS FlameChart -->
<hbox id="js-flamegraph-view" flex="1"> <hbox id="js-flamegraph-view" flex="1">
</hbox> </hbox>
<!-- Memory Tree -->
<vbox id="memory-calltree-view" flex="1"> <vbox id="memory-calltree-view" flex="1">
<hbox class="call-tree-headers-container"> <hbox class="call-tree-headers-container">
<label class="plain call-tree-header" <label class="plain call-tree-header"
@ -298,8 +327,10 @@
<vbox class="call-tree-cells-container" flex="1"/> <vbox class="call-tree-cells-container" flex="1"/>
</vbox> </vbox>
<!-- Memory FlameChart -->
<hbox id="memory-flamegraph-view" flex="1"> <hbox id="memory-flamegraph-view" flex="1">
</hbox> </hbox>
</deck> </deck>
</deck> </deck>
</vbox> </vbox>

View File

@ -6,7 +6,7 @@
* You can also use this initialization format as a template for other tests. * You can also use this initialization format as a template for other tests.
*/ */
function spawnTest () { function* spawnTest() {
let { target, panel, toolbox } = yield initPerformance(SIMPLE_URL); let { target, panel, toolbox } = yield initPerformance(SIMPLE_URL);
ok(target, "Should have a target available."); ok(target, "Should have a target available.");

View File

@ -5,7 +5,7 @@
* Tests the marker utils methods. * Tests the marker utils methods.
*/ */
function spawnTest () { function* spawnTest() {
let { TIMELINE_BLUEPRINT } = devtools.require("devtools/performance/global"); let { TIMELINE_BLUEPRINT } = devtools.require("devtools/performance/global");
let Utils = devtools.require("devtools/performance/marker-utils"); let Utils = devtools.require("devtools/performance/marker-utils");

View File

@ -5,7 +5,7 @@
* Tests that the categories are shown in the js call tree when platform data * Tests that the categories are shown in the js call tree when platform data
* is enabled. * is enabled.
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, $, DetailsView, JsCallTreeView } = panel.panelWin; let { EVENTS, $, DetailsView, JsCallTreeView } = panel.panelWin;

View File

@ -4,7 +4,7 @@
/** /**
* Tests that the js call tree view renders the correct columns. * Tests that the js call tree view renders the correct columns.
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, $, $$, DetailsView, JsCallTreeView } = panel.panelWin; let { EVENTS, $, $$, DetailsView, JsCallTreeView } = panel.panelWin;

View File

@ -4,7 +4,7 @@
/** /**
* Tests that the memory call tree view renders the correct columns. * Tests that the memory call tree view renders the correct columns.
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, $, $$, DetailsView, MemoryCallTreeView } = panel.panelWin; let { EVENTS, $, $$, DetailsView, MemoryCallTreeView } = panel.panelWin;

View File

@ -7,7 +7,7 @@
let WAIT_TIME = 100; let WAIT_TIME = 100;
function spawnTest () { function* spawnTest() {
let { target, front } = yield initBackend(SIMPLE_URL, { let { target, front } = yield initBackend(SIMPLE_URL, {
TEST_MOCK_MEMORY_ACTOR: true, TEST_MOCK_MEMORY_ACTOR: true,
TEST_MOCK_TIMELINE_ACTOR: true TEST_MOCK_TIMELINE_ACTOR: true

View File

@ -7,7 +7,7 @@
let WAIT_TIME = 100; let WAIT_TIME = 100;
function spawnTest () { function* spawnTest() {
let { target, front } = yield initBackend(SIMPLE_URL, { let { target, front } = yield initBackend(SIMPLE_URL, {
TEST_MOCK_MEMORY_ACTOR: true TEST_MOCK_MEMORY_ACTOR: true
}); });

View File

@ -9,7 +9,7 @@
const WAIT_TIME = 1000; // ms const WAIT_TIME = 1000; // ms
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { gFront: front, gTarget: target } = panel.panelWin; let { gFront: front, gTarget: target } = panel.panelWin;
let connection = getPerformanceActorsConnection(target); let connection = getPerformanceActorsConnection(target);

View File

@ -7,7 +7,7 @@
* `getBufferUsage()` values. * `getBufferUsage()` values.
*/ */
function spawnTest () { function* spawnTest() {
let { target, front } = yield initBackend(SIMPLE_URL, { let { target, front } = yield initBackend(SIMPLE_URL, {
TEST_MOCK_PROFILER_CHECK_TIMER: 10, TEST_MOCK_PROFILER_CHECK_TIMER: 10,
TEST_PROFILER_FILTER_STATUS: ["position", "totalSize", "generation"] TEST_PROFILER_FILTER_STATUS: ["position", "totalSize", "generation"]

View File

@ -5,7 +5,7 @@
* Tests that recording notices does not display any buffer * Tests that recording notices does not display any buffer
* status on servers that do not support buffer statuses. * status on servers that do not support buffer statuses.
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL, void 0, { let { panel } = yield initPerformance(SIMPLE_URL, void 0, {
TEST_MOCK_PROFILER_CHECK_TIMER: 10, TEST_MOCK_PROFILER_CHECK_TIMER: 10,
TEST_PROFILER_FILTER_STATUS: ["position", "totalSize", "generation"] TEST_PROFILER_FILTER_STATUS: ["position", "totalSize", "generation"]

View File

@ -9,7 +9,7 @@
let { getPerformanceActorsConnection } = devtools.require("devtools/performance/front"); let { getPerformanceActorsConnection } = devtools.require("devtools/performance/front");
let WAIT_TIME = 10; let WAIT_TIME = 10;
function spawnTest () { function* spawnTest() {
let profilerConnected = waitForProfilerConnection(); let profilerConnected = waitForProfilerConnection();
let { target, toolbox, console } = yield initConsole(SIMPLE_URL); let { target, toolbox, console } = yield initConsole(SIMPLE_URL);
yield profilerConnected; yield profilerConnected;

View File

@ -9,7 +9,7 @@
let { getPerformanceActorsConnection } = devtools.require("devtools/performance/front"); let { getPerformanceActorsConnection } = devtools.require("devtools/performance/front");
let WAIT_TIME = 10; let WAIT_TIME = 10;
function spawnTest () { function* spawnTest() {
let profilerConnected = waitForProfilerConnection(); let profilerConnected = waitForProfilerConnection();
let { target, toolbox, console } = yield initConsole(SIMPLE_URL); let { target, toolbox, console } = yield initConsole(SIMPLE_URL);
yield profilerConnected; yield profilerConnected;

View File

@ -9,7 +9,7 @@
let { getPerformanceActorsConnection } = devtools.require("devtools/performance/front"); let { getPerformanceActorsConnection } = devtools.require("devtools/performance/front");
let WAIT_TIME = 10; let WAIT_TIME = 10;
function spawnTest () { function* spawnTest() {
let profilerConnected = waitForProfilerConnection(); let profilerConnected = waitForProfilerConnection();
let { target, toolbox, console } = yield initConsole(SIMPLE_URL); let { target, toolbox, console } = yield initConsole(SIMPLE_URL);
yield profilerConnected; yield profilerConnected;

View File

@ -6,7 +6,7 @@
* after being opened. * after being opened.
*/ */
function spawnTest () { function* spawnTest() {
loadFrameScripts(); loadFrameScripts();
let { target, toolbox, panel } = yield initPerformance(SIMPLE_URL); let { target, toolbox, panel } = yield initPerformance(SIMPLE_URL);
let { $, EVENTS, gFront, PerformanceController, OverviewView, RecordingsView } = panel.panelWin; let { $, EVENTS, gFront, PerformanceController, OverviewView, RecordingsView } = panel.panelWin;

View File

@ -6,7 +6,7 @@
* in the recording list. * in the recording list.
*/ */
function spawnTest () { function* spawnTest() {
loadFrameScripts(); loadFrameScripts();
let { target, toolbox, panel } = yield initPerformance(SIMPLE_URL); let { target, toolbox, panel } = yield initPerformance(SIMPLE_URL);
let { $, EVENTS, gFront, PerformanceController, OverviewView, RecordingsView } = panel.panelWin; let { $, EVENTS, gFront, PerformanceController, OverviewView, RecordingsView } = panel.panelWin;

View File

@ -5,7 +5,7 @@
* Tests that console recordings can overlap (not completely nested). * Tests that console recordings can overlap (not completely nested).
*/ */
function spawnTest () { function* spawnTest() {
loadFrameScripts(); loadFrameScripts();
let { target, toolbox, panel } = yield initPerformance(SIMPLE_URL); let { target, toolbox, panel } = yield initPerformance(SIMPLE_URL);
let { $, EVENTS, gFront, PerformanceController, OverviewView, RecordingsView, WaterfallView } = panel.panelWin; let { $, EVENTS, gFront, PerformanceController, OverviewView, RecordingsView, WaterfallView } = panel.panelWin;

View File

@ -7,7 +7,7 @@
* match any pending recordings does nothing. * match any pending recordings does nothing.
*/ */
function spawnTest () { function* spawnTest() {
loadFrameScripts(); loadFrameScripts();
let { target, toolbox, panel } = yield initPerformance(SIMPLE_URL); let { target, toolbox, panel } = yield initPerformance(SIMPLE_URL);
let { $, EVENTS, gFront, PerformanceController, OverviewView, RecordingsView, WaterfallView } = panel.panelWin; let { $, EVENTS, gFront, PerformanceController, OverviewView, RecordingsView, WaterfallView } = panel.panelWin;

View File

@ -21,7 +21,7 @@ function testRecordings (win, expected) {
}); });
} }
function spawnTest () { function* spawnTest() {
loadFrameScripts(); loadFrameScripts();
let { target, toolbox, panel } = yield initPerformance(SIMPLE_URL); let { target, toolbox, panel } = yield initPerformance(SIMPLE_URL);
let win = panel.panelWin; let win = panel.panelWin;

View File

@ -6,7 +6,7 @@
* an in-progress console profile. * an in-progress console profile.
*/ */
function spawnTest () { function* spawnTest() {
loadFrameScripts(); loadFrameScripts();
let { target, toolbox, panel } = yield initPerformance(SIMPLE_URL); let { target, toolbox, panel } = yield initPerformance(SIMPLE_URL);
let win = panel.panelWin; let win = panel.panelWin;

View File

@ -8,7 +8,7 @@
const WAIT_TIME = 1000; // ms const WAIT_TIME = 1000; // ms
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let front = panel.panelWin.gFront; let front = panel.panelWin.gFront;

View File

@ -9,7 +9,7 @@
const WAIT_TIME = 1000; // ms const WAIT_TIME = 1000; // ms
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let front = panel.panelWin.gFront; let front = panel.panelWin.gFront;

View File

@ -4,7 +4,7 @@
/** /**
* Tests that the details view toggles subviews. * Tests that the details view toggles subviews.
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, $, DetailsView, document: doc } = panel.panelWin; let { EVENTS, $, DetailsView, document: doc } = panel.panelWin;

View File

@ -4,7 +4,7 @@
/** /**
* Tests that the details view utility functions work as advertised. * Tests that the details view utility functions work as advertised.
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, DetailsView } = panel.panelWin; let { EVENTS, DetailsView } = panel.panelWin;
let { WaterfallView, JsCallTreeView, JsFlameGraphView } = panel.panelWin; let { WaterfallView, JsCallTreeView, JsFlameGraphView } = panel.panelWin;

View File

@ -6,7 +6,7 @@
* have memory data (withMemory: false), and that when a memory panel is selected, * have memory data (withMemory: false), and that when a memory panel is selected,
* switching to a panel that does not have memory goes to a default panel instead. * switching to a panel that does not have memory goes to a default panel instead.
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, PerformanceController, OverviewView, DetailsView } = panel.panelWin; let { EVENTS, PerformanceController, OverviewView, DetailsView } = panel.panelWin;
let { $, RecordingsView, WaterfallView, MemoryCallTreeView, MemoryFlameGraphView } = panel.panelWin; let { $, RecordingsView, WaterfallView, MemoryCallTreeView, MemoryFlameGraphView } = panel.panelWin;

View File

@ -5,7 +5,7 @@
* Tests that the details view hides the toolbar buttons when a recording * Tests that the details view hides the toolbar buttons when a recording
* doesn't exist or is in progress. * doesn't exist or is in progress.
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, $, $$, PerformanceController, RecordingsView, WaterfallView } = panel.panelWin; let { EVENTS, $, $$, PerformanceController, RecordingsView, WaterfallView } = panel.panelWin;

View File

@ -4,7 +4,7 @@
/** /**
* Tests that the details view utility functions work as advertised. * Tests that the details view utility functions work as advertised.
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, DetailsView } = panel.panelWin; let { EVENTS, DetailsView } = panel.panelWin;
let { PerformanceController, WaterfallView, JsCallTreeView } = panel.panelWin; let { PerformanceController, WaterfallView, JsCallTreeView } = panel.panelWin;

View File

@ -4,7 +4,7 @@
/** /**
* Tests that the views with `shouldUpdateWhileMouseIsActive` works as intended. * Tests that the views with `shouldUpdateWhileMouseIsActive` works as intended.
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, PerformanceController, OverviewView, DetailsView, WaterfallView, JsFlameGraphView } = panel.panelWin; let { EVENTS, PerformanceController, OverviewView, DetailsView, WaterfallView, JsFlameGraphView } = panel.panelWin;

View File

@ -4,7 +4,7 @@
/** /**
* Tests that the call tree view renders content after recording. * Tests that the call tree view renders content after recording.
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, DetailsView, JsCallTreeView } = panel.panelWin; let { EVENTS, DetailsView, JsCallTreeView } = panel.panelWin;

View File

@ -4,7 +4,7 @@
/** /**
* Tests that the flamegraph view renders content after recording. * Tests that the flamegraph view renders content after recording.
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, DetailsView, JsFlameGraphView } = panel.panelWin; let { EVENTS, DetailsView, JsFlameGraphView } = panel.panelWin;

View File

@ -4,7 +4,7 @@
/** /**
* Tests that the memory call tree view renders content after recording. * Tests that the memory call tree view renders content after recording.
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, DetailsView, MemoryCallTreeView } = panel.panelWin; let { EVENTS, DetailsView, MemoryCallTreeView } = panel.panelWin;

View File

@ -4,7 +4,7 @@
/** /**
* Tests that the memory flamegraph view renders content after recording. * Tests that the memory flamegraph view renders content after recording.
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, DetailsView, MemoryFlameGraphView } = panel.panelWin; let { EVENTS, DetailsView, MemoryFlameGraphView } = panel.panelWin;

View File

@ -4,7 +4,7 @@
/** /**
* Tests that the waterfall view renders content after recording. * Tests that the waterfall view renders content after recording.
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, PerformanceController, DetailsView, WaterfallView } = panel.panelWin; let { EVENTS, PerformanceController, DetailsView, WaterfallView } = panel.panelWin;

View File

@ -7,7 +7,7 @@
const { ThreadNode } = devtools.require("devtools/performance/tree-model"); const { ThreadNode } = devtools.require("devtools/performance/tree-model");
const RecordingUtils = devtools.require("devtools/performance/recording-utils") const RecordingUtils = devtools.require("devtools/performance/recording-utils")
function spawnTest () { function* spawnTest() {
let focus = 0; let focus = 0;
let focusEvent = () => focus++; let focusEvent = () => focus++;

View File

@ -7,7 +7,7 @@
let WAIT_TIME = 1000; let WAIT_TIME = 1000;
function spawnTest () { function* spawnTest() {
let { target, front } = yield initBackend(SIMPLE_URL); let { target, front } = yield initBackend(SIMPLE_URL);
let recording = yield front.startRecording({ let recording = yield front.startRecording({

View File

@ -8,7 +8,7 @@
let WAIT_TIME = 1000; let WAIT_TIME = 1000;
function spawnTest () { function* spawnTest() {
let { target, front } = yield initBackend(SIMPLE_URL); let { target, front } = yield initBackend(SIMPLE_URL);
let config = { withMarkers: true, withMemory: true, withTicks: true }; let config = { withMarkers: true, withMemory: true, withTicks: true };

View File

@ -7,7 +7,7 @@
let WAIT_TIME = 1000; let WAIT_TIME = 1000;
function spawnTest () { function* spawnTest() {
let { target, front } = yield initBackend(SIMPLE_URL); let { target, front } = yield initBackend(SIMPLE_URL);
let startModel = yield front.startRecording(); let startModel = yield front.startRecording();

View File

@ -5,7 +5,7 @@
* Test basic functionality of PerformanceFront, retrieving timeline data. * Test basic functionality of PerformanceFront, retrieving timeline data.
*/ */
function spawnTest () { function* spawnTest() {
let { target, front } = yield initBackend(SIMPLE_URL); let { target, front } = yield initBackend(SIMPLE_URL);
let lastMemoryDelta = 0; let lastMemoryDelta = 0;

View File

@ -8,7 +8,7 @@
let { getPerformanceActorsConnection } = devtools.require("devtools/performance/front"); let { getPerformanceActorsConnection } = devtools.require("devtools/performance/front");
function spawnTest () { function* spawnTest() {
let profilerConnected = waitForProfilerConnection(); let profilerConnected = waitForProfilerConnection();
let { target, toolbox, console } = yield initConsole(SIMPLE_URL); let { target, toolbox, console } = yield initConsole(SIMPLE_URL);
yield profilerConnected; yield profilerConnected;

View File

@ -10,7 +10,7 @@ const RecordingUtils = devtools.require("devtools/performance/recording-utils");
Services.prefs.setBoolPref(INVERT_PREF, false); Services.prefs.setBoolPref(INVERT_PREF, false);
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, $, $$, window, PerformanceController } = panel.panelWin; let { EVENTS, $, $$, window, PerformanceController } = panel.panelWin;
let { OverviewView, DetailsView, JITOptimizationsView, JsCallTreeView, RecordingsView } = panel.panelWin; let { OverviewView, DetailsView, JITOptimizationsView, JsCallTreeView, RecordingsView } = panel.panelWin;

View File

@ -12,7 +12,7 @@ const RecordingUtils = devtools.require("devtools/performance/recording-utils");
Services.prefs.setBoolPref(INVERT_PREF, false); Services.prefs.setBoolPref(INVERT_PREF, false);
Services.prefs.setBoolPref(PLATFORM_DATA_PREF, false); Services.prefs.setBoolPref(PLATFORM_DATA_PREF, false);
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, $, $$, window, PerformanceController } = panel.panelWin; let { EVENTS, $, $$, window, PerformanceController } = panel.panelWin;
let { OverviewView, DetailsView, JITOptimizationsView, JsCallTreeView, RecordingsView } = panel.panelWin; let { OverviewView, DetailsView, JITOptimizationsView, JsCallTreeView, RecordingsView } = panel.panelWin;

View File

@ -4,7 +4,7 @@
/** /**
* Tests that toggling preferences before there are any recordings does not throw. * Tests that toggling preferences before there are any recordings does not throw.
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, DetailsView, JsCallTreeView } = panel.panelWin; let { EVENTS, DetailsView, JsCallTreeView } = panel.panelWin;

View File

@ -4,7 +4,7 @@
/** /**
* Tests that toggling preferences during a recording does not throw. * Tests that toggling preferences during a recording does not throw.
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, DetailsView, JsCallTreeView } = panel.panelWin; let { EVENTS, DetailsView, JsCallTreeView } = panel.panelWin;

View File

@ -7,7 +7,7 @@
Services.prefs.setBoolPref(EXPERIMENTAL_PREF, false); Services.prefs.setBoolPref(EXPERIMENTAL_PREF, false);
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { $, EVENTS, PerformanceController } = panel.panelWin; let { $, EVENTS, PerformanceController } = panel.panelWin;

View File

@ -5,7 +5,7 @@
/** /**
* Tests that setting the `devtools.performance.memory.` prefs propagate to the memory actor. * Tests that setting the `devtools.performance.memory.` prefs propagate to the memory actor.
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, PerformanceController, $, gFront } = panel.panelWin; let { EVENTS, PerformanceController, $, gFront } = panel.panelWin;
Services.prefs.setBoolPref(MEMORY_PREF, true); Services.prefs.setBoolPref(MEMORY_PREF, true);

View File

@ -5,7 +5,7 @@
* Tests that `enable-framerate` toggles the visibility of the fps graph, * Tests that `enable-framerate` toggles the visibility of the fps graph,
* as well as enabling ticks data on the PerformanceFront. * as well as enabling ticks data on the PerformanceFront.
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, PerformanceController, $ } = panel.panelWin; let { EVENTS, PerformanceController, $ } = panel.panelWin;
Services.prefs.setBoolPref(FRAMERATE_PREF, false); Services.prefs.setBoolPref(FRAMERATE_PREF, false);

View File

@ -5,7 +5,7 @@
* Tests that `enable-memory` toggles the visibility of the memory graph, * Tests that `enable-memory` toggles the visibility of the memory graph,
* as well as enabling memory data on the PerformanceFront. * as well as enabling memory data on the PerformanceFront.
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, PerformanceController, $ } = panel.panelWin; let { EVENTS, PerformanceController, $ } = panel.panelWin;

View File

@ -5,7 +5,7 @@
* Tests that toggling `enable-memory` during a recording doesn't change that * Tests that toggling `enable-memory` during a recording doesn't change that
* recording's state and does not break. * recording's state and does not break.
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, PerformanceController, $ } = panel.panelWin; let { EVENTS, PerformanceController, $ } = panel.panelWin;

View File

@ -4,7 +4,7 @@
/** /**
* Tests that the js flamegraphs get rerendered when toggling `flatten-tree-recursion` * Tests that the js flamegraphs get rerendered when toggling `flatten-tree-recursion`
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, PerformanceController, DetailsView, JsFlameGraphView, FlameGraphUtils } = panel.panelWin; let { EVENTS, PerformanceController, DetailsView, JsFlameGraphView, FlameGraphUtils } = panel.panelWin;

View File

@ -4,7 +4,7 @@
/** /**
* Tests that the memory flamegraphs get rerendered when toggling `flatten-tree-recursion` * Tests that the memory flamegraphs get rerendered when toggling `flatten-tree-recursion`
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, PerformanceController, DetailsView, MemoryFlameGraphView, RecordingUtils, FlameGraphUtils } = panel.panelWin; let { EVENTS, PerformanceController, DetailsView, MemoryFlameGraphView, RecordingUtils, FlameGraphUtils } = panel.panelWin;

View File

@ -4,7 +4,7 @@
/** /**
* Tests that the js call tree views get rerendered when toggling `invert-call-tree` * Tests that the js call tree views get rerendered when toggling `invert-call-tree`
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, DetailsView, JsCallTreeView } = panel.panelWin; let { EVENTS, DetailsView, JsCallTreeView } = panel.panelWin;

View File

@ -4,7 +4,7 @@
/** /**
* Tests that the memory call tree views get rerendered when toggling `invert-call-tree` * Tests that the memory call tree views get rerendered when toggling `invert-call-tree`
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, DetailsView, MemoryCallTreeView } = panel.panelWin; let { EVENTS, DetailsView, MemoryCallTreeView } = panel.panelWin;

View File

@ -4,7 +4,7 @@
/** /**
* Tests that the js Flamegraphs gets rerendered when toggling `invert-flame-graph` * Tests that the js Flamegraphs gets rerendered when toggling `invert-flame-graph`
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, DetailsView, JsFlameGraphView } = panel.panelWin; let { EVENTS, DetailsView, JsFlameGraphView } = panel.panelWin;

View File

@ -4,7 +4,7 @@
/** /**
* Tests that the memory Flamegraphs gets rerendered when toggling `invert-flame-graph` * Tests that the memory Flamegraphs gets rerendered when toggling `invert-flame-graph`
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, DetailsView, MemoryFlameGraphView } = panel.panelWin; let { EVENTS, DetailsView, MemoryFlameGraphView } = panel.panelWin;

View File

@ -5,7 +5,7 @@
/** /**
* Tests that setting the `devtools.performance.profiler.` prefs propagate to the profiler actor. * Tests that setting the `devtools.performance.profiler.` prefs propagate to the profiler actor.
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { gFront } = panel.panelWin; let { gFront } = panel.panelWin;

View File

@ -4,7 +4,7 @@
/** /**
* Tests that the js flamegraphs get rerendered when toggling `show-idle-blocks` * Tests that the js flamegraphs get rerendered when toggling `show-idle-blocks`
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, DetailsView, JsFlameGraphView } = panel.panelWin; let { EVENTS, DetailsView, JsFlameGraphView } = panel.panelWin;

View File

@ -4,7 +4,7 @@
/** /**
* Tests that the memory flamegraphs get rerendered when toggling `show-idle-blocks` * Tests that the memory flamegraphs get rerendered when toggling `show-idle-blocks`
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, DetailsView, MemoryFlameGraphView } = panel.panelWin; let { EVENTS, DetailsView, MemoryFlameGraphView } = panel.panelWin;

View File

@ -4,7 +4,7 @@
/** /**
* Tests that the js call tree views get rerendered when toggling `show-platform-data` * Tests that the js call tree views get rerendered when toggling `show-platform-data`
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, DetailsView, JsCallTreeView } = panel.panelWin; let { EVENTS, DetailsView, JsCallTreeView } = panel.panelWin;

View File

@ -4,7 +4,7 @@
/** /**
* Tests that the js flamegraphs get rerendered when toggling `show-platform-data` * Tests that the js flamegraphs get rerendered when toggling `show-platform-data`
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, DetailsView, JsFlameGraphView } = panel.panelWin; let { EVENTS, DetailsView, JsFlameGraphView } = panel.panelWin;

View File

@ -4,7 +4,7 @@
/** /**
* Tests that the overview continuously renders content when recording. * Tests that the overview continuously renders content when recording.
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, OverviewView } = panel.panelWin; let { EVENTS, OverviewView } = panel.panelWin;

View File

@ -5,7 +5,7 @@
* Tests that the overview graphs cannot be selected during recording * Tests that the overview graphs cannot be selected during recording
* and that they're cleared upon rerecording. * and that they're cleared upon rerecording.
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, OverviewView } = panel.panelWin; let { EVENTS, OverviewView } = panel.panelWin;

View File

@ -4,7 +4,7 @@
/** /**
* Tests that the overview graphs share the exact same width and scaling. * Tests that the overview graphs share the exact same width and scaling.
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, PerformanceController, OverviewView } = panel.panelWin; let { EVENTS, PerformanceController, OverviewView } = panel.panelWin;

View File

@ -5,7 +5,7 @@
* Tests that the overview graphs do not render when realtime rendering is off * Tests that the overview graphs do not render when realtime rendering is off
* due to lack of e10s. * due to lack of e10s.
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { $, EVENTS, PerformanceController, OverviewView, RecordingsView } = panel.panelWin; let { $, EVENTS, PerformanceController, OverviewView, RecordingsView } = panel.panelWin;

View File

@ -4,7 +4,7 @@
/** /**
* Tests that events are fired from OverviewView from selection manipulation. * Tests that events are fired from OverviewView from selection manipulation.
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, PerformanceController, OverviewView } = panel.panelWin; let { EVENTS, PerformanceController, OverviewView } = panel.panelWin;
let startTime, endTime, params, _; let startTime, endTime, params, _;

View File

@ -4,7 +4,7 @@
/** /**
* Tests that the graphs' selection is correctly disabled or enabled. * Tests that the graphs' selection is correctly disabled or enabled.
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, OverviewView } = panel.panelWin; let { EVENTS, OverviewView } = panel.panelWin;

View File

@ -4,7 +4,7 @@
/** /**
* Tests that the graphs' selections are linked. * Tests that the graphs' selections are linked.
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, OverviewView } = panel.panelWin; let { EVENTS, OverviewView } = panel.panelWin;

View File

@ -5,7 +5,7 @@
* Tests that the `setTimeInterval` and `getTimeInterval` functions * Tests that the `setTimeInterval` and `getTimeInterval` functions
* work properly. * work properly.
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, PerformanceController, OverviewView } = panel.panelWin; let { EVENTS, PerformanceController, OverviewView } = panel.panelWin;

View File

@ -4,7 +4,7 @@
/** /**
* Tests that the detail views are rerendered after the range changes. * Tests that the detail views are rerendered after the range changes.
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, PerformanceController, OverviewView, DetailsView } = panel.panelWin; let { EVENTS, PerformanceController, OverviewView, DetailsView } = panel.panelWin;
let { WaterfallView, JsCallTreeView, JsFlameGraphView } = panel.panelWin; let { WaterfallView, JsCallTreeView, JsFlameGraphView } = panel.panelWin;

View File

@ -6,7 +6,7 @@
* completed, and rec data. * completed, and rec data.
*/ */
function spawnTest () { function* spawnTest() {
let { target, panel, toolbox } = yield initPerformance(SIMPLE_URL); let { target, panel, toolbox } = yield initPerformance(SIMPLE_URL);
let { EVENTS, gFront: front, PerformanceController } = panel.panelWin; let { EVENTS, gFront: front, PerformanceController } = panel.panelWin;

View File

@ -7,7 +7,7 @@
let BUFFER_SIZE = 20000; let BUFFER_SIZE = 20000;
function spawnTest () { function* spawnTest() {
let { target, front } = yield initBackend(SIMPLE_URL, { TEST_MOCK_PROFILER_CHECK_TIMER: 10 }); let { target, front } = yield initBackend(SIMPLE_URL, { TEST_MOCK_PROFILER_CHECK_TIMER: 10 });
let config = { bufferSize: BUFFER_SIZE }; let config = { bufferSize: BUFFER_SIZE };

View File

@ -5,7 +5,7 @@
* Tests that the recording notice panes are toggled in correct scenarios * Tests that the recording notice panes are toggled in correct scenarios
* for initialization and a single recording. * for initialization and a single recording.
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, $, PerformanceView, RecordingsView } = panel.panelWin; let { EVENTS, $, PerformanceView, RecordingsView } = panel.panelWin;

View File

@ -5,7 +5,7 @@
* Tests that the recording notice panes are toggled when going between * Tests that the recording notice panes are toggled when going between
* a completed recording and an in-progress recording. * a completed recording and an in-progress recording.
*/ */
function spawnTest () { function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL); let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, $, PerformanceController, PerformanceView, RecordingsView } = panel.panelWin; let { EVENTS, $, PerformanceController, PerformanceView, RecordingsView } = panel.panelWin;

View File

@ -6,7 +6,7 @@
* and can switch between different recordings with the correct buffer information * and can switch between different recordings with the correct buffer information
* displayed. * displayed.
*/ */
function spawnTest () { function* spawnTest() {
loadFrameScripts(); loadFrameScripts();
// Keep it large, but still get to 1% relatively quick // Keep it large, but still get to 1% relatively quick
Services.prefs.setIntPref(PROFILER_BUFFER_SIZE_PREF, 1000000); Services.prefs.setIntPref(PROFILER_BUFFER_SIZE_PREF, 1000000);

Some files were not shown because too many files have changed in this diff Show More