merge fx-team to mozilla-central a=merge

This commit is contained in:
Carsten "Tomcat" Book 2016-02-17 12:07:39 +01:00
commit a34e30bba2
317 changed files with 3555 additions and 1340 deletions

View File

@ -187,8 +187,8 @@ toolkit/components/osfile/**
toolkit/components/passwordmgr/**
# Uses preprocessing
toolkit/content/contentAreaUtils.js
toolkit/content/widgets/videocontrols.xml
toolkit/content/widgets/wizard.xml
toolkit/components/jsdownloads/src/DownloadIntegration.jsm
toolkit/components/search/nsSearchService.js
toolkit/components/url-classifier/**

View File

@ -4,9 +4,7 @@
"mozilla"
],
"rules": {
"mozilla/components-imports": 1,
"mozilla/import-globals-from": 1,
"mozilla/this-top-level-scope": 1,
"mozilla/import-globals": 1,
},
"env": {
"es6": true

View File

@ -47,18 +47,32 @@ function execute (queries, options) {
return new Promise(resolve => {
let root = historyService
.executeQueries(queries, queries.length, options).root;
resolve(collect([], root));
// Let's extract an eventual uri wildcard, if both domain and uri are set.
// See utils.js::urlQueryParser() for more details.
// In case of multiple queries, we only retain the first found wildcard.
let uriWildcard = queries.reduce((prev, query) => {
if (query.uri && query.domain) {
if (!prev)
prev = query.uri.spec;
query.uri = null;
}
return prev;
}, "");
resolve(collect([], root, uriWildcard));
});
}
function collect (acc, node) {
function collect (acc, node, uriWildcard) {
node.containerOpen = true;
for (let i = 0; i < node.childCount; i++) {
let child = node.getChild(i);
if (!uriWildcard || child.uri.startsWith(uriWildcard)) {
acc.push(child);
}
if (child.type === child.RESULT_TYPE_FOLDER) {
let container = child.QueryInterface(Ci.nsINavHistoryContainerResultNode);
collect(acc, container);
collect(acc, container, uriWildcard);
}
}
node.containerOpen = false;

View File

@ -12,7 +12,7 @@ module.metadata = {
}
};
const { Cc, Ci } = require('chrome');
const { Cc, Ci, Cu } = require('chrome');
const { Class } = require('../core/heritage');
const { method } = require('../lang/functional');
const { defer, promised, all } = require('../core/promise');
@ -22,6 +22,8 @@ const { merge } = require('../util/object');
const bmsrv = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
getService(Ci.nsINavBookmarksService);
Cu.importGlobalProperties(["URL"]);
/*
* TreeNodes are used to construct dependency trees
* for BookmarkItems
@ -128,9 +130,9 @@ exports.isRootGroup = isRootGroup;
* --> 'http://moz.com', 'http://moz.com/thunderbird'
* '*.moz.com' // domain: moz.com, domainIsHost: false
* --> 'http://moz.com', 'http://moz.com/index', 'http://ff.moz.com/test'
* 'http://moz.com' // url: http://moz.com/, urlIsPrefix: false
* 'http://moz.com' // uri: http://moz.com/
* --> 'http://moz.com/'
* 'http://moz.com/*' // url: http://moz.com/, urlIsPrefix: true
* 'http://moz.com/*' // uri: http://moz.com/, domain: moz.com, domainIsHost: true
* --> 'http://moz.com/', 'http://moz.com/thunderbird'
*/
@ -139,8 +141,21 @@ function urlQueryParser (query, url) {
if (/^https?:\/\//.test(url)) {
query.uri = url.charAt(url.length - 1) === '/' ? url : url + '/';
if (/\*$/.test(url)) {
query.uri = url.replace(/\*$/, '');
query.uriIsPrefix = true;
// Wildcard searches on URIs are not supported, so try to extract a
// domain and filter the data later.
url = url.replace(/\*$/, '');
try {
query.domain = new URL(url).hostname;
query.domainIsHost = true;
// Unfortunately here we cannot use an expando to store the wildcard,
// cause the query is a wrapped native XPCOM object, so we reuse uri.
// We clearly don't want to query for both uri and domain, thus we'll
// have to handle this in host-query.js::execute()
query.uri = url;
} catch (ex) {
// Cannot extract an host cause it's not a valid uri, the query will
// just return nothing.
}
}
} else {
if (/^\*/.test(url)) {

View File

@ -453,8 +453,8 @@
key="bookmarkAllTabsKb"/>
<menuseparator/>
<menuitem label="&recentBookmarks.label;"
id="menu_recentBookmarks"
disabled="true"/>
<vbox id="menu_recentBookmarks"/>
<menuseparator id="bookmarksToolbarSeparator"/>
<menu id="bookmarksToolbarFolderMenu"
class="menu-iconic bookmark-item"

View File

@ -1341,7 +1341,7 @@ var BookmarkingUI = {
});
},
_updateRecentBookmarks: function(container, extraCSSClass = "") {
_updateRecentBookmarks: function(aHeaderItem, extraCSSClass = "") {
const kMaxResults = 5;
let options = PlacesUtils.history.getNewQueryOptions();
@ -1351,8 +1351,9 @@ var BookmarkingUI = {
options.maxResults = kMaxResults;
let query = PlacesUtils.history.getNewQuery();
while (container.firstChild) {
container.firstChild.remove();
while (aHeaderItem.nextSibling &&
aHeaderItem.nextSibling.localName == "menuitem") {
aHeaderItem.nextSibling.remove();
}
PlacesUtils.history.QueryInterface(Ci.nsPIPlacesDatabase)
@ -1385,7 +1386,7 @@ var BookmarkingUI = {
}
fragment.appendChild(item);
}
container.appendChild(fragment);
aHeaderItem.parentNode.insertBefore(fragment, aHeaderItem.nextSibling);
},
handleError: function (aError) {
Cu.reportError("Error while attempting to show recent bookmarks: " + aError);

View File

@ -83,6 +83,7 @@ if (AppConstants.platform != "macosx") {
var gEditUIVisible = true;
}
/*globals gBrowser, gNavToolbox, gURLBar, gNavigatorBundle*/
[
["gBrowser", "content"],
["gNavToolbox", "navigator-toolbox"],
@ -157,9 +158,9 @@ XPCOMUtils.defineLazyGetter(this, "PopupNotifications", function () {
});
XPCOMUtils.defineLazyGetter(this, "DeveloperToolbar", function() {
let tmp = {};
Cu.import("resource://devtools/client/shared/DeveloperToolbar.jsm", tmp);
return new tmp.DeveloperToolbar(window, document.getElementById("developer-toolbar"));
let { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
let { DeveloperToolbar } = require("devtools/client/shared/developer-toolbar");
return new DeveloperToolbar(window, document.getElementById("developer-toolbar"));
});
XPCOMUtils.defineLazyGetter(this, "BrowserToolboxProcess", function() {

View File

@ -813,9 +813,9 @@
key="manBookmarkKb"/>
<menuseparator/>
<menuitem label="&recentBookmarks.label;"
id="BMB_recentBookmarks"
disabled="true"
class="subviewbutton"/>
<vbox id="BMB_recentBookmarks"/>
<menuseparator/>
<menu id="BMB_bookmarksToolbar"
class="menu-iconic bookmark-item subviewbutton"

View File

@ -1863,8 +1863,7 @@
}, 0, this.tabContainer);
}
// invalidate caches
this._browsers = null;
// invalidate cache
this._visibleTabs = null;
this.tabContainer.appendChild(t);
@ -2379,10 +2378,6 @@
var wasPinned = aTab.pinned;
// Invalidate browsers cache, as the tab is removed from the
// tab container.
this._browsers = null;
// Remove the tab ...
this.tabContainer.removeChild(aTab);
@ -2860,15 +2855,32 @@
onget="return this.mCurrentBrowser;"
readonly="true"/>
<property name="browsers" readonly="true">
<getter>
<field name="browsers" readonly="true">
<![CDATA[
return this._browsers ||
(this._browsers = Array.map(this.tabs, tab => tab.linkedBrowser));
// This defines a proxy which allows us to access browsers by
// index without actually creating a full array of browsers.
new Proxy([], {
has: (target, name) => {
if (typeof name == "string" && Number.isInteger(parseInt(name))) {
return (name in this.tabs);
}
return false;
},
get: (target, name) => {
if (name == "length") {
return this.tabs.length;
}
if (typeof name == "string" && Number.isInteger(parseInt(name))) {
if (!(name in this.tabs)) {
return undefined;
}
return this.tabs[name].linkedBrowser;
}
return target[name];
}
});
]]>
</getter>
</property>
<field name="_browsers">null</field>
</field>
<!-- Moves a tab to a new browser window, unless it's already the only tab
in the current window, in which case this will do nothing. -->
@ -2929,8 +2941,7 @@
this.mCurrentTab._logicallySelected = false;
this.mCurrentTab._visuallySelected = false;
// invalidate caches
this._browsers = null;
// invalidate cache
this._visibleTabs = null;
// use .item() instead of [] because dragging to the end of the strip goes out of

View File

@ -136,7 +136,6 @@ skip-if = e10s # Bug 1093153 - no about:home support yet
[browser_action_searchengine_alias.js]
[browser_addKeywordSearch.js]
[browser_search_favicon.js]
skip-if = e10s # Bug 1212647
[browser_alltabslistener.js]
[browser_audioTabIcon.js]
[browser_autocomplete_a11y_label.js]
@ -290,8 +289,6 @@ skip-if = os == 'win' || e10s # Bug 1159268 - Need a content-process safe versio
skip-if = e10s # Bug 1094510 - test hits the network in e10s mode only
[browser_clipboard.js]
[browser_contentAreaClick.js]
[browser_contextSearchTabPosition.js]
skip-if = os == "mac" || e10s # bug 967013; e10s: bug 1094761 - test hits the network in e10s, causing next test to crash
[browser_ctrlTab.js]
[browser_datachoices_notification.js]
skip-if = !datareporting

View File

@ -111,7 +111,9 @@ extensions.registerSchemaAPI("bookmarks", "bookmarks", (extension, context) => {
return getTree(id, false);
},
// search
search: function(query) {
return Bookmarks.search(query).then(result => result.map(convert));
},
create: function(bookmark) {
let info = {

View File

@ -234,7 +234,6 @@
},
{
"name": "search",
"unsupported": true,
"type": "function",
"description": "Searches for BookmarkTreeNodes matching the given query. Queries specified with an object produce BookmarkTreeNodes matching all specified properties.",
"async": "callback",
@ -258,6 +257,7 @@
},
"url": {
"type": "string",
"format": "url",
"optional": true,
"description": "The URL of the bookmark; matches verbatim. Note that folders have no URL."
},

View File

@ -34,43 +34,43 @@ add_task(function* testDetailsObjects() {
{details: {"path": "a.png"},
resolutions: {
"1": browser.runtime.getURL("data/a.png"),
"2": browser.runtime.getURL("data/a.png"), } },
"2": browser.runtime.getURL("data/a.png")}},
{details: {"path": "/a.png"},
resolutions: {
"1": browser.runtime.getURL("a.png"),
"2": browser.runtime.getURL("a.png"), } },
"2": browser.runtime.getURL("a.png")}},
{details: {"path": {"19": "a.png"}},
resolutions: {
"1": browser.runtime.getURL("data/a.png"),
"2": browser.runtime.getURL("data/a.png"), } },
"2": browser.runtime.getURL("data/a.png")}},
{details: {"path": {"38": "a.png"}},
resolutions: {
"1": browser.runtime.getURL("data/a.png"),
"2": browser.runtime.getURL("data/a.png"), } },
"2": browser.runtime.getURL("data/a.png")}},
{details: {"path": {"19": "a.png", "38": "a-x2.png"}},
resolutions: {
"1": browser.runtime.getURL("data/a.png"),
"2": browser.runtime.getURL("data/a-x2.png"), } },
"2": browser.runtime.getURL("data/a-x2.png")}},
// Only ImageData objects.
{details: {"imageData": imageData.red.imageData},
resolutions: {
"1": imageData.red.url,
"2": imageData.red.url, } },
"2": imageData.red.url}},
{details: {"imageData": {"19": imageData.red.imageData}},
resolutions: {
"1": imageData.red.url,
"2": imageData.red.url, } },
"2": imageData.red.url}},
{details: {"imageData": {"38": imageData.red.imageData}},
resolutions: {
"1": imageData.red.url,
"2": imageData.red.url, } },
"2": imageData.red.url}},
{details: {"imageData": {
"19": imageData.red.imageData,
"38": imageData.green.imageData}},
resolutions: {
"1": imageData.red.url,
"2": imageData.green.url, } },
"2": imageData.green.url}},
// Mixed path and imageData objects.
//
@ -81,13 +81,13 @@ add_task(function* testDetailsObjects() {
"imageData": {"38": imageData.red.imageData}},
resolutions: {
"1": browser.runtime.getURL("data/a.png"),
"2": imageData.red.url, } },
"2": imageData.red.url}},
{details: {
"path": {"38": "a.png"},
"imageData": {"19": imageData.red.imageData}},
resolutions: {
"1": imageData.red.url,
"2": browser.runtime.getURL("data/a.png"), } },
"2": browser.runtime.getURL("data/a.png")}},
// A path or ImageData object by itself is treated as a 19px icon.
{details: {
@ -95,27 +95,27 @@ add_task(function* testDetailsObjects() {
"imageData": {"38": imageData.red.imageData}},
resolutions: {
"1": browser.runtime.getURL("data/a.png"),
"2": imageData.red.url, } },
"2": imageData.red.url}},
{details: {
"path": {"38": "a.png"},
"imageData": imageData.red.imageData, },
"imageData": imageData.red.imageData},
resolutions: {
"1": imageData.red.url,
"2": browser.runtime.getURL("data/a.png"), } },
"2": browser.runtime.getURL("data/a.png")}},
// Various resolutions
{details: {"path": {"18": "a.png", "32": "a-x2.png"}},
resolutions: {
"1": browser.runtime.getURL("data/a.png"),
"2": browser.runtime.getURL("data/a-x2.png"), } },
"2": browser.runtime.getURL("data/a-x2.png")}},
{details: {"path": {"16": "16.png", "100": "100.png"}},
resolutions: {
"1": browser.runtime.getURL("data/100.png"),
"2": browser.runtime.getURL("data/100.png"), } },
"2": browser.runtime.getURL("data/100.png")}},
{details: {"path": {"2": "2.png"}},
resolutions: {
"1": browser.runtime.getURL("data/2.png"),
"2": browser.runtime.getURL("data/2.png"), } },
"2": browser.runtime.getURL("data/2.png")}},
{details: {"path": {
"6": "6.png",
"18": "18.png",
@ -124,7 +124,7 @@ add_task(function* testDetailsObjects() {
"128": "128.png"}},
resolutions: {
"1": browser.runtime.getURL("data/18.png"),
"2": browser.runtime.getURL("data/48.png"), } },
"2": browser.runtime.getURL("data/48.png")}},
];
// Allow serializing ImageData objects for logging.

View File

@ -21,6 +21,8 @@ support-files =
[browser_bing.js]
[browser_bing_behavior.js]
[browser_contextmenu.js]
[browser_contextSearchTabPosition.js]
skip-if = os == "mac" # bug 967013
[browser_eBay.js]
[browser_eBay_behavior.js]
[browser_google.js]

View File

@ -3,12 +3,10 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
add_task(function* test() {
// Will need to be changed if Google isn't the default search engine.
// Note: geoSpecificDefaults are disabled for mochitests, so this is the
// non-US en-US default.
let histogramKey = "google.contextmenu";
let engine = yield promiseNewEngine("testEngine.xml");
let histogramKey = "other-" + engine.name + ".contextmenu";
let numSearchesBefore = 0;
try {
let hs = Services.telemetry.getKeyedHistogramById("SEARCH_COUNTS").snapshot();
if (histogramKey in hs) {
@ -19,7 +17,7 @@ add_task(function* test() {
}
let tabs = [];
let tabsLoadedDeferred = Promise.defer();
let tabsLoadedDeferred = new Deferred();
function tabAdded(event) {
let tab = event.target;
@ -54,3 +52,10 @@ add_task(function* test() {
Assert.equal(hs[histogramKey].sum, numSearchesBefore + 2,
"The histogram must contain the correct search count");
});
function Deferred() {
this.promise = new Promise((resolve, reject) => {
this.resolve = resolve;
this.reject = reject;
});
}

View File

@ -21,6 +21,8 @@ XPCOMUtils.defineLazyModuleGetter(this, "console",
"resource://gre/modules/Console.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PrivacyFilter",
"resource:///modules/sessionstore/PrivacyFilter.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "RunState",
"resource:///modules/sessionstore/RunState.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "SessionStore",
"resource:///modules/sessionstore/SessionStore.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "SessionFile",
@ -209,6 +211,19 @@ var SessionSaverInternal = {
}
}
// If this is the final write on a clean shutdown, and the user changed
// their cookie preferences to "Keep until I close Firefox", then we
// should remove all cookies. Check "resume_session_once" so we keep
// cookies when restarting due to a Firefox update.
if (RunState.isClosing &&
Services.prefs.getIntPref("network.cookie.lifetimePolicy") ==
Services.cookies.ACCEPT_SESSION &&
!Services.prefs.getBoolPref("browser.sessionstore.resume_session_once")) {
for (let window of state.windows) {
delete window.cookies;
}
}
stopWatchFinish("COLLECT_DATA_MS", "COLLECT_DATA_LONGEST_OP_MS");
return this._writeState(state);
},

View File

@ -1236,9 +1236,7 @@ var SessionStoreInternal = {
var tabbrowser = aWindow.gBrowser;
// The tabbrowser binding will go away once the window is closed,
// so we'll hold a reference to the browsers in the closure here.
let browsers = tabbrowser.browsers;
let browsers = Array.from(tabbrowser.browsers);
TAB_EVENTS.forEach(function(aEvent) {
tabbrowser.tabContainer.removeEventListener(aEvent, this, true);
@ -1320,7 +1318,6 @@ var SessionStoreInternal = {
// access any DOM elements from aWindow within this callback unless
// you're holding on to them in the closure.
// We can still access tabbrowser.browsers, thankfully.
for (let browser of browsers) {
if (this._closedWindowTabs.has(browser.permanentKey)) {
let tabData = this._closedWindowTabs.get(browser.permanentKey);

View File

@ -1,4 +1,3 @@
[DEFAULT]
[browser_bug538331.js]
skip-if = e10s # Bug ?????? - child process crash, but only when run as part of the suite (ie, probably not actually this tests fault!?)

View File

@ -361,11 +361,8 @@ function testShowNotification()
if (i == (BG_NOTIFY_TESTS.length - 1)) {
// Wait for any windows caught by the windowcatcher to close
gWindowCatcher.finish(function () {
BrowserTestUtils.waitForNewTab(gBrowser).then(testNotificationURL);
button.click();
gBrowser.selectedBrowser.addEventListener("load", function () {
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
testNotificationURL();
}, true);
});
} else {
notifyBox.removeAllNotifications(true);
@ -389,7 +386,7 @@ function testNotificationURL()
{
ok(true, "Test testNotificationURL: clicking the notification button " +
"opened the url specified by the update");
let href = gBrowser.selectedBrowser.contentWindow.location.href;
let href = gBrowser.currentURI.spec;
let expectedURL = BG_NOTIFY_TESTS[BG_NOTIFY_TESTS.length - 1].notificationURL;
is(href, expectedURL, "The url opened from the notification should be the " +
"url provided by the update");

View File

@ -9,7 +9,9 @@ allprojects {
}
repositories {
jcenter()
maven {
url gradle.mozconfig.substs.GRADLE_MAVEN_REPOSITORY
}
}
}
@ -17,8 +19,9 @@ buildDir "${topobjdir}/gradle/build"
buildscript {
repositories {
jcenter()
maven {
url gradle.mozconfig.substs.GRADLE_MAVEN_REPOSITORY
}
}
dependencies {

View File

@ -5252,12 +5252,56 @@ if test -n "$MOZ_OMX_PLUGIN"; then
fi
dnl ========================================================
dnl = Enable building mobile/android with Gradle
dnl Gradle support
dnl
dnl If --with-gradle is specified, build mobile/android with Gradle.
dnl
dnl If no Gradle binary is specified, use the in tree Gradle wrapper.
dnl The wrapper downloads and installs Gradle, which is good for local
dnl developers but not good in automation.
dnl ========================================================
MOZ_ARG_ENABLE_BOOL(gradle-mobile-android-builds,
[ --enable-gradle-mobile-android-builds Enable building mobile/android with Gradle],
MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE=1,
MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE=)
GRADLE=
MOZ_ARG_WITH_STRING(gradle,
[ --with-gradle=/path/to/bin/gradle
Enable building mobile/android with Gradle (argument: location of binary or wrapper (gradle/gradlew))],
if test "$withval" = "no" ; then
dnl --without-gradle => use the wrapper in |mach gradle|, don't build
dnl with Gradle by default.
GRADLE=$srcdir/gradlew
MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE=
elif test "$withval" = "yes" ; then
dnl --with-gradle => use the wrapper in |mach gradle|, build with
dnl Gradle by default.
GRADLE=$srcdir/gradlew
MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE=1
else
dnl --with-gradle=/path/to/gradle => use the given binary in |mach
dnl gradle|, build with Gradle by default.
GRADLE=$withval
MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE=1
fi
,
dnl No --with{out}-gradle => use the wrapper in |mach gradle|, don't build
dnl with Gradle by default.
GRADLE=$srcdir/gradlew
MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE=
)
if test "$OS_TARGET" = Android -a x"$MOZ_WIDGET_TOOLKIT" != x"gonk" ; then
if test -z "$GRADLE" -o ! -x "$GRADLE" ; then
AC_MSG_ERROR([The program gradlew/gradle was not found. Use --with-gradle=/path/to/bin/gradle}])
fi
fi
AC_SUBST(GRADLE)
dnl Path to Maven repository containing Gradle dependencies. Automation will
dnl set this to file:///path/to/local via the mozconfig. Local developer
dnl default is jcenter.
if test -z "$GRADLE_MAVEN_REPOSITORY" ; then
GRADLE_MAVEN_REPOSITORY=https://jcenter.bintray.com/
fi
AC_SUBST(GRADLE_MAVEN_REPOSITORY)
if test -n "$MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE"; then
if test "$OS_TARGET" = "Android" -a x"$MOZ_WIDGET_TOOLKIT" != x"gonk"; then

74
devtools/bootstrap.js vendored
View File

@ -79,11 +79,77 @@ function reload(event) {
// Ask the loader to update itself and reopen the toolbox if needed
const {devtools} = Cu.import("resource://devtools/shared/Loader.jsm", {});
devtools.reload(reloadToolbox);
devtools.reload();
// Also tells gDevTools to reload its dependencies
const {gDevTools} = devtools.require("devtools/client/framework/devtools");
gDevTools.reload();
// Go over all top level windows to reload all devtools related things
let windowsEnum = Services.wm.getEnumerator(null);
while (windowsEnum.hasMoreElements()) {
let window = windowsEnum.getNext();
let windowtype = window.document.documentElement.getAttribute("windowtype");
if (windowtype == "navigator:browser" && window.gBrowser) {
// Enumerate tabs on firefox windows
for (let tab of window.gBrowser.tabs) {
let browser = tab.linkedBrowser;
let location = browser.documentURI.spec;
let mm = browser.messageManager;
// To reload JSON-View tabs and any devtools document
if (location.startsWith("about:debugging") ||
location.startsWith("chrome://devtools/")) {
browser.reload();
}
// We have to use a frame script to query "baseURI"
mm.loadFrameScript("data:text/javascript,new " + function () {
let isJSONView = content.document.baseURI.startsWith("resource://devtools/");
if (isJSONView) {
content.location.reload();
}
}, false);
}
// Manually reload gcli if it has been used
// Bug 1248348: Inject the developer toolbar dynamically within browser/
// so that we can easily remove/reinject it
const desc = Object.getOwnPropertyDescriptor(window, "DeveloperToolbar");
if (desc && !desc.get) {
let wasVisible = window.DeveloperToolbar.visible;
window.DeveloperToolbar.hide()
.then(() => {
window.DeveloperToolbar.destroy();
let { DeveloperToolbar } = devtools.require("devtools/client/shared/developer-toolbar");
window.DeveloperToolbar = new DeveloperToolbar(window, window.document.getElementById("developer-toolbar"));
if (wasVisible) {
window.DeveloperToolbar.show();
}
});
}
} else if (windowtype === "devtools:webide") {
window.location.reload();
} else if (windowtype === "devtools:webconsole") {
// Browser console document can't just be reloaded.
// HUDService is going to close it on unload.
// Instead we have to manually toggle it.
let HUDService = devtools.require("devtools/client/webconsole/hudservice");
HUDService.toggleBrowserConsole()
.then(() => {
HUDService.toggleBrowserConsole();
});
}
}
if (reloadToolbox) {
// Reopen the toolbox automatically if we are reloading from toolbox shortcut
// and are on a browser window.
// Wait for a second before opening the toolbox to avoid races
// between the old and the new one.
let {setTimeout} = Cu.import("resource://gre/modules/Timer.jsm", {});
setTimeout(() => {
let { TargetFactory } = devtools.require("devtools/client/framework/target");
let { gDevTools } = devtools.require("devtools/client/framework/devtools");
let target = TargetFactory.forTab(top.gBrowser.selectedTab);
gDevTools.showToolbox(target);
}, 1000);
}
}
let listener;

View File

@ -10,7 +10,6 @@
<head>
<title>&animationInspectorTitle;</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="stylesheet" href="chrome://devtools/skin/common.css" type="text/css"/>
<link rel="stylesheet" href="chrome://devtools/skin/animationinspector.css" type="text/css"/>
<script type="application/javascript;version=1.8" src="chrome://devtools/content/shared/theme-switching.js"/>
</head>

View File

@ -65,8 +65,10 @@ add_task(function*() {
info("Select a finite animation, reload the page and wait for the " +
"animation to complete");
yield selectNode(".negative-delay", inspector);
let onScrubberStopped = waitForScrubberStopped(timeline);
yield reloadTab(inspector);
yield waitForScrubberStopped(timeline);
yield onScrubberStopped;
ok(btn.classList.contains("paused"),
"The button is in paused state once finite animations are done");

View File

@ -4,7 +4,6 @@
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://devtools/content/shared/widgets/widgets.css" type="text/css"?>
<?xml-stylesheet href="chrome://devtools/skin/common.css" type="text/css"?>
<?xml-stylesheet href="chrome://devtools/skin/widgets.css" type="text/css"?>
<?xml-stylesheet href="chrome://devtools/skin/canvasdebugger.css" type="text/css"?>
<!DOCTYPE window [

View File

@ -5,7 +5,6 @@
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://devtools/content/shared/widgets/widgets.css" type="text/css"?>
<?xml-stylesheet href="debugger.css" type="text/css"?>
<?xml-stylesheet href="chrome://devtools/skin/common.css" type="text/css"?>
<?xml-stylesheet href="chrome://devtools/skin/widgets.css" type="text/css"?>
<?xml-stylesheet href="chrome://devtools/skin/debugger.css" type="text/css"?>
<!DOCTYPE window [

View File

@ -6,7 +6,6 @@
<!DOCTYPE window []>
<?xml-stylesheet href="chrome://devtools/skin/common.css"?>
<?xml-stylesheet href="chrome://devtools/skin/eyedropper.css" type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"

View File

@ -3,6 +3,7 @@
/* 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";
const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
@ -198,6 +199,8 @@ BrowserToolboxProcess.prototype = {
if (this._options.addonID) {
xulURI += "?addonID=" + this._options.addonID;
} else if (this._options.testScript) {
xulURI += "?testScript=" + encodeURIComponent(this._options.testScript);
}
dumpn("Running chrome debugging process.");

View File

@ -1,3 +1,9 @@
/* -*- 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/. */
const {Cc, Ci, Cu} = require("chrome");
const Services = Cu.import("resource://gre/modules/Services.jsm", {}).Services;
const promise = require("promise");

View File

@ -1,3 +1,5 @@
/* -*- 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/. */

View File

@ -1,3 +1,5 @@
/* -*- 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/. */

View File

@ -17,6 +17,7 @@ support-files =
browser_toolbox_options_enable_serviceworkers_testing.html
serviceworker.js
[browser_browser_toolbox.js]
[browser_devtools_api.js]
[browser_devtools_api_destroy.js]
[browser_dynamic_tool_enabling.js]

View File

@ -0,0 +1,63 @@
/* vim: set ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
// On debug test slave, it takes about 50s to run the test.
requestLongerTimeout(4);
add_task(function* runTest() {
yield new Promise(done => {
let options = {"set": [
["devtools.debugger.prompt-connection", false],
["devtools.debugger.remote-enabled", true],
["devtools.chrome.enabled", true],
// Test-only pref to allow passing `testScript` argument to the browser
// toolbox
["devtools.browser-toolbox.allow-unsafe-script", true],
// On debug test slave, it takes more than the default time (20s)
// to get a initialized console
["devtools.debugger.remote-timeout", 120000]
]};
SpecialPowers.pushPrefEnv(options, done);
});
// Wait for a notification sent by a script evaluated in the webconsole
// of the browser toolbox.
let onCustomMessage = new Promise(done => {
Services.obs.addObserver(function listener() {
Services.obs.removeObserver(listener, "browser-toolbox-console-works");
done();
}, "browser-toolbox-console-works", false);
});
let { BrowserToolboxProcess } = Cu.import("resource://devtools/client/framework/ToolboxProcess.jsm", {});
let closePromise;
yield new Promise(onRun => {
let options = {
// Pass a test script evaluated in the browser toolbox window
// living in a distinct process. It has access to `toolbox` object
// in its global scope.
testScript: "new " + function () {
toolbox.selectTool("webconsole")
.then(() => toolbox.getPanel("webconsole"))
.then(() => {
let { jsterm } = toolbox.getPanel("webconsole").hud;
let js = "Services.obs.notifyObservers(null, 'browser-toolbox-console-works', null);";
return jsterm.execute(js);
})
.then(() => toolbox.destroy());
}
};
closePromise = new Promise(onClose => {
info("Opening the browser toolbox\n");
BrowserToolboxProcess.init(onClose, onRun, options);
});
});
ok(true, "Browser toolbox started\n");
yield onCustomMessage;
ok(true, "Received the custom message");
yield closePromise;
ok(true, "Browser toolbox process just closed");
});

View File

@ -1,3 +1,5 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */

View File

@ -1,3 +1,5 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */

View File

@ -1,3 +1,5 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */

View File

@ -1,5 +1,8 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test that network requests originating from the toolbox don't get recorded in

View File

@ -1,5 +1,7 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
* http://creativecommons.org/publicdomain/zero/1.0/ */
// Tests that the keybindings for opening and closing the inspector work as expected
// Can probably make this a shared test that tests all of the tools global keybindings

View File

@ -1,3 +1,5 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */

View File

@ -1,3 +1,5 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */

View File

@ -1,3 +1,5 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */

View File

@ -1,6 +1,7 @@
/* vim: set ts=2 et sw=2 tw=80: */
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
* http://creativecommons.org/publicdomain/zero/1.0/ */
var target;

View File

@ -1,5 +1,7 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
* http://creativecommons.org/publicdomain/zero/1.0/ */
// Ensure target is closed if client is closed directly
function test() {

View File

@ -1,5 +1,7 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
* http://creativecommons.org/publicdomain/zero/1.0/ */
// Test support methods on Target, such as `hasActor`, `getActorDescription`,
// `actorHasMethod` and `getTrait`.

View File

@ -1,6 +1,7 @@
/* vim: set ts=2 et sw=2 tw=80: */
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* 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 {Toolbox} = require("devtools/client/framework/toolbox");

View File

@ -1,6 +1,7 @@
/* vim: set ts=2 et sw=2 tw=80: */
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
* http://creativecommons.org/publicdomain/zero/1.0/ */
var toolbox;

View File

@ -1,3 +1,5 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */

View File

@ -1,3 +1,5 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */

View File

@ -1,6 +1,7 @@
/* vim: set ts=2 et sw=2 tw=80: */
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";

View File

@ -1,7 +1,5 @@
/* vim: set ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */

View File

@ -1,3 +1,5 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */

View File

@ -1,3 +1,5 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */

View File

@ -1,3 +1,5 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */

View File

@ -1,6 +1,8 @@
/* vim: set ts=2 et sw=2 tw=80: */
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
requestLongerTimeout(2);

View File

@ -1,6 +1,8 @@
/* vim: set ts=2 et sw=2 tw=80: */
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
requestLongerTimeout(2);

View File

@ -1,3 +1,5 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */

View File

@ -1,3 +1,5 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */

View File

@ -1,5 +1,7 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
* http://creativecommons.org/publicdomain/zero/1.0/ */
// A helper frame-script for devtools/client/framework service worker tests.

View File

@ -1,6 +1,7 @@
/* vim: set ts=2 et sw=2 tw=80: */
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
* http://creativecommons.org/publicdomain/zero/1.0/ */
var {Toolbox} = require("devtools/client/framework/toolbox");

View File

@ -1,6 +1,7 @@
/* vim: set ts=2 et sw=2 tw=80: */
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
* http://creativecommons.org/publicdomain/zero/1.0/ */
function test() {
gBrowser.selectedTab = gBrowser.addTab();

View File

@ -1,3 +1,5 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */

View File

@ -1,5 +1,8 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test that opening the toolbox doesn't throw when the previously selected

View File

@ -1,3 +1,5 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
@ -6,7 +8,6 @@ function test() {
let {ToolSidebar} = require("devtools/client/framework/sidebar");
const toolURL = "data:text/xml;charset=utf8,<?xml version='1.0'?>" +
"<?xml-stylesheet href='chrome://devtools/skin/common.css' type='text/css'?>" +
"<window xmlns='http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul'>" +
"<hbox flex='1'><description flex='1'>foo</description><splitter class='devtools-side-splitter'/>" +
"<tabbox flex='1' id='sidebar' class='devtools-sidebar-tabs'><tabs/><tabpanels flex='1'/></tabbox>" +

View File

@ -1,3 +1,5 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
@ -6,7 +8,6 @@ function test() {
const { ToolSidebar } = require("devtools/client/framework/sidebar");
const toolURL = "data:text/xml;charset=utf8,<?xml version='1.0'?>" +
"<?xml-stylesheet href='chrome://devtools/skin/common.css' type='text/css'?>" +
"<window xmlns='http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul'>" +
"<hbox flex='1'><description flex='1'>foo</description><splitter class='devtools-side-splitter'/>" +
"<tabbox flex='1' id='sidebar' class='devtools-sidebar-tabs'><tabs/><tabpanels flex='1'/></tabbox>" +

View File

@ -1,5 +1,8 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test that the sidebar widget auto-registers existing tabs.
@ -7,7 +10,6 @@
const {ToolSidebar} = require("devtools/client/framework/sidebar");
const testToolURL = "data:text/xml;charset=utf8,<?xml version='1.0'?>" +
"<?xml-stylesheet href='chrome://devtools/skin/common.css' type='text/css'?>" +
"<window xmlns='http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul'>" +
"<hbox flex='1'><description flex='1'>test tool</description>" +
"<splitter class='devtools-side-splitter'/>" +

View File

@ -1,5 +1,8 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test that the sidebar widget correctly displays the "all tabs..." button

View File

@ -4,7 +4,6 @@
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://devtools/content/shared/widgets/widgets.css" type="text/css"?>
<?xml-stylesheet href="chrome://devtools/skin/common.css" type="text/css"?>
<?xml-stylesheet href="chrome://devtools/skin/widgets.css" type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript;version=1.8" src="chrome://devtools/content/shared/theme-switching.js"/>

View File

@ -1,5 +1,5 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */

View File

@ -1,3 +1,5 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */

View File

@ -1,3 +1,5 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */

View File

@ -1,6 +1,7 @@
/* vim: set ts=2 et sw=2 tw=80: */
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
* http://creativecommons.org/publicdomain/zero/1.0/ */
// Test for dynamically registering and unregistering themes
const CHROME_URL = "chrome://mochitests/content/browser/devtools/client/framework/test/";

View File

@ -1,5 +1,7 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";

View File

@ -1,5 +1,7 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";

View File

@ -1,5 +1,7 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";

View File

@ -1,3 +1,5 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */

View File

@ -1,5 +1,7 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
* http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests that Toolbox#viewSourceInDebugger works when debugger is not

View File

@ -1,5 +1,7 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
* http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests that Toolbox#viewSourceInDebugger works when debugger is already loaded.

View File

@ -1,5 +1,7 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
* http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests that Toolbox#viewSourceInStyleEditor works when style editor is not

View File

@ -1,5 +1,7 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
* http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests that Toolbox#viewSourceInScratchpad works.

View File

@ -1,3 +1,5 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */

View File

@ -1,3 +1,5 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */

View File

@ -1,3 +1,5 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */

View File

@ -1,3 +1,5 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */

View File

@ -1,5 +1,7 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
* http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Check regression when opening two tabs

View File

@ -1,3 +1,8 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
function add(a, b, k) {
var result = a + b;
return k(result);

View File

@ -1,5 +1,7 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
* http://creativecommons.org/publicdomain/zero/1.0/ */
// shared-head.js handles imports, constants, and utility functions
Services.scriptloader.loadSubScript("chrome://mochitests/content/browser/devtools/client/framework/test/shared-head.js", this);

View File

@ -1,6 +1,8 @@
/* vim: set ts=2 et sw=2 tw=80: */
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Common code shared by browser_toolbox_options_disable_cache-*.js

View File

@ -1 +1,6 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
// empty service worker, always succeed!

View File

@ -1,6 +1,7 @@
/* 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/. */
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";

View File

@ -1,5 +1,7 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";

View File

@ -1,3 +1,5 @@
/* -*- 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/. */

View File

@ -1,3 +1,5 @@
/* -*- 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/. */

View File

@ -1,3 +1,5 @@
/* -*- 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/. */

View File

@ -1,6 +1,9 @@
/* -*- 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";
var { classes: Cc, interfaces: Ci, utils: Cu } = Components;
@ -114,6 +117,23 @@ function onNewToolbox(toolbox) {
gToolbox = toolbox;
bindToolboxHandlers();
raise();
let testScript = getParameterByName("testScript");
if (testScript) {
// Only allow executing random chrome scripts when a special
// test-only pref is set
let prefName = "devtools.browser-toolbox.allow-unsafe-script";
if (Services.prefs.getPrefType(prefName) == Services.prefs.PREF_BOOL &&
Services.prefs.getBoolPref(prefName) === true) {
evaluateTestScript(testScript, toolbox);
}
}
}
function evaluateTestScript(script, toolbox) {
let sandbox = Cu.Sandbox(window);
sandbox.window = window;
sandbox.toolbox = toolbox;
Cu.evalInSandbox(script, sandbox);
}
function bindToolboxHandlers() {

View File

@ -1,3 +1,5 @@
/* -*- 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/. */
@ -28,8 +30,6 @@ Cu.import("resource://devtools/client/scratchpad/scratchpad-manager.jsm");
Cu.import("resource://devtools/client/shared/DOMHelpers.jsm");
Cu.import("resource://gre/modules/Task.jsm");
loader.lazyImporter(this, "CommandUtils",
"resource://devtools/client/shared/DeveloperToolbar.jsm");
loader.lazyGetter(this, "toolboxStrings", () => {
const properties = "chrome://devtools/locale/toolbox.properties";
const bundle = Services.strings.createBundle(properties);
@ -45,6 +45,8 @@ loader.lazyGetter(this, "toolboxStrings", () => {
}
};
});
loader.lazyRequireGetter(this, "CommandUtils",
"devtools/client/shared/developer-toolbar", true);
loader.lazyRequireGetter(this, "getHighlighterUtils",
"devtools/client/framework/toolbox-highlighter-utils", true);
loader.lazyRequireGetter(this, "Hosts",

View File

@ -3,7 +3,6 @@
- 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/. -->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://devtools/skin/common.css" type="text/css"?>
<?xul-overlay href="chrome://global/content/editMenuOverlay.xul"?>

View File

@ -36,7 +36,7 @@ loader.lazyGetter(this, "clipboardHelper", () => {
return Cc["@mozilla.org/widget/clipboardhelper;1"].getService(Ci.nsIClipboardHelper);
});
loader.lazyImporter(this, "CommandUtils", "resource://devtools/client/shared/DeveloperToolbar.jsm");
loader.lazyRequireGetter(this, "CommandUtils", "devtools/client/shared/developer-toolbar", true);
/**
* Represents an open instance of the Inspector for a tab.

View File

@ -5,7 +5,6 @@
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://devtools/content/shared/widgets/widgets.css" type="text/css"?>
<?xml-stylesheet href="chrome://devtools/content/inspector/inspector.css" type="text/css"?>
<?xml-stylesheet href="chrome://devtools/skin/common.css" type="text/css"?>
<?xml-stylesheet href="chrome://devtools/skin/widgets.css" type="text/css"?>
<?xml-stylesheet href="chrome://devtools/skin/inspector.css" type="text/css"?>
<?xml-stylesheet href="chrome://devtools/skin/rules.css" type="text/css"?>

View File

@ -9,7 +9,6 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="stylesheet" href="chrome://devtools/content/inspector/markup/markup.css" type="text/css"/>
<link rel="stylesheet" href="chrome://devtools/skin/markup.css" type="text/css"/>
<link rel="stylesheet" href="chrome://devtools/skin/common.css" type="text/css"/>
<script type="application/javascript;version=1.8"
src="chrome://devtools/content/shared/theme-switching.js"/>

View File

@ -3,6 +3,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
const { assert } = require("devtools/shared/DevToolsUtils");
const { appinfo } = require("Services");
const { DOM: dom, createClass, createFactory, PropTypes } = require("devtools/client/shared/vendor/react");
const { connect } = require("devtools/client/shared/vendor/react-redux");
const { breakdowns, diffingState, viewState } = require("./constants");
@ -53,6 +54,17 @@ const MemoryApp = createClass({
return {};
},
componentDidMount() {
// Attach the keydown listener directly to the window. When an element that
// has the focus (such as a tree node) is removed from the DOM, the focus
// falls back to the body.
window.addEventListener("keydown", this.onKeyDown);
},
componentWillUnmount() {
window.removeEventListener("keydown", this.onKeyDown);
},
childContextTypes: {
front: PropTypes.any,
heapWorker: PropTypes.any,
@ -67,6 +79,27 @@ const MemoryApp = createClass({
};
},
onKeyDown(e) {
let { snapshots, dispatch, heapWorker } = this.props;
const selectedSnapshot = snapshots.find(s => s.selected);
const selectedIndex = snapshots.indexOf(selectedSnapshot);
let isOSX = appinfo.OS == "Darwin";
let isAccelKey = (isOSX && e.metaKey) || (!isOSX && e.ctrlKey);
// On ACCEL+UP, select previous snapshot.
if (isAccelKey && e.key === "ArrowUp") {
let previousIndex = Math.max(0, selectedIndex - 1);
let previousSnapshotId = snapshots[previousIndex].id;
dispatch(selectSnapshotAndRefresh(heapWorker, previousSnapshotId));
}
// On ACCEL+DOWN, select next snapshot.
if (isAccelKey && e.key === "ArrowDown") {
let nextIndex = Math.min(snapshots.length - 1, selectedIndex + 1);
let nextSnapshotId = snapshots[nextIndex].id;
dispatch(selectSnapshotAndRefresh(heapWorker, nextSnapshotId));
}
},
render() {
let {
dispatch,

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