Bug 1189057 - [promise-dbg] Add initial boilerplate for initializing the promise debugger iframe r=fitzgen

This commit is contained in:
Gabriel Luong 2015-07-30 00:13:26 -07:00
parent 38ac63e185
commit 8267b9134d
18 changed files with 117 additions and 0 deletions

View File

@ -30,6 +30,8 @@ const SEARCH_AUTOFILL = [SEARCH_GLOBAL_FLAG, SEARCH_FUNCTION_FLAG, SEARCH_TOKEN_
const EDITOR_VARIABLE_HOVER_DELAY = 750; // ms
const EDITOR_VARIABLE_POPUP_POSITION = "topcenter bottomleft";
const TOOLBAR_ORDER_POPUP_POSITION = "topcenter bottomleft";
const PROMISE_DEBUGGER_URL =
"chrome://browser/content/devtools/promisedebugger/promise-debugger.xhtml";
/**
* Object defining the debugger view components.
@ -93,6 +95,7 @@ let DebuggerView = {
this.WatchExpressions.destroy();
this.EventListeners.destroy();
this.GlobalSearch.destroy();
this._destroyPromiseDebugger();
this._destroyPanes();
this._destroyEditor(deferred.resolve);
@ -194,6 +197,28 @@ let DebuggerView = {
});
},
/**
* Initialie the Promise Debugger instance.
*/
_initializePromiseDebugger: function() {
let iframe = this._promiseDebuggerIframe = document.createElement("iframe");
iframe.setAttribute("flex", 1);
iframe.setAttribute("src", PROMISE_DEBUGGER_URL);
this._promisePane.appendChild(iframe);
},
/**
* Destroy the Promise Debugger instance.
*/
_destroyPromiseDebugger: function() {
if (this._promiseDebuggerIframe) {
this._promiseDebuggerIframe.parentNode.removeChild(
this._promiseDebuggerIframe);
this._promiseDebuggerIframe = null;
}
},
/**
* Initializes the Editor instance.
*

View File

@ -664,6 +664,8 @@ SourcesView.prototype = Heritage.extend(WidgetMethods, {
if (Prefs.promiseDebuggerEnabled) {
let promisePane = this.DebuggerView._promisePane;
promisePane.hidden = !promisePane.hidden;
this.DebuggerView._initializePromiseDebugger();
}
},

View File

@ -113,6 +113,8 @@ browser.jar:
content/browser/devtools/performance/views/optimizations-list.js (performance/views/optimizations-list.js)
content/browser/devtools/performance/views/frames-list.js (performance/views/frames-list.js)
content/browser/devtools/performance/views/recordings.js (performance/views/recordings.js)
content/browser/devtools/promisedebugger/promise-debugger.js (promisedebugger/promise-debugger.js)
content/browser/devtools/promisedebugger/promise-debugger.xhtml (promisedebugger/promise-debugger.xhtml)
content/browser/devtools/commandline.css (commandline/commandline.css)
content/browser/devtools/commandlineoutput.xhtml (commandline/commandlineoutput.xhtml)
content/browser/devtools/commandlinetooltip.xhtml (commandline/commandlinetooltip.xhtml)

View File

@ -19,6 +19,7 @@ DIRS += [
'netmonitor',
'performance',
'projecteditor',
'promisedebugger',
'responsivedesign',
'scratchpad',
'shadereditor',

View File

@ -0,0 +1,11 @@
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
BROWSER_CHROME_MANIFESTS += ['test/browser.ini']
EXTRA_JS_MODULES.devtools.promisedebugger += [
'promise-debugger.js'
]

View File

@ -0,0 +1,7 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- This Source Code Form is subject to the terms of the Mkozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!DOCTYPE html [
<!ENTITY % promisedebuggerDTD SYSTEM "chrome://browser/locale/devtools/promisedebugger.dtd">
%promisedebuggerDTD;
]>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>&title;</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="stylesheet" href="chrome://browser/skin/devtools/common.css" type="text/css"/>
<link rel="stylesheet" href="chrome://browser/skin/devtools/promisedebugger.css" type="text/css"/>
<script type="application/javascript;version=1.8" src="chrome://browser/content/devtools/theme-switching.js"/>
</head>
<body class="devtools-monospace" role="application">
<script type="application/javascript;version=1.8" src="promise-debugger.js"></script>
</body>
</html>

View File

@ -0,0 +1,4 @@
{
// Extend from the shared list of defined globals for mochitests.
"extends": "../../.eslintrc.mochitests"
}

View File

@ -0,0 +1,5 @@
[DEFAULT]
tags = devtools
subsuite = devtools
support-files =
head.js

View File

@ -0,0 +1,4 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";

View File

@ -0,0 +1,15 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!-- LOCALIZATION NOTE : FILE This file contains the Promise debugger panel
strings. The Promise debugger panel is part of the debugger -->
<!-- LOCALIZATION NOTE : FILE Do not translate commandkey -->
<!-- LOCALIZATION NOTE : FILE The correct localization of this file might be to
- keep it in English, or another language commonly spoken among web developers.
- You want to make that choice consistent across the developer tools.
- A good criteria is the language in which you'd find the best
- documentation on web development on the web. -->
<!ENTITY title "Promise Debugger">

View File

@ -0,0 +1,11 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# LOCALIZATION NOTE These strings are used inside the Promise debugger
# which is available as a panel in the Debugger.
# The correct localization of this file might be to keep it in
# English, or another language commonly spoken among web developers.
# You want to make that choice consistent across the developer tools.
# A good criteria is the language in which you'd find the best
# documentation on web development on the web.

View File

@ -61,6 +61,8 @@
locale/browser/devtools/sourceeditor.dtd (%chrome/browser/devtools/sourceeditor.dtd)
locale/browser/devtools/profiler.dtd (%chrome/browser/devtools/profiler.dtd)
locale/browser/devtools/profiler.properties (%chrome/browser/devtools/profiler.properties)
locale/browser/devtools/promisedebugger.dtd (%chrome/browser/devtools/promisedebugger.dtd)
locale/browser/devtools/promisedebugger.properties (%chrome/browser/devtools/promisedebugger.properties)
locale/browser/devtools/layoutview.dtd (%chrome/browser/devtools/layoutview.dtd)
locale/browser/devtools/responsiveUI.properties (%chrome/browser/devtools/responsiveUI.properties)
locale/browser/devtools/toolbox.dtd (%chrome/browser/devtools/toolbox.dtd)

View File

@ -338,6 +338,7 @@ browser.jar:
skin/classic/browser/devtools/eyedropper.css (../shared/devtools/eyedropper.css)
* skin/classic/browser/devtools/netmonitor.css (devtools/netmonitor.css)
* skin/classic/browser/devtools/performance.css (devtools/performance.css)
skin/classic/browser/devtools/promisedebugger.css (../shared/devtools/promisedebugger.css)
skin/classic/browser/devtools/timeline-filter.svg (../shared/devtools/images/timeline-filter.svg)
* skin/classic/browser/devtools/scratchpad.css (devtools/scratchpad.css)
* skin/classic/browser/devtools/shadereditor.css (devtools/shadereditor.css)

View File

@ -440,6 +440,7 @@ browser.jar:
skin/classic/browser/devtools/eyedropper.css (../shared/devtools/eyedropper.css)
* skin/classic/browser/devtools/netmonitor.css (devtools/netmonitor.css)
* skin/classic/browser/devtools/performance.css (devtools/performance.css)
skin/classic/browser/devtools/promisedebugger.css (../shared/devtools/promisedebugger.css)
skin/classic/browser/devtools/timeline-filter.svg (../shared/devtools/images/timeline-filter.svg)
* skin/classic/browser/devtools/scratchpad.css (devtools/scratchpad.css)
* skin/classic/browser/devtools/shadereditor.css (devtools/shadereditor.css)

View File

@ -0,0 +1,3 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

View File

@ -453,6 +453,7 @@ browser.jar:
* skin/classic/browser/devtools/debugger.css (devtools/debugger.css)
* skin/classic/browser/devtools/netmonitor.css (devtools/netmonitor.css)
* skin/classic/browser/devtools/performance.css (devtools/performance.css)
skin/classic/browser/devtools/promisedebugger.css (../shared/devtools/promisedebugger.css)
skin/classic/browser/devtools/timeline-filter.svg (../shared/devtools/images/timeline-filter.svg)
* skin/classic/browser/devtools/scratchpad.css (devtools/scratchpad.css)
* skin/classic/browser/devtools/shadereditor.css (devtools/shadereditor.css)