mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1211017 - Show URL as the title in worker toolboxes;r=ejpbruel
This commit is contained in:
parent
e370026454
commit
2e32a39a26
@ -567,6 +567,8 @@ skip-if = e10s && debug
|
||||
skip-if = e10s && debug
|
||||
[browser_dbg_watch-expressions-02.js]
|
||||
skip-if = e10s && debug
|
||||
[browser_dbg_worker-window.js]
|
||||
skip-if = e10s && debug
|
||||
[browser_dbg_WorkerActor.attach.js]
|
||||
skip-if = e10s && debug
|
||||
[browser_dbg_WorkerActor.attachThread.js]
|
||||
|
@ -0,0 +1,43 @@
|
||||
// Check to make sure that a worker can be attached to a toolbox
|
||||
// directly, and that the toolbox has expected properties.
|
||||
|
||||
var TAB_URL = EXAMPLE_URL + "doc_WorkerActor.attachThread-tab.html";
|
||||
var WORKER_URL = "code_WorkerActor.attachThread-worker.js";
|
||||
|
||||
add_task(function* () {
|
||||
DebuggerServer.init();
|
||||
DebuggerServer.addBrowserActors();
|
||||
|
||||
let client = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
yield connect(client);
|
||||
|
||||
let tab = yield addTab(TAB_URL);
|
||||
let { tabs } = yield listTabs(client);
|
||||
let [, tabClient] = yield attachTab(client, findTab(tabs, TAB_URL));
|
||||
|
||||
yield listWorkers(tabClient);
|
||||
yield createWorkerInTab(tab, WORKER_URL);
|
||||
|
||||
let { workers } = yield listWorkers(tabClient);
|
||||
let [, workerClient] = yield attachWorker(tabClient,
|
||||
findWorker(workers, WORKER_URL));
|
||||
|
||||
let toolbox = yield gDevTools.showToolbox(TargetFactory.forWorker(workerClient),
|
||||
"jsdebugger",
|
||||
Toolbox.HostType.WINDOW);
|
||||
|
||||
is(toolbox._host.type, "window", "correct host");
|
||||
ok(toolbox._host._window.document.title.contains(WORKER_URL),
|
||||
"worker URL in host title");
|
||||
|
||||
let toolTabs = toolbox.doc.querySelectorAll(".devtools-tab");
|
||||
let activeTools = [...toolTabs].map(tab=>tab.getAttribute("toolid"));
|
||||
|
||||
is(activeTools.join(","), "webconsole,jsdebugger,scratchpad,options",
|
||||
"Correct set of tools supported by worker");
|
||||
|
||||
yield gDevTools.closeToolbox(TargetFactory.forWorker(workerClient));
|
||||
terminateWorkerInTab(tab, WORKER_URL);
|
||||
yield waitForWorkerClose(workerClient);
|
||||
yield close(client);
|
||||
});
|
@ -856,6 +856,10 @@ WorkerTarget.prototype = {
|
||||
return true;
|
||||
},
|
||||
|
||||
get url() {
|
||||
return this._workerClient.url;
|
||||
},
|
||||
|
||||
get form() {
|
||||
return {
|
||||
from: this._workerClient.actor,
|
||||
|
@ -1493,10 +1493,8 @@ Toolbox.prototype = {
|
||||
toolName = toolboxStrings("toolbox.defaultTitle");
|
||||
}
|
||||
let title = toolboxStrings("toolbox.titleTemplate",
|
||||
toolName,
|
||||
this.target.isAddon ?
|
||||
this.target.name :
|
||||
this.target.url || this.target.name);
|
||||
toolName, this.target.name ||
|
||||
this.target.url);
|
||||
this._host.setTitle(title);
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user