mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-27 13:28:42 +00:00
a7bc0406ee
- Bug 1155006: Fix unified build sensitivities in js/src/jit. r=shu (6e24e1af1) - Bug 1162766 - Fix more bad implicit constructors in js. r=evilpie (39961b06d) - Bug 1151606 - Stream atoms instead of raw pointers for native functions in tracked optimizations. (r=djvj) (7641ee9d6) - pointer style (540728104) - Bug 1154997 - Deal with self-hosted builtins when stringifying tracked optimization type info. (r=djvj) (92f9a54e6) - pointer style (45742d820) - Bug 1154115 - Rewrite the JSAPI profiling API to use a FrameHandle, as to avoid multiple lookups in JitcodeGlobalTable. (r=djvj) (4d202ba9e) - Bug 1119023 - Timeline in new perf tool should filter out markers, r=jsantell (6fc1a8bbe) - Bug 1132755 - Allocations tree has a bunch of columns that don't make sense, r=jsantell (1ae9ee7e2) - Bug 1142744 - Fix tests broken by bug 1132755, r=me (cc495f72d) - Bug 1133058 - OptionsView button, when clicked, should have an 'open' attribute. r=vp (65a78d896) - Bug 1132765 - Pass through performance memory options for 'probability' and 'maxLogLength' from the front to the memory actor. r=vp (f9bbbe098) - Bug 1141817 - Fix yield statement to correctly return memory actor state so that the performance tool can poll for allocations during recording. r=vp (2ddf7d528) - Bug 1141817 - Followup to fix additional intermittents like bug 1132370, r=vp (eab962f01) - Bug 1142748 - Use a single configuration for starting/stopping recordings, r=jsantell (0181b319a) - bit of Bug 879008 - New UI for the sampling Profiler (32c4d0fe8) - Bug 1123815 - Merge gum into fx-team to enable the Performance++ tool, r=me (84aabbd61) - Bug 1143933 - Expose raw JIT optimization information in performance front end. r=vp,shu (f68a6df50) - Bug 1143915 - Allow multiple calls to memory and timeline actor's start methods, to return the local start time from the actor. r=vp (028ac4187) - Bug 978948 - Add animation generator support for setTimeout in the canvas debugger. r=vp (42d623452) - Bug 985488 - Allow canvas debugger to time out and stop recording frames. Canvas debugger 'wait' style now matches other media styles. Update labels in canvas debugger to explicitly state that it's waiting for rAF cycles, rather than appearing as if something went wrong. r=vporof (b4670d843) - Bug 1144163 - Add a rulers highlighter; added unit test. r=pbrosset (5811a67d0) - Bug 1144163 - Add a rulers highlighter; added highlighter. r=pbrosset (779f88bdd) - Bug 1144163 - Add a rulers highlighter; added gcli command and button. r=pbrosset (d0d13da51) - Bug 1110550 - Enable performance overview graphs to rerender and change on devtools theme switch. r=vp (bd91ca7cf) - Bug 1149630 - Performance graphs should inherit from a common graph and be similarly styled. r=vporof (481c841f1) - Bug 1150733 - Correctly internationalize jit samples label. r=vporof, r=flod (b5612d1a6) - Bug 1137518 - FlameGraph's destroy function should be async, r=jsantell (f103e4c15) - Bug 1137503 - Avoid potential infinite loops in `findOptimalTickInterval` functions, r=jsantell (95df6c04a) - Bug 1121194 - Support vertical panning for the flamegraph in the new performance tool, r=jsantell (06241b5b2) - Bug 1121180 - Support dark theme in flamecharts for the performance tool. r=vp (c76abe237) - Bug 1059308 - Add Target.isTabActor to tell if the remote tab actor supports attach/detach requests. r=jryans (e03dcef93) - Bug 1132370 - Wrong State: Expected 'attached', but current state is 'detached', r=jsantell (e884e8db9) - No Bug - Fix documentation for _startMemory and _stopMemory in performance/modules/front.js, r=me DONTBUILD (d79090b31) - Bug 1147656 - Remove duplicate profiler defaults from the front end and just use on the server. r=vp (35c015dd0) - Bug 1046234 - Add more DevTools Telemetry measures (display size etc) r=pbrosset, r=gijs (a235681b4) - actually package telemetry.js (e8f3a58a4) - Bug 1077464 - Wire console.profile/profileEnd to the new performance tool. Move most of the recording-model logic from the front end into the PerformanceFront and PerformanceActorConnection so it can manage recordings without the front end being viewed. r=vp,jryans,pbrosset (eef8e18c3) - Bug 1144363 - Fix this._telemetry is undefined in gDevTools. r=bgrins (ba7d02902) - init telemetry, missing parts of Bug 866642 (1e70df975) - do not use sysctl.h on Linux anymore, since it is not provided by recent glibc (b2467d7ce) - clean up some telemetry issues of histogram, parts of Bug 974171 (d30c8d0ad) - move devtools to browser - part 1 (9a856f452) - Bug 1291423: Explicitly qualify the destructor call that we invoke in Maybe::reset. r=Waldo (944904a7d) - Bug 1148075 - Dynamically add XUL commands for the debugger frontend. r=vporof (60bc91f8f) - Bug 1147945 - Let the profiler's buffer size and sample rate be configurable via prefs. r=vp (acebcbdd9) - Bug 1124326 - Improve packageDir support for Cordova. r=ochameau (4b736580a) - Bug 1124326 - Support Cordova w/o build file. r=ochameau (d4b50aeae) - Bug 1134029 - Fix 'Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIURI.host]' timeouts, r=jsantell (18d16a5d0) - Bug 1147806 - Content frame filtering is confused when profiling FxOS, r=jsantell (b3c62c552) - Bug 1108843 - Generalize platform data in call tree view when platform data is hidden. r=vporof (354553ed7) - Bug 1138928 - Display only function name and file, instead of full url, in flame graphs. r=vp (4169689c1) - Bug 1152605 - Should not show host names for chrome URIs. r=vporof (c6dcf9e78) - Bug 1147604 - Inverted call trees should list (root) as leaves. r=jsantell (01768267f) - Bug 1075450 - Disable some Awesomebar actions for private windows r=mak (21d5586e7) - Bug 1120616 - Part 1: Implement filter styles in rule view r=bgrins (b66ee0282) - Bug 1120616 - Part 2: Add unit tests for filter styles in rule view r=bgrins (2892503d8) - Bug 1120616 - Part 3: Adjust the styles in the computed view's filter style search r=bgrins (41f8fae1b) - Bug 1120616 - Part 4: Add textbox context menu for rule and computed view r=bgrins (ff3f868ad) - Bug 1120616 - Part 5: Refactor style inspector tests to use synthesizeKeys r=bgrins (41db021d7) - Bug 1102219 - Part 5: Replace more `String.prototype.contains` with `String.prototype.includes` in chrome code. r=till (86ed03588) - Bug 1154018 - Check to see that nsIURI's host exists when parsing location for framenodes, and cache failures. r=vp (9494d52e7) - Bug 1160691 - Optimize FrameUtils.isContent and FrameUtils.parseLocation. (r=jsantell) (09118fd5d) - Bug 1154115 - Make the performance devtool handle the new profiler JSON format. (r=jsantell,vporof) (e3e5be7a4) - Bug 1059308 - Make frame selection button to work in browser toolbox. r=jryans,past (30fe6e61e) - Bug 1059308 - Fix tests to support chrome actor. r=jryans (01cf3926c) - Bug 1147042 - Rename attachProcess to getProcess. r=ochameau (0393ffb80) - Bug 1145824 - Profiler actor and performance tools now handle passing in a startTime to filter out SPS profiles on platform rather than client. r=vp,fitzgen (f225116ba) - Bug 1157718 - Do not use Array.prototype.includes in production code that leaves nightly in performance tool. r=fitzgen (ff06d284e) - Bug 1140728 - Rename 'Memory' to 'Allocations' in the new performance tool. r=jsantell (f584e720f) - Bug 1137500 - Always wait for the overview to be rendered in tests after a recording finishes, unless otherwise specified, r=jsantell (59825e179) - Bug 1137487 - AbstractCanvasGraph's destroy function should be async, r=jsantell (a17ae00b5) - Bug 1132758 - Performance feature visibility now based on a per recording-basis, dependent on features enabled and server support. r=vp (0d080a7c2) - Bug 1147035 - Make DeveloperToolbar.jsm use the gBrowser.contentDocumentAsCPOW shortcut. r=past. (251eff125) - Bug 1151168 - Don't flush profiled threads that are pending deletion on JS shutdown and don't delete expired markers when resetting the profile buffer. (r=djvj) (90721313a)
303 lines
9.2 KiB
JavaScript
303 lines
9.2 KiB
JavaScript
/* Any copyright is dedicated to the Public Domain.
|
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
"use strict";
|
|
|
|
const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
|
|
|
|
let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
|
|
|
|
// Disable logging for all the tests. Both the debugger server and frontend will
|
|
// be affected by this pref.
|
|
let gEnableLogging = Services.prefs.getBoolPref("devtools.debugger.log");
|
|
Services.prefs.setBoolPref("devtools.debugger.log", false);
|
|
|
|
let { generateUUID } = Cc['@mozilla.org/uuid-generator;1'].getService(Ci.nsIUUIDGenerator);
|
|
let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
|
|
let { Promise: promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
|
|
let { gDevTools } = Cu.import("resource://gre/modules/devtools/gDevTools.jsm", {});
|
|
let { devtools } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
|
let { DebuggerServer } = Cu.import("resource://gre/modules/devtools/dbg-server.jsm", {});
|
|
let { DebuggerClient } = Cu.import("resource://gre/modules/devtools/dbg-client.jsm", {});
|
|
let { CallWatcherFront } = devtools.require("devtools/server/actors/call-watcher");
|
|
let { CanvasFront } = devtools.require("devtools/server/actors/canvas");
|
|
let { setTimeout } = devtools.require("sdk/timers");
|
|
let TiltGL = devtools.require("devtools/tilt/tilt-gl");
|
|
let TargetFactory = devtools.TargetFactory;
|
|
let Toolbox = devtools.Toolbox;
|
|
let mm = null
|
|
|
|
const FRAME_SCRIPT_UTILS_URL = "chrome://global/content/devtools/frame-script-utils.js";
|
|
const EXAMPLE_URL = "http://example.com/browser/browser/devtools/canvasdebugger/test/";
|
|
const SET_TIMEOUT_URL = EXAMPLE_URL + "doc_settimeout.html";
|
|
const NO_CANVAS_URL = EXAMPLE_URL + "doc_no-canvas.html";
|
|
const SIMPLE_CANVAS_URL = EXAMPLE_URL + "doc_simple-canvas.html";
|
|
const SIMPLE_BITMASKS_URL = EXAMPLE_URL + "doc_simple-canvas-bitmasks.html";
|
|
const SIMPLE_CANVAS_TRANSPARENT_URL = EXAMPLE_URL + "doc_simple-canvas-transparent.html";
|
|
const SIMPLE_CANVAS_DEEP_STACK_URL = EXAMPLE_URL + "doc_simple-canvas-deep-stack.html";
|
|
const WEBGL_ENUM_URL = EXAMPLE_URL + "doc_webgl-enum.html";
|
|
const WEBGL_BINDINGS_URL = EXAMPLE_URL + "doc_webgl-bindings.html";
|
|
const RAF_BEGIN_URL = EXAMPLE_URL + "doc_raf-begin.html";
|
|
|
|
// All tests are asynchronous.
|
|
waitForExplicitFinish();
|
|
|
|
let gToolEnabled = Services.prefs.getBoolPref("devtools.canvasdebugger.enabled");
|
|
|
|
gDevTools.testing = true;
|
|
|
|
registerCleanupFunction(() => {
|
|
info("finish() was called, cleaning up...");
|
|
Services.prefs.setBoolPref("devtools.debugger.log", gEnableLogging);
|
|
Services.prefs.setBoolPref("devtools.canvasdebugger.enabled", gToolEnabled);
|
|
|
|
// Some of yhese tests use a lot of memory due to GL contexts, so force a GC
|
|
// to help fragmentation.
|
|
info("Forcing GC after canvas debugger test.");
|
|
Cu.forceGC();
|
|
});
|
|
|
|
/**
|
|
* Call manually in tests that use frame script utils after initializing
|
|
* the shader editor. Call after init but before navigating to different pages.
|
|
*/
|
|
function loadFrameScripts () {
|
|
mm = gBrowser.selectedBrowser.messageManager;
|
|
mm.loadFrameScript(FRAME_SCRIPT_UTILS_URL, false);
|
|
}
|
|
|
|
function addTab(aUrl, aWindow) {
|
|
info("Adding tab: " + aUrl);
|
|
|
|
let deferred = promise.defer();
|
|
let targetWindow = aWindow || window;
|
|
let targetBrowser = targetWindow.gBrowser;
|
|
|
|
targetWindow.focus();
|
|
let tab = targetBrowser.selectedTab = targetBrowser.addTab(aUrl);
|
|
let linkedBrowser = tab.linkedBrowser;
|
|
|
|
linkedBrowser.addEventListener("load", function onLoad() {
|
|
linkedBrowser.removeEventListener("load", onLoad, true);
|
|
info("Tab added and finished loading: " + aUrl);
|
|
deferred.resolve(tab);
|
|
}, true);
|
|
|
|
return deferred.promise;
|
|
}
|
|
|
|
function removeTab(aTab, aWindow) {
|
|
info("Removing tab.");
|
|
|
|
let deferred = promise.defer();
|
|
let targetWindow = aWindow || window;
|
|
let targetBrowser = targetWindow.gBrowser;
|
|
let tabContainer = targetBrowser.tabContainer;
|
|
|
|
tabContainer.addEventListener("TabClose", function onClose(aEvent) {
|
|
tabContainer.removeEventListener("TabClose", onClose, false);
|
|
info("Tab removed and finished closing.");
|
|
deferred.resolve();
|
|
}, false);
|
|
|
|
targetBrowser.removeTab(aTab);
|
|
return deferred.promise;
|
|
}
|
|
|
|
function handleError(aError) {
|
|
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
|
|
finish();
|
|
}
|
|
|
|
let gRequiresWebGL = false;
|
|
|
|
function ifTestingSupported() {
|
|
ok(false, "You need to define a 'ifTestingSupported' function.");
|
|
finish();
|
|
}
|
|
|
|
function ifTestingUnsupported() {
|
|
todo(false, "Skipping test because some required functionality isn't supported.");
|
|
finish();
|
|
}
|
|
|
|
function test() {
|
|
let generator = isTestingSupported() ? ifTestingSupported : ifTestingUnsupported;
|
|
Task.spawn(generator).then(null, handleError);
|
|
}
|
|
|
|
function createCanvas() {
|
|
return document.createElementNS("http://www.w3.org/1999/xhtml", "canvas");
|
|
}
|
|
|
|
function isTestingSupported() {
|
|
if (!gRequiresWebGL) {
|
|
info("This test does not require WebGL support.");
|
|
return true;
|
|
}
|
|
|
|
let supported =
|
|
!TiltGL.isWebGLForceEnabled() &&
|
|
TiltGL.isWebGLSupported() &&
|
|
TiltGL.create3DContext(createCanvas());
|
|
|
|
info("This test requires WebGL support.");
|
|
info("Apparently, WebGL is" + (supported ? "" : " not") + " supported.");
|
|
return supported;
|
|
}
|
|
|
|
function once(aTarget, aEventName, aUseCapture = false) {
|
|
info("Waiting for event: '" + aEventName + "' on " + aTarget + ".");
|
|
|
|
let deferred = promise.defer();
|
|
|
|
for (let [add, remove] of [
|
|
["on", "off"], // Use event emitter before DOM events for consistency
|
|
["addEventListener", "removeEventListener"],
|
|
["addListener", "removeListener"]
|
|
]) {
|
|
if ((add in aTarget) && (remove in aTarget)) {
|
|
aTarget[add](aEventName, function onEvent(...aArgs) {
|
|
aTarget[remove](aEventName, onEvent, aUseCapture);
|
|
deferred.resolve(...aArgs);
|
|
}, aUseCapture);
|
|
break;
|
|
}
|
|
}
|
|
|
|
return deferred.promise;
|
|
}
|
|
|
|
function waitForTick() {
|
|
let deferred = promise.defer();
|
|
executeSoon(deferred.resolve);
|
|
return deferred.promise;
|
|
}
|
|
|
|
function navigateInHistory(aTarget, aDirection, aWaitForTargetEvent = "navigate") {
|
|
executeSoon(() => content.history[aDirection]());
|
|
return once(aTarget, aWaitForTargetEvent);
|
|
}
|
|
|
|
function navigate(aTarget, aUrl, aWaitForTargetEvent = "navigate") {
|
|
executeSoon(() => aTarget.activeTab.navigateTo(aUrl));
|
|
return once(aTarget, aWaitForTargetEvent);
|
|
}
|
|
|
|
function reload(aTarget, aWaitForTargetEvent = "navigate") {
|
|
executeSoon(() => aTarget.activeTab.reload());
|
|
return once(aTarget, aWaitForTargetEvent);
|
|
}
|
|
|
|
function initServer() {
|
|
if (!DebuggerServer.initialized) {
|
|
DebuggerServer.init();
|
|
DebuggerServer.addBrowserActors();
|
|
}
|
|
}
|
|
|
|
function initCallWatcherBackend(aUrl) {
|
|
info("Initializing a call watcher front.");
|
|
initServer();
|
|
|
|
return Task.spawn(function*() {
|
|
let tab = yield addTab(aUrl);
|
|
let target = TargetFactory.forTab(tab);
|
|
|
|
yield target.makeRemote();
|
|
|
|
let front = new CallWatcherFront(target.client, target.form);
|
|
return { target, front };
|
|
});
|
|
}
|
|
|
|
function initCanvasDebuggerBackend(aUrl) {
|
|
info("Initializing a canvas debugger front.");
|
|
initServer();
|
|
|
|
return Task.spawn(function*() {
|
|
let tab = yield addTab(aUrl);
|
|
let target = TargetFactory.forTab(tab);
|
|
|
|
yield target.makeRemote();
|
|
|
|
let front = new CanvasFront(target.client, target.form);
|
|
return { target, front };
|
|
});
|
|
}
|
|
|
|
function initCanvasDebuggerFrontend(aUrl) {
|
|
info("Initializing a canvas debugger pane.");
|
|
|
|
return Task.spawn(function*() {
|
|
let tab = yield addTab(aUrl);
|
|
let target = TargetFactory.forTab(tab);
|
|
|
|
yield target.makeRemote();
|
|
|
|
Services.prefs.setBoolPref("devtools.canvasdebugger.enabled", true);
|
|
let toolbox = yield gDevTools.showToolbox(target, "canvasdebugger");
|
|
let panel = toolbox.getCurrentPanel();
|
|
return { target, panel };
|
|
});
|
|
}
|
|
|
|
function teardown({target}) {
|
|
info("Destroying the specified canvas debugger.");
|
|
|
|
let {tab} = target;
|
|
return gDevTools.closeToolbox(target).then(() => {
|
|
removeTab(tab);
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Takes a string `script` and evaluates it directly in the content
|
|
* in potentially a different process.
|
|
*/
|
|
function evalInDebuggee (script) {
|
|
let deferred = promise.defer();
|
|
|
|
if (!mm) {
|
|
throw new Error("`loadFrameScripts()` must be called when using MessageManager.");
|
|
}
|
|
|
|
let id = generateUUID().toString();
|
|
mm.sendAsyncMessage("devtools:test:eval", { script: script, id: id });
|
|
mm.addMessageListener("devtools:test:eval:response", handler);
|
|
|
|
function handler ({ data }) {
|
|
if (id !== data.id) {
|
|
return;
|
|
}
|
|
|
|
mm.removeMessageListener("devtools:test:eval:response", handler);
|
|
deferred.resolve(data.value);
|
|
}
|
|
|
|
return deferred.promise;
|
|
}
|
|
|
|
function getSourceActor(aSources, aURL) {
|
|
let item = aSources.getItemForAttachment(a => a.source.url === aURL);
|
|
return item ? item.value : null;
|
|
}
|
|
|
|
/**
|
|
* Waits until a predicate returns true.
|
|
*
|
|
* @param function predicate
|
|
* Invoked once in a while until it returns true.
|
|
* @param number interval [optional]
|
|
* How often the predicate is invoked, in milliseconds.
|
|
*/
|
|
function *waitUntil (predicate, interval = 10) {
|
|
if (yield predicate()) {
|
|
return Promise.resolve(true);
|
|
}
|
|
let deferred = Promise.defer();
|
|
setTimeout(function() {
|
|
waitUntil(predicate).then(() => deferred.resolve(true));
|
|
}, interval);
|
|
return deferred.promise;
|
|
}
|