Bug 898472 - Give Browser Debugger window a title. r=vp

This commit is contained in:
Sunny 2013-10-11 15:09:00 -07:00
Родитель b50c8eda8f
Коммит f3e72cf12c
4 изменённых файлов: 20 добавлений и 0 удалений

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

@ -685,6 +685,11 @@ SourcesView.prototype = Heritage.extend(WidgetMethods, {
}
// The container is not empty and an actual item was selected.
DebuggerView.setEditorLocation(sourceItem.value);
// Set window title.
let script = sourceItem.value.split(" -> ").pop();
document.title = L10N.getFormatStr("DebuggerWindowScriptTitle", script);
this.maybeShowBlackBoxMessage();
},

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

@ -68,6 +68,7 @@ let DebuggerView = {
this.GlobalSearch.initialize();
this._initializeVariablesView();
this._initializeEditor(deferred.resolve);
document.title = L10N.getStr("DebuggerWindowTitle");
return deferred.promise;
},

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

@ -19,6 +19,9 @@ function test() {
gEditor = gDebugger.DebuggerView.editor;
gSources = gDebugger.DebuggerView.Sources;
ok(gDebugger.document.title.endsWith(EXAMPLE_URL + gLabel1),
"Title with first source is correct.");
waitForSourceAndCaretAndScopes(gPanel, "-02.js", 6)
.then(testSourcesDisplay)
.then(testSwitchPaused1)
@ -64,6 +67,9 @@ function testSourcesDisplay() {
is(gEditor.getText().search(/debugger/), 172,
"The second source is displayed.");
ok(gDebugger.document.title.endsWith(EXAMPLE_URL + gLabel2),
"Title with second source is correct.");
ok(isCaretPos(gPanel, 6),
"Editor caret location is correct.");

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

@ -15,6 +15,14 @@
# displayed inside the developer tools window and in the Developer Tools Menu.
ToolboxDebugger.label=Debugger
# LOCALIZATION NOTE (DebuggerWindowTitle):
# The title displayed for the debugger window.
DebuggerWindowTitle=Browser Debugger
# LOCALIZATION NOTE (DebuggerWindowScriptTitle):
# The title displayed for the debugger window when a script is selected.
DebuggerWindowScriptTitle=Browser Debugger - %S
# LOCALIZATION NOTE (ToolboxDebugger.tooltip):
# This string is displayed in the tooltip of the tab when the debugger is
# displayed inside the developer tools window..