--HG--
extra : commitid : Ji790Lmkepf
This commit is contained in:
Wes Kocher 2015-11-30 17:47:00 -08:00
Родитель 1523a17aa1 c2bb30818f
Коммит 68833cae98
71 изменённых файлов: 507 добавлений и 466 удалений

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

@ -58,18 +58,26 @@ xulrunner/**
# browser/ exclusions
browser/app/**
browser/base/**
browser/branding/**
browser/components/**
browser/config/**
browser/docs/**
browser/components/customizableui/**
browser/components/downloads/**
browser/components/feeds/**
browser/components/migration/**
browser/components/*.js
browser/components/places/**
browser/components/pocket/**
browser/components/preferences/**
browser/components/privatebrowsing/**
browser/components/sessionstore/**
browser/components/shell/**
browser/components/tabview/**
browser/components/translation/**
browser/components/uitour/**
browser/experiments/**
browser/extensions/pdfjs/**
browser/extensions/shumway/**
browser/fuel/**
browser/installer/**
browser/locales/**
browser/modules/**
browser/themes/**
# Loop specific exclusions

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

@ -1,5 +1,9 @@
{
// When adding items to this file please check for effects on sub-directories.
"plugins": [
"mozilla"
]
],
"env": {
"es6": true
},
}

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="702773bee0b70e479ccebe5e061f571e977bc376"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="538c96ab7f17adbbd15b82f750e7247c5685e831"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="702773bee0b70e479ccebe5e061f571e977bc376"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="538c96ab7f17adbbd15b82f750e7247c5685e831"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>

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

@ -15,7 +15,7 @@
<remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
<default remote="caf" revision="refs/tags/android-4.0.4_r2.1" sync-j="4"/>
<!-- Gecko and Gaia -->
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="702773bee0b70e479ccebe5e061f571e977bc376"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="538c96ab7f17adbbd15b82f750e7247c5685e831"/>
<!-- Gonk-specific things and forks -->
<project name="platform_bionic" path="bionic" remote="b2g" revision="e2b3733ba3fa5e3f404e983d2e4142b1f6b1b846"/>
<project name="platform_build" path="build" remote="b2g" revision="1b0db93fb6b870b03467aff50d6419771ba0d88c">

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

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="702773bee0b70e479ccebe5e061f571e977bc376"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="538c96ab7f17adbbd15b82f750e7247c5685e831"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="5de6856fad82857028f9f059f50680a9bea5b75c"/>

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="702773bee0b70e479ccebe5e061f571e977bc376"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="538c96ab7f17adbbd15b82f750e7247c5685e831"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="c9d4fe680662ee44a4bdea42ae00366f5df399cf">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="702773bee0b70e479ccebe5e061f571e977bc376"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="538c96ab7f17adbbd15b82f750e7247c5685e831"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

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

@ -15,7 +15,7 @@
<remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
<default remote="caf" revision="refs/tags/android-4.0.4_r2.1" sync-j="4"/>
<!-- Gecko and Gaia -->
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="702773bee0b70e479ccebe5e061f571e977bc376"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="538c96ab7f17adbbd15b82f750e7247c5685e831"/>
<!-- Gonk-specific things and forks -->
<project name="platform_bionic" path="bionic" remote="b2g" revision="e2b3733ba3fa5e3f404e983d2e4142b1f6b1b846"/>
<project name="platform_build" path="build" remote="b2g" revision="1b0db93fb6b870b03467aff50d6419771ba0d88c">

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="702773bee0b70e479ccebe5e061f571e977bc376"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="538c96ab7f17adbbd15b82f750e7247c5685e831"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>

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

@ -1,9 +1,9 @@
{
"git": {
"git_revision": "702773bee0b70e479ccebe5e061f571e977bc376",
"git_revision": "538c96ab7f17adbbd15b82f750e7247c5685e831",
"remote": "https://git.mozilla.org/releases/gaia.git",
"branch": ""
},
"revision": "d8d3b630339c16b3bf5292813143da11a8bbb0f0",
"revision": "183b45c6d96733ce09aee5eb7d7882b0d81f020d",
"repo_path": "integration/gaia-central"
}

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="702773bee0b70e479ccebe5e061f571e977bc376"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="538c96ab7f17adbbd15b82f750e7247c5685e831"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>

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

@ -18,7 +18,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="702773bee0b70e479ccebe5e061f571e977bc376"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="538c96ab7f17adbbd15b82f750e7247c5685e831"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="5de6856fad82857028f9f059f50680a9bea5b75c"/>

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="c9d4fe680662ee44a4bdea42ae00366f5df399cf">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="702773bee0b70e479ccebe5e061f571e977bc376"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="538c96ab7f17adbbd15b82f750e7247c5685e831"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>

6
browser/.eslintrc Normal file
Просмотреть файл

@ -0,0 +1,6 @@
{
// When adding items to this file please check for effects on sub-directories.
"rules": {
"eol-last": 2,
}
}

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

@ -1,7 +1,7 @@
# -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
# 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 -*-
* 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/. */
// Removes a doorhanger notification if all of the installs it was notifying
// about have ended in some way.

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

@ -1,10 +1,6 @@
/*
#ifdef 0
* This Source Code Form is subject to the terms of the Mozilla Public
/* 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/.
#endif
*/
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/**
* Tab previews utility, produces thumbnails

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

@ -1,7 +1,7 @@
# -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
# 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 -*-
* 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/. */
/**
* Customization handler prepares this browser window for entering and exiting

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

@ -1,6 +1,6 @@
# 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/.
/* 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/. */
/**
* Represents an info bar that shows a data submission notification.

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

@ -1,6 +1,6 @@
# 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/.
/* 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/. */
/**
* Listeners for the DevEdition theme. This adds an extra stylesheet

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

@ -1,7 +1,7 @@
# -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
# 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 -*-
* 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/. */
var gEMEHandler = {
get uiEnabled() {

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

@ -1,7 +1,7 @@
# -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
# 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 -*-
* 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/. */
/**
* The Feed Handler object manages discovery of RSS/ATOM feeds in web pages

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

@ -1,7 +1,7 @@
# -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
# 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 -*-
* 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/. */
var FullScreen = {
_MESSAGES: [

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

@ -1,10 +1,6 @@
/*
#ifdef 0
* This Source Code Form is subject to the terms of the Mozilla Public
/* 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/.
#endif
*/
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/**
* Controls the "full zoom" setting and its site-specific preferences.

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

@ -1,6 +1,6 @@
# 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/.
/* 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/. */
var gFxAccounts = {

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

@ -1,6 +1,6 @@
# 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/.
/* 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/. */
// Simple gestures support
//

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

@ -1,6 +1,6 @@
# 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/.
/* 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/. */
////////////////////////////////////////////////////////////////////////////////
//// StarUI

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

@ -1,7 +1,7 @@
# -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
# 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 -*-
* 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/. */
var gPluginHandler = {
PREF_SESSION_PERSIST_MINUTES: "plugin.sessionPermissionNow.intervalInMinutes",

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

@ -1,6 +1,6 @@
# 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/.
/* 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/. */
#ifdef MOZ_SAFE_BROWSING
var gSafeBrowsing = {

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

@ -1,6 +1,6 @@
# 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/.
/* 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/. */
/**
* SidebarUI controls showing and hiding the browser sidebar.

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

@ -1,6 +1,6 @@
// 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/.
/* 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/. */
// the "exported" symbols
var SocialUI,

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

@ -1,6 +1,6 @@
# 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/.
/* 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/. */
Cu.import("resource://gre/modules/XPCOMUtils.jsm");

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

@ -1,6 +1,6 @@
# 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/.
/* 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/. */
var TabView = {
_deck: null,

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

@ -1,8 +1,6 @@
#ifdef 0
/* 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/. */
#endif
* 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/. */
/**
* Keeps thumbnails of open web pages up-to-date.

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

@ -1,6 +1,6 @@
# 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/.
/* 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/. */
var TrackingProtection = {
MAX_INTROS: 0,

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

@ -1,7 +1,7 @@
# -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
# 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 -*-
* 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/. */
var Ci = Components.interfaces;
var Cu = Components.utils;
@ -265,31 +265,6 @@ var gInitialPages = [
"about:sessionrestore"
];
#include browser-addons.js
#include browser-ctrlTab.js
#include browser-customization.js
#include browser-devedition.js
#include browser-eme.js
#include browser-feeds.js
#include browser-fullScreen.js
#include browser-fullZoom.js
#include browser-gestureSupport.js
#include browser-places.js
#include browser-plugins.js
#include browser-safebrowsing.js
#include browser-sidebar.js
#include browser-social.js
#include browser-syncui.js
#include browser-tabview.js
#include browser-thumbnails.js
#include browser-trackingprotection.js
#ifdef MOZ_DATA_REPORTING
#include browser-data-submission-info-bar.js
#endif
#include browser-fxaccounts.js
XPCOMUtils.defineLazyGetter(this, "Win7Features", function () {
#ifdef XP_WIN
// Bug 666808 - AeroPeek support for e10s

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

@ -12,3 +12,28 @@
<script type="application/javascript" src="chrome://browser/content/customizableui/panelUI.js"/>
<script type="application/javascript" src="chrome://global/content/inlineSpellCheckUI.js"/>
<script type="application/javascript" src="chrome://global/content/viewSourceUtils.js"/>
<script type="application/javascript" src="chrome://browser/content/browser-addons.js"/>
<script type="application/javascript" src="chrome://browser/content/browser-ctrlTab.js"/>
<script type="application/javascript" src="chrome://browser/content/browser-customization.js"/>
<script type="application/javascript" src="chrome://browser/content/browser-devedition.js"/>
<script type="application/javascript" src="chrome://browser/content/browser-eme.js"/>
<script type="application/javascript" src="chrome://browser/content/browser-feeds.js"/>
<script type="application/javascript" src="chrome://browser/content/browser-fullScreen.js"/>
<script type="application/javascript" src="chrome://browser/content/browser-fullZoom.js"/>
<script type="application/javascript" src="chrome://browser/content/browser-gestureSupport.js"/>
<script type="application/javascript" src="chrome://browser/content/browser-places.js"/>
<script type="application/javascript" src="chrome://browser/content/browser-plugins.js"/>
<script type="application/javascript" src="chrome://browser/content/browser-safebrowsing.js"/>
<script type="application/javascript" src="chrome://browser/content/browser-sidebar.js"/>
<script type="application/javascript" src="chrome://browser/content/browser-social.js"/>
<script type="application/javascript" src="chrome://browser/content/browser-syncui.js"/>
<script type="application/javascript" src="chrome://browser/content/browser-tabview.js"/>
<script type="application/javascript" src="chrome://browser/content/browser-thumbnails.js"/>
<script type="application/javascript" src="chrome://browser/content/browser-trackingprotection.js"/>
#ifdef MOZ_DATA_REPORTING
<script type="application/javascript" src="chrome://browser/content/browser-data-submission-info-bar.js"/>
#endif
<script type="application/javascript" src="chrome://browser/content/browser-fxaccounts.js"/>

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

@ -22,6 +22,8 @@
onload="load()" onunload="unload()">
<script type="application/javascript" src="chrome://global/content/contentAreaUtils.js"/>
<script type="application/javascript" src="chrome://browser/content/browser.js"/>
<script type="application/javascript" src="chrome://browser/content/browser-places.js"/>
<script type="application/javascript" src="chrome://browser/content/browser-social.js"/>
<script type="application/javascript" src="chrome://global/content/inlineSpellCheckUI.js"/>
<script type="application/javascript" src="chrome://browser/content/nsContextMenu.js"/>
<script type="application/javascript" src="chrome://browser/content/web-panels.js"/>

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

@ -75,7 +75,27 @@ browser.jar:
* content/browser/browser.css (content/browser.css)
* content/browser/browser.js (content/browser.js)
* content/browser/browser.xul (content/browser.xul)
content/browser/browser-addons.js (content/browser-addons.js)
content/browser/browser-ctrlTab.js (content/browser-ctrlTab.js)
* content/browser/browser-customization.js (content/browser-customization.js)
content/browser/browser-data-submission-info-bar.js (content/browser-data-submission-info-bar.js)
* content/browser/browser-devedition.js (content/browser-devedition.js)
content/browser/browser-eme.js (content/browser-eme.js)
content/browser/browser-feeds.js (content/browser-feeds.js)
* content/browser/browser-fullScreen.js (content/browser-fullScreen.js)
content/browser/browser-fullZoom.js (content/browser-fullZoom.js)
content/browser/browser-fxaccounts.js (content/browser-fxaccounts.js)
* content/browser/browser-gestureSupport.js (content/browser-gestureSupport.js)
* content/browser/browser-places.js (content/browser-places.js)
* content/browser/browser-plugins.js (content/browser-plugins.js)
* content/browser/browser-safebrowsing.js (content/browser-safebrowsing.js)
content/browser/browser-sidebar.js (content/browser-sidebar.js)
content/browser/browser-social.js (content/browser-social.js)
* content/browser/browser-syncui.js (content/browser-syncui.js)
* content/browser/browser-tabPreviews.xml (content/browser-tabPreviews.xml)
content/browser/browser-tabview.js (content/browser-tabview.js)
content/browser/browser-thumbnails.js (content/browser-thumbnails.js)
content/browser/browser-trackingprotection.js (content/browser-trackingprotection.js)
* content/browser/chatWindow.xul (content/chatWindow.xul)
content/browser/tab-content.js (content/tab-content.js)
content/browser/content.js (content/content.js)

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

@ -13,7 +13,7 @@ function run_test() {
run_next_test();
}
add_task(function validCacheMidPopulation() {
add_task(function* validCacheMidPopulation() {
let expectedLinks = makeLinks(0, 3, 1);
let provider = new TestProvider(done => done(expectedLinks));
@ -36,7 +36,7 @@ add_task(function validCacheMidPopulation() {
RemoteNewTabUtils.links.removeProvider(provider);
});
add_task(function notifyLinkDelete() {
add_task(function* notifyLinkDelete() {
let expectedLinks = makeLinks(0, 3, 1);
let provider = new TestProvider(done => done(expectedLinks));
@ -95,7 +95,7 @@ add_task(function populatePromise() {
});
});
add_task(function isTopSiteGivenProvider() {
add_task(function* isTopSiteGivenProvider() {
let expectedLinks = makeLinks(0, 10, 2);
// The lowest 2 frecencies have the same base domain.
@ -134,7 +134,7 @@ add_task(function isTopSiteGivenProvider() {
RemoteNewTabUtils.links.removeProvider(provider);
});
add_task(function multipleProviders() {
add_task(function* multipleProviders() {
// Make each provider generate RemoteNewTabUtils.links.maxNumLinks links to check
// that no more than maxNumLinks are actually returned in the merged list.
let evenLinks = makeLinks(0, 2 * RemoteNewTabUtils.links.maxNumLinks, 2);
@ -159,7 +159,7 @@ add_task(function multipleProviders() {
RemoteNewTabUtils.links.removeProvider(oddProvider);
});
add_task(function changeLinks() {
add_task(function* changeLinks() {
let expectedLinks = makeLinks(0, 20, 2);
let provider = new TestProvider(done => done(expectedLinks));
@ -217,7 +217,7 @@ add_task(function changeLinks() {
RemoteNewTabUtils.links.removeProvider(provider);
});
add_task(function oneProviderAlreadyCached() {
add_task(function* oneProviderAlreadyCached() {
let links1 = makeLinks(0, 10, 1);
let provider1 = new TestProvider(done => done(links1));
@ -238,7 +238,7 @@ add_task(function oneProviderAlreadyCached() {
RemoteNewTabUtils.links.removeProvider(provider2);
});
add_task(function newLowRankedLink() {
add_task(function* newLowRankedLink() {
// Init a provider with 10 links and make its maximum number also 10.
let links = makeLinks(0, 10, 1);
let provider = new TestProvider(done => done(links));

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

@ -148,11 +148,11 @@ function* prepareTest() {
return deferred.promise;
}
add_task(function testSetupEngine() {
add_task(function* testSetupEngine() {
yield promiseSetEngine();
});
add_task(function testReturn() {
add_task(function* testReturn() {
yield prepareTest();
EventUtils.synthesizeKey("VK_RETURN", {});
let event = yield promiseOnLoad();
@ -163,7 +163,7 @@ add_task(function testReturn() {
is(event.originalTarget.URL, expectedURL(searchBar.value), "testReturn opened correct search page");
});
add_task(function testAltReturn() {
add_task(function* testAltReturn() {
yield prepareTest();
EventUtils.synthesizeKey("VK_RETURN", { altKey: true });
let event = yield promiseOnLoad();
@ -177,7 +177,7 @@ add_task(function testAltReturn() {
});
//Shift key has no effect for now, so skip it
add_task(function testShiftAltReturn() {
add_task(function* testShiftAltReturn() {
return;
yield prepareTest();
@ -192,7 +192,7 @@ add_task(function testShiftAltReturn() {
is(event.originalTarget.URL, expectedURL(searchBar.value), "testShiftAltReturn opened correct search page");
});
add_task(function testLeftClick() {
add_task(function* testLeftClick() {
yield prepareTest();
simulateClick({ button: 0 }, searchButton);
let event = yield promiseOnLoad();
@ -202,7 +202,7 @@ add_task(function testLeftClick() {
is(event.originalTarget.URL, expectedURL(searchBar.value), "testLeftClick opened correct search page");
});
add_task(function testMiddleClick() {
add_task(function* testMiddleClick() {
yield prepareTest();
simulateClick({ button: 1 }, searchButton);
let event = yield promiseOnLoad();
@ -214,7 +214,7 @@ add_task(function testMiddleClick() {
is(event.originalTarget.URL, expectedURL(searchBar.value), "testMiddleClick opened correct search page");
});
add_task(function testShiftMiddleClick() {
add_task(function* testShiftMiddleClick() {
yield prepareTest();
simulateClick({ button: 1, shiftKey: true }, searchButton);
let event = yield promiseOnLoad();
@ -226,7 +226,7 @@ add_task(function testShiftMiddleClick() {
is(event.originalTarget.URL, expectedURL(searchBar.value), "testShiftMiddleClick opened correct search page");
});
add_task(function testRightClick() {
add_task(function* testRightClick() {
preTabNo = gBrowser.tabs.length;
content.location.href = "about:blank";
simulateClick({ button: 2 }, searchButton);
@ -242,7 +242,7 @@ add_task(function testRightClick() {
searchBar.textbox.popup.hidePopup();
});
add_task(function testSearchHistory() {
add_task(function* testSearchHistory() {
var textbox = searchBar._textbox;
for (var i = 0; i < searchEntries.length; i++) {
let count = yield countEntries(textbox.getAttribute("autocompletesearchparam"), searchEntries[i]);
@ -250,7 +250,7 @@ add_task(function testSearchHistory() {
}
});
add_task(function testAutocomplete() {
add_task(function* testAutocomplete() {
var popup = searchBar.textbox.popup;
let popupShownPromise = promiseEvent(popup, "popupshown");
searchBar.textbox.showHistoryPopup();
@ -258,7 +258,7 @@ add_task(function testAutocomplete() {
checkMenuEntries(searchEntries);
});
add_task(function testClearHistory() {
add_task(function* testClearHistory() {
let controller = searchBar.textbox.controllers.getControllerForCommand("cmd_clearhistory")
ok(controller.isCommandEnabled("cmd_clearhistory"), "Clear history command enabled");
controller.doCommand("cmd_clearhistory");
@ -266,7 +266,7 @@ add_task(function testClearHistory() {
ok(count == 0, "History cleared");
});
add_task(function asyncCleanup() {
add_task(function* asyncCleanup() {
searchBar.value = "";
while (gBrowser.tabs.length != 1) {
gBrowser.removeTab(gBrowser.tabs[0], {animate: false});

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

@ -106,4 +106,4 @@ function resetPreferences() {
.wrappedJSObject;
service.policy._prefs.resetBranch("datareporting.policy.");
service.policy.dataSubmissionPolicyBypassNotification = true;
}
}

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

@ -144,7 +144,7 @@ function configureLogging() {
// Returns a Promise resolved with the json payload or rejected with
// OS.File.Error or JSON.parse() errors.
function loadJSONAsync(file, options) {
return Task.spawn(function() {
return Task.spawn(function*() {
let rawData = yield OS.File.read(file, options);
// Read json file into a string
let data;
@ -156,7 +156,7 @@ function loadJSONAsync(file, options) {
gLogger.error("Experiments: Could not parse JSON: " + file + " " + ex);
throw ex;
}
throw new Task.Result(data);
return data;
});
}

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

@ -1,35 +0,0 @@
# This file currently uses a non-standard (and not on a standards track)
# if statement within catch.
content/modules/MozLoopWorker.js
# This file currently uses es7 features eslint issue:
# https://github.com/eslint/espree/issues/125
content/modules/MozLoopAPI.jsm
# Need to fix the configuration for this.
bootstrap.js
# Need to drop the preprocessing (bug 1212428)
content/preferences/prefs.js
# Libs we don't need to check
content/panels/vendor
content/shared/vendor
standalone/content/libs
standalone/node_modules
# Libs we don't need to check
test/shared/vendor
# Coverage files
test/coverage
test/node_modules
# These are generated react files that we don't need to check
content/panels/js/conversation.js
content/panels/js/conversationViews.js
content/panels/js/panel.js
content/panels/js/roomViews.js
content/panels/js/feedbackViews.js
content/shared/js/textChatView.js
content/shared/js/linkifiedTextView.js
content/shared/js/views.js
standalone/content/js/standaloneRoomViews.js
standalone/content/js/webapp.js
ui/ui-showcase.js
# Don't need to check the built tree
standalone/dist

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

@ -5,12 +5,23 @@
"react"
],
"ecmaFeatures": {
// Allow these.
"forOf": true,
"jsx": true,
// Disallow due to content.
"arrowFunctions": false,
"blockBindings": false,
"destructuring": false,
"generators": false,
"objectLiteralShorthandMethods": false,
"restParams": false,
"spread": false,
"templateStrings": false,
},
"env": {
"browser": true,
"mocha": true
"es6": false,
"mocha": true,
},
"extends": "eslint:recommended",
"globals": {

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

@ -1,7 +1,4 @@
{
"env": {
"es6": true
},
"globals": {
"Cc": true,
"Ci": true,

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

@ -2631,7 +2631,7 @@ ElementEditor.prototype = {
} else {
// Create a new editor, because the value of an existing attribute
// has changed.
let attribute = this._createAttribute(attr);
let attribute = this._createAttribute(attr, el);
attribute.style.removeProperty("display");
// Temporarily flash the attribute to highlight the change.

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

@ -116,6 +116,7 @@ skip-if = e10s # Bug 1036409 - The last selected node isn't reselected
[browser_markupview_tag_edit_10.js]
[browser_markupview_tag_edit_11.js]
[browser_markupview_tag_edit_12.js]
[browser_markupview_tag_edit_13-other.js]
[browser_markupview_textcontent_edit_01.js]
[browser_markupview_toggle_01.js]
[browser_markupview_toggle_02.js]

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

@ -6,7 +6,7 @@
// Tests tabbing through attributes on a node
const TEST_URL = "data:text/html;charset=utf8,<div a b c d e id='test'></div>";
const TEST_URL = "data:text/html;charset=utf8,<div id='test' a b c d e></div>";
add_task(function*() {
let {inspector} = yield addTab(TEST_URL).then(openInspector);
@ -25,12 +25,12 @@ add_task(function*() {
// Check the order of the other attributes in the DOM to the check they appear
// correctly in the markup-view
let attributes = [...getNode("div").attributes].filter(attr => attr.name !== "id");
let attributes = (yield getAttributesFromEditor("div", inspector)).slice(1);
info("Tabbing forward through attributes in edit mode");
for (let {name} of attributes) {
for (let attribute of attributes) {
collapseSelectionAndTab(inspector);
checkFocusedAttribute(name, true);
checkFocusedAttribute(attribute, true);
}
info("Tabbing backward through attributes in edit mode");
@ -40,8 +40,8 @@ add_task(function*() {
let reverseAttributes = attributes.reverse();
reverseAttributes.shift();
for (let {name} of reverseAttributes) {
for (let attribute of reverseAttributes) {
collapseSelectionAndShiftTab(inspector);
checkFocusedAttribute(name, true);
checkFocusedAttribute(attribute, true);
}
});

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

@ -7,7 +7,7 @@
// Tests that focus position is correct when tabbing through and editing
// attributes.
const TEST_URL = "data:text/html;charset=utf8,<div id='attr' c='3' b='2' a='1'></div><div id='delattr' last='1' tobeinvalid='2'></div>";
const TEST_URL = "data:text/html;charset=utf8,<div id='attr' a='1' b='2' c='3'></div><div id='delattr' tobeinvalid='1' last='2'></div>";
add_task(function*() {
let {inspector} = yield addTab(TEST_URL).then(openInspector);
@ -19,30 +19,19 @@ add_task(function*() {
function* testAttributeEditing(inspector) {
info("Testing focus position after attribute editing");
// Modifying attributes reorders them in the internal representation to move
// the modified attribute to the end. breadcrumbs.js will update attributes
// to match original order if you selectNode before modifying attributes.
// So, hacky workaround for consistency with manual testing.
// Should be removed after Bug 1093593.
yield selectNode("#attr", inspector);
info("Setting the first non-id attribute in edit mode");
yield activateFirstAttribute("#attr", inspector); // focuses id
collapseSelectionAndTab(inspector); // focuses the first attr after id
// Detect the attributes order from the DOM, instead of assuming an order in
// the test, because the NamedNodeMap returned by element.attributes doesn't
// guaranty any specific order.
// Filter out the id attribute as the markup-view places it first anyway.
let attrs = getNodeAttributesOtherThanId("#attr");
let attrs = yield getAttributesFromEditor("#attr", inspector);
info("Editing this attribute, keeping the same name, and tabbing to the next");
yield editAttributeAndTab(attrs[0].name + '="99"', inspector);
checkFocusedAttribute(attrs[1].name, true);
yield editAttributeAndTab(attrs[1] + '="99"', inspector);
checkFocusedAttribute(attrs[2], true);
info("Editing the new focused attribute, keeping the name, and tabbing to the previous");
yield editAttributeAndTab(attrs[1].name + '="99"', inspector, true);
checkFocusedAttribute(attrs[0].name, true);
yield editAttributeAndTab(attrs[2] + '="99"', inspector, true);
checkFocusedAttribute(attrs[1], true);
info("Editing attribute name, changes attribute order");
yield editAttributeAndTab("d='4'", inspector);
@ -55,26 +44,15 @@ function* testAttributeEditing(inspector) {
function* testAttributeDeletion(inspector) {
info("Testing focus position after attribute deletion");
// Modifying attributes reorders them in the internal representation to move
// the modified attribute to the end. breadcrumbs.js will update attributes
// to match original order if you selectNode before modifying attributes.
// So, hacky workaround for consistency with manual testing.
// Should be removed after Bug 1093593.
yield selectNode("#delattr", inspector);
info("Setting the first non-id attribute in edit mode");
yield activateFirstAttribute("#delattr", inspector); // focuses id
collapseSelectionAndTab(inspector); // focuses the first attr after id
// Detect the attributes order from the DOM, instead of assuming an order in
// the test, because the NamedNodeMap returned by element.attributes doesn't
// guaranty any specific order.
// Filter out the id attribute as the markup-view places it first anyway.
let attrs = getNodeAttributesOtherThanId("#delattr");
let attrs = yield getAttributesFromEditor("#delattr", inspector);
info("Entering an invalid attribute to delete the attribute");
yield editAttributeAndTab('"', inspector);
checkFocusedAttribute(attrs[1].name, true);
checkFocusedAttribute(attrs[2], true);
info("Deleting the last attribute");
yield editAttributeAndTab(" ", inspector);
@ -109,7 +87,3 @@ function* activateFirstAttribute(container, inspector) {
EventUtils.sendKey("tab", inspector.panelWin);
EventUtils.sendKey("return", inspector.panelWin);
}
function getNodeAttributesOtherThanId(selector) {
return [...getNode(selector).attributes].filter(attr => attr.name !== "id");
}

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

@ -0,0 +1,38 @@
/* vim: set ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Tests that doesn't fit into any specific category.
const TEST_URL = "data:text/html;charset=utf8,<div a b id='order' c class></div>";
add_task(function*() {
let {inspector, testActor} = yield addTab(TEST_URL).then(openInspector);
yield testOriginalAttributesOrder(inspector);
yield testOrderAfterAttributeChange(inspector, testActor);
});
function* testOriginalAttributesOrder(inspector) {
info("Testing order of attributes on initial node render");
let attributes = yield getAttributesFromEditor("#order", inspector);
ok(isEqual(attributes, ["id", "class", "a", "b", "c"]), "ordered correctly");
}
function* testOrderAfterAttributeChange(inspector, testActor) {
info("Testing order of attributes after attribute is change by setAttribute");
let container = getContainerForSelector("#order", inspector);
yield testActor.setAttribute("#order", "a", "changed");
let attributes = yield getAttributesFromEditor("#order", inspector);
ok(isEqual(attributes, ["id", "class", "a", "b", "c"]),
"order isn't changed");
}
function isEqual(a, b) {
return a.toString() === b.toString();
}

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

@ -23,6 +23,10 @@ SimpleTest.requestCompleteLog();
// Uncomment this pref to dump all devtools emitted events to the console.
// Services.prefs.setBoolPref("devtools.dump.emit", true);
// Import helpers registering the test-actor in remote targets
var testDir = gTestPath.substr(0, gTestPath.lastIndexOf("/"));
Services.scriptloader.loadSubScript(testDir + "../../../shared/test/test-actor-registry.js", this);
// Set the testing flag on DevToolsUtils and reset it when the test ends
DevToolsUtils.testing = true;
registerCleanupFunction(() => DevToolsUtils.testing = false);
@ -137,7 +141,11 @@ function openInspector() {
let eventId = "inspector-updated";
return inspector.once("inspector-updated").then(() => {
info("The inspector panel is active and ready");
return {toolbox: toolbox, inspector: inspector};
return registerTestActor(toolbox.target.client);
}).then(() => {
return getTestActor(toolbox);
}).then((testActor) => {
return {toolbox, inspector, testActor};
});
});
}
@ -656,6 +664,22 @@ function checkFocusedAttribute(attrName, editMode) {
editMode ? attrName + " is in edit mode" : attrName + " is not in edit mode");
}
/**
* Get attributes for node as how they are represented in editor.
*
* @param {String} selector
* @param {InspectorPanel} inspector
* @return {Promise}
* A promise that resolves with an array of attribute names
* (e.g. ["id", "class", "href"])
*/
var getAttributesFromEditor = Task.async(function*(selector, inspector) {
let nodeList = (yield getContainerForSelector(selector, inspector))
.tagLine.querySelectorAll("[data-attr]");
return [...nodeList].map(node => node.getAttribute("data-attr"));
});
// The expand all operation of the markup-view calls itself recursively and
// there's not one event we can wait for to know when it's done
// so use this helper function to wait until all recursive children updates are done.

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

@ -4,7 +4,7 @@
"use strict";
// A helper actor for brower/devtools/inspector tests.
// A helper actor for inspector and markupview tests.
var { Cc, Ci, Cu, Cr } = require("chrome");
const {getRect, getElementFromPoint, getAdjustedQuads} = require("devtools/shared/layout/utils");
@ -413,7 +413,7 @@ var TestActor = exports.TestActor = protocol.ActorClass({
/**
* Set a JS property on a DOM Node.
* @param {String} selector The node selector
* @param {String} attribute The attribute name
* @param {String} property The property name
* @param {String} value The attribute value
*/
setProperty: protocol.method(function (selector, property, value) {
@ -431,7 +431,7 @@ var TestActor = exports.TestActor = protocol.ActorClass({
/**
* Get a JS property on a DOM Node.
* @param {String} selector The node selector
* @param {String} attribute The attribute name
* @param {String} property The property name
* @return {String} value The attribute value
*/
getProperty: protocol.method(function (selector, property) {
@ -447,6 +447,24 @@ var TestActor = exports.TestActor = protocol.ActorClass({
}
}),
/**
* Set an attribute on a DOM Node.
* @param {String} selector The node selector
* @param {String} attribute The attribute name
* @param {String} value The attribute value
*/
setAttribute: protocol.method(function (selector, attribute, value) {
let node = this._querySelector(selector);
node.setAttribute(attribute, value);
}, {
request: {
selector: Arg(0, "string"),
property: Arg(1, "string"),
value: Arg(2, "string")
},
response: {}
}),
/**
* Reload an iframe and wait for its load event.
* @param {String} selector The node selector

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

@ -27,10 +27,10 @@ const TEST_DATA = [
tagName: "BODY",
attrs: [
{
name: "id", value: "body-id"
name: "class", value: "body-class"
},
{
name: "class", value: "body-class"
name: "id", value: "body-id"
}
]
},
@ -45,13 +45,13 @@ const TEST_DATA = [
output: '<html lang="en-US" dir="ltr">',
tagName: "HTML",
attrs: [
{
name: "lang",
value: "en-US"
},
{
name: "dir",
value: "ltr"
},
{
name: "lang",
value: "en-US"
}
]
}

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

@ -422,7 +422,11 @@ var NodeActor = exports.NodeActor = protocol.ActorClass({
if (!this.rawNode.attributes) {
return undefined;
}
return [...this.rawNode.attributes].map(attr => {
// The NamedNodeMap implementation in Firefox (returned by
// node.attributes) gives attributes in the reverse order compared
// to the source file when iterated. So reverse the list here.
return [...this.rawNode.attributes].reverse().map(attr => {
return {namespace: attr.namespace, name: attr.name, value: attr.value };
});
},

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

@ -606,9 +606,10 @@ BluetoothDaemonGattModule::ClientSetAdvDataCmd(
PackConversion<int, int32_t>(aMinInterval),
PackConversion<int, int32_t>(aMaxInterval),
PackConversion<int, int32_t>(aApperance),
aManufacturerLen, PackArray<char>(aManufacturerData, aManufacturerLen),
aServiceDataLen, PackArray<char>(aServiceData, aServiceDataLen),
aServiceUuidLen, PackArray<char>(aServiceUuid, aServiceUuidLen), *pdu);
aManufacturerLen, aServiceDataLen, aServiceUuidLen,
PackArray<char>(aManufacturerData, aManufacturerLen),
PackArray<char>(aServiceData, aServiceDataLen),
PackArray<char>(aServiceUuid, aServiceUuidLen), *pdu);
if (NS_FAILED(rv)) {
return rv;
}
@ -989,7 +990,7 @@ BluetoothDaemonGattModule::ServerSendResponseCmd(
nsresult rv = PackPDU(
PackConversion<int, int32_t>(aConnId),
PackConversion<int, int32_t>(aTransId),
aResponse.mHandle,
PackConversion<BluetoothAttributeHandle, uint16_t>(aResponse.mHandle),
aResponse.mOffset,
PackConversion<BluetoothGattAuthReq, uint8_t>(aResponse.mAuthReq),
PackConversion<uint16_t, int32_t>(aStatus),
@ -2008,114 +2009,6 @@ BluetoothDaemonGattInterface::BluetoothDaemonGattInterface(
BluetoothDaemonGattInterface::~BluetoothDaemonGattInterface()
{ }
#if 0
class BluetoothDaemonGattInterface::InitResultHandler final
: public BluetoothSetupResultHandler
{
public:
InitResultHandler(BluetoothGattResultHandler* aRes)
: mRes(aRes)
{
MOZ_ASSERT(mRes);
}
void OnError(BluetoothStatus aStatus) override
{
MOZ_ASSERT(NS_IsMainThread());
mRes->OnError(aStatus);
}
void RegisterModule() override
{
MOZ_ASSERT(NS_IsMainThread());
mRes->Init();
}
private:
RefPtr<BluetoothGattResultHandler> mRes;
};
void
BluetoothDaemonGattInterface::Init(
BluetoothGattNotificationHandler* aNotificationHandler,
BluetoothGattResultHandler* aRes)
{
// Set notification handler _before_ registering the module. It could
// happen that we receive notifications, before the result handler runs.
mModule->SetNotificationHandler(aNotificationHandler);
InitResultHandler* res;
if (aRes) {
res = new InitResultHandler(aRes);
} else {
// We don't need a result handler if the caller is not interested.
res = nullptr;
}
nsresult rv = mModule->RegisterModule(
SETUP_SERVICE_ID_GATT, 0x00, BluetoothDaemonGattModule::MAX_NUM_CLIENTS,
res);
if (NS_FAILED(rv) && aRes) {
DispatchError(aRes, rv);
}
}
class BluetoothDaemonGattInterface::CleanupResultHandler final
: public BluetoothSetupResultHandler
{
public:
CleanupResultHandler(BluetoothDaemonGattModule* aModule,
BluetoothGattResultHandler* aRes)
: mModule(aModule)
, mRes(aRes)
{
MOZ_ASSERT(mModule);
}
void OnError(BluetoothStatus aStatus) override
{
MOZ_ASSERT(NS_IsMainThread());
if (mRes) {
mRes->OnError(aStatus);
}
}
void UnregisterModule() override
{
MOZ_ASSERT(NS_IsMainThread());
// Clear notification handler _after_ module has been
// unregistered. While unregistering the module, we might
// still receive notifications.
mModule->SetNotificationHandler(nullptr);
if (mRes) {
mRes->Cleanup();
}
}
private:
BluetoothDaemonGattModule* mModule;
RefPtr<BluetoothGattResultHandler> mRes;
};
void
BluetoothDaemonGattInterface::Cleanup(
BluetoothGattResultHandler* aRes)
{
nsresult rv = mModule->UnregisterModule(
SETUP_SERVICE_ID_GATT, new CleanupResultHandler(mModule, aRes));
if (NS_FAILED(rv)) {
DispatchError(aRes, rv);
}
}
#endif
void
BluetoothDaemonGattInterface::SetNotificationHandler(
BluetoothGattNotificationHandler* aNotificationHandler)

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

@ -533,6 +533,14 @@ Convert(const BluetoothAttributeHandle& aIn, int32_t& aOut)
return NS_OK;
}
nsresult
Convert(const BluetoothAttributeHandle& aIn, uint16_t& aOut)
{
aOut = aIn.mHandle;
return NS_OK;
}
nsresult
Convert(BluetoothAvrcpEvent aIn, uint8_t& aOut)
{
@ -933,6 +941,26 @@ Convert(BluetoothGattAuthReq aIn, int32_t& aOut)
return NS_OK;
}
nsresult
Convert(BluetoothGattAuthReq aIn, uint8_t& aOut)
{
static const uint8_t sGattAuthReq[] = {
[GATT_AUTH_REQ_NONE] = 0x00,
[GATT_AUTH_REQ_NO_MITM] = 0x01,
[GATT_AUTH_REQ_MITM] = 0x02,
[GATT_AUTH_REQ_SIGNED_NO_MITM] = 0x03,
[GATT_AUTH_REQ_SIGNED_MITM] = 0x04
};
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sGattAuthReq), BluetoothGattAuthReq,
uint8_t)) {
aOut = GATT_AUTH_REQ_NONE; // silences compiler warning
return NS_ERROR_ILLEGAL_VALUE;
}
aOut = sGattAuthReq[aIn];
return NS_OK;
}
nsresult
Convert(BluetoothGattWriteType aIn, int32_t& aOut)
{

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

@ -179,6 +179,9 @@ Convert(int32_t aIn, BluetoothGattStatus& aOut);
nsresult
Convert(const BluetoothAttributeHandle& aIn, int32_t& aOut);
nsresult
Convert(const BluetoothAttributeHandle& aIn, uint16_t& aOut);
nsresult
Convert(BluetoothAvrcpEvent aIn, uint8_t& aOut);
@ -245,6 +248,9 @@ Convert(ControlPlayStatus aIn, uint8_t& aOut);
nsresult
Convert(BluetoothGattAuthReq aIn, int32_t& aOut);
nsresult
Convert(BluetoothGattAuthReq aIn, uint8_t& aOut);
nsresult
Convert(BluetoothGattWriteType aIn, int32_t& aOut);

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

@ -3687,7 +3687,7 @@ BluetoothGattManager::RequestReadNotification(
AppendNamedValue(properties, "AttrHandle", aAttributeHandle);
AppendNamedValue(properties, "Address", bdAddrStr);
AppendNamedValue(properties, "NeedResponse", true);
AppendNamedValue(properties, "Value", new nsTArray<uint8_t>());
AppendNamedValue(properties, "Value", nsTArray<uint8_t>());
bs->DistributeSignal(NS_LITERAL_STRING("ReadRequested"),
server->mAppUuid,

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

@ -1,6 +1,5 @@
env:
browser: true
es6: true
globals:
Components: false

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

@ -669,19 +669,6 @@ public abstract class GeckoApp
} else if ("SystemUI:Visibility".equals(event)) {
setSystemUiVisible(message.getBoolean("visible"));
} else if ("Toast:Show".equals(event)) {
final String msg = message.getString("message");
final String duration = message.getString("duration");
final NativeJSObject button = message.optObject("button", null);
if (button != null) {
final String label = button.optString("label", "");
final String icon = button.optString("icon", "");
final String id = button.optString("id", "");
showButtonToast(msg, duration, label, icon, id);
} else {
showNormalToast(msg, duration);
}
} else if ("ToggleChrome:Focus".equals(event)) {
focusChrome();
@ -850,21 +837,6 @@ public abstract class GeckoApp
});
}
public void showNormalToast(final String message, final String duration) {
ThreadUtils.postToUiThread(new Runnable() {
@Override
public void run() {
Toast toast;
if (duration.equals("long")) {
toast = Toast.makeText(GeckoApp.this, message, Toast.LENGTH_LONG);
} else {
toast = Toast.makeText(GeckoApp.this, message, Toast.LENGTH_SHORT);
}
toast.show();
}
});
}
public ButtonToast getButtonToast() {
if (mToast != null) {
return mToast;
@ -1364,7 +1336,6 @@ public abstract class GeckoApp
"Share:Text",
"Snackbar:Show",
"SystemUI:Visibility",
"Toast:Show",
"ToggleChrome:Focus",
"ToggleChrome:Hide",
"ToggleChrome:Show",
@ -2189,7 +2160,6 @@ public abstract class GeckoApp
"Session:StatePurged",
"Share:Text",
"SystemUI:Visibility",
"Toast:Show",
"ToggleChrome:Focus",
"ToggleChrome:Hide",
"ToggleChrome:Show",

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

@ -717,13 +717,15 @@ just addresses the organization to follow, e.g. "This site is run by " -->
<!-- Localization note: These are features the device owner (e.g. parent) can enable or disable for
a restricted profile (e.g. child). Used inside the Android settings UI. -->
<!ENTITY restrictable_feature_addons_installation "Add-ons">
<!ENTITY restrictable_feature_addons_installation_description "Add features or functionality to Firefox. Note: Add-ons can disable certain restrictions.">
<!ENTITY restrictable_feature_private_browsing "Private Browsing">
<!ENTITY restrictable_feature_location_services "Location Services">
<!ENTITY restrictable_feature_private_browsing_description "Allows family members to browse without saving information about the sites and pages they\'ve visited.">
<!ENTITY restrictable_feature_clear_history "Clear History">
<!ENTITY restrictable_feature_guest_browsing "Guest browsing">
<!ENTITY restrictable_feature_master_password "Master password">
<!ENTITY restrictable_feature_clear_history_description "Allows family members to delete information about the sites and pages they\'ve visited.">
<!ENTITY restrictable_feature_advanced_settings "Advanced Settings">
<!ENTITY restrictable_feature_advanced_settings_description "This includes importing bookmarks, restoring tabs and automated updates. Turn off for simplified settings suitable for any family member.">
<!ENTITY restrictable_feature_camera_microphone "Camera &amp; Microphone">
<!ENTITY restrictable_feature_camera_microphone_description "Allows family members to engage in real time communication on websites.">
<!-- Default Bookmarks titles-->
<!-- LOCALIZATION NOTE (bookmarks_about_browser): link title for about:fennec -->

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

@ -790,13 +790,6 @@ OnSharedPreferenceChangeListener
return true;
}
});
} else if (handlers.containsKey(key)) {
PrefHandler handler = handlers.get(key);
if (!handler.setupPref(this, pref)) {
preferences.removePreference(pref);
i--;
continue;
}
} else if (PREFS_TAB_QUEUE.equals(key)) {
// Only show tab queue pref on nightly builds with the tab queue build flag.
if (!TabQueueHelper.TAB_QUEUE_ENABLED) {
@ -860,6 +853,15 @@ OnSharedPreferenceChangeListener
final String url = getResources().getString(R.string.faq_link, VERSION, OS, LOCALE);
((LinkPreference) pref).setUrl(url);
} else if (handlers.containsKey(key)) {
// This should be the last task. We might have removed some of this preferences previously. We only
// want to run the PrefHandler for a preference if it still exists.
PrefHandler handler = handlers.get(key);
if (!handler.setupPref(this, pref)) {
preferences.removePreference(pref);
i--;
continue;
}
}
// Some Preference UI elements are not actually preferences,

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

@ -16,43 +16,55 @@ import android.support.annotation.StringRes;
* These constants should be in sync with the ones from toolkit/components/parentalcontrols/nsIParentalControlsService.idl
*/
public enum Restrictable {
DOWNLOAD(1, "downloads", 0),
DOWNLOAD(1, "downloads", 0, 0),
INSTALL_EXTENSION(2, "no_install_extensions", R.string.restrictable_feature_addons_installation),
INSTALL_EXTENSION(
2, "no_install_extensions",
R.string.restrictable_feature_addons_installation,
R.string.restrictable_feature_addons_installation_description),
// UserManager.DISALLOW_INSTALL_APPS
INSTALL_APPS(3, "no_install_apps", 0),
INSTALL_APPS(3, "no_install_apps", 0 , 0),
BROWSE(4, "browse", 0),
BROWSE(4, "browse", 0, 0),
SHARE(5, "share", 0),
SHARE(5, "share", 0, 0),
BOOKMARK(6, "bookmark", 0),
BOOKMARK(6, "bookmark", 0, 0),
ADD_CONTACT(7, "add_contact", 0),
ADD_CONTACT(7, "add_contact", 0, 0),
SET_IMAGE(8, "set_image", 0),
SET_IMAGE(8, "set_image", 0, 0),
// UserManager.DISALLOW_MODIFY_ACCOUNTS
MODIFY_ACCOUNTS(9, "no_modify_accounts", 0),
MODIFY_ACCOUNTS(9, "no_modify_accounts", 0, 0),
REMOTE_DEBUGGING(10, "remote_debugging", 0),
REMOTE_DEBUGGING(10, "remote_debugging", 0, 0),
IMPORT_SETTINGS(11, "import_settings", 0),
IMPORT_SETTINGS(11, "import_settings", 0, 0),
PRIVATE_BROWSING(12, "private_browsing", R.string.restrictable_feature_private_browsing),
PRIVATE_BROWSING(
12, "private_browsing",
R.string.restrictable_feature_private_browsing,
R.string.restrictable_feature_private_browsing_description),
LOCATION_SERVICE(13, "location_service", R.string.restrictable_feature_location_services),
LOCATION_SERVICE(13, "location_service", 0, 0),
CLEAR_HISTORY(14, "clear_history", R.string.restrictable_feature_clear_history),
CLEAR_HISTORY(14, "clear_history",
R.string.restrictable_feature_clear_history,
R.string.restrictable_feature_clear_history_description),
MASTER_PASSWORD(15, "master_password", R.string.restrictable_feature_master_password),
MASTER_PASSWORD(15, "master_password", 0, 0),
GUEST_BROWSING(16, "guest_browsing", R.string.restrictable_feature_guest_browsing),
GUEST_BROWSING(16, "guest_browsing", 0, 0),
ADVANCED_SETTINGS(17, "advanced_settings", R.string.restrictable_feature_advanced_settings),
ADVANCED_SETTINGS(17, "advanced_settings",
R.string.restrictable_feature_advanced_settings,
R.string.restrictable_feature_advanced_settings_description),
CAMERA_MICROPHONE(18, "camera_microphone", R.string.restrictable_feature_camera_microphone);
CAMERA_MICROPHONE(18, "camera_microphone",
R.string.restrictable_feature_camera_microphone,
R.string.restrictable_feature_camera_microphone_description);
public final int id;
public final String name;
@ -60,10 +72,14 @@ public enum Restrictable {
@StringRes
public final int title;
Restrictable(final int id, final String name, @StringRes int title) {
@StringRes
public final int description;
Restrictable(final int id, final String name, @StringRes int title, @StringRes int description) {
this.id = id;
this.name = name;
this.title = title;
this.description = description;
}
public String getTitle(Context context) {
@ -72,4 +88,11 @@ public enum Restrictable {
}
return context.getResources().getString(title);
}
public String getDescription(Context context) {
if (description == 0) {
return null;
}
return context.getResources().getString(description);
}
}

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

@ -31,6 +31,19 @@ public class RestrictedProfileConfiguration implements RestrictionConfiguration
Restrictable.CAMERA_MICROPHONE
);
/**
* These restrictions are hidden from the admin configuration UI.
*/
private static List<Restrictable> hiddenRestrictions = Arrays.asList(
Restrictable.MASTER_PASSWORD,
Restrictable.GUEST_BROWSING,
Restrictable.LOCATION_SERVICE
);
/* package-private */ static boolean shouldHide(Restrictable restrictable) {
return hiddenRestrictions.contains(restrictable);
}
private Context context;
private Bundle cachedAppRestrictions;
private Bundle cachedUserRestrictions;
@ -111,22 +124,10 @@ public class RestrictedProfileConfiguration implements RestrictionConfiguration
bundle.putBoolean(Restrictable.PRIVATE_BROWSING.name, !bundle.getBoolean("no_private_browsing"));
}
if (!bundle.containsKey(Restrictable.LOCATION_SERVICE.name) && bundle.containsKey("no_location_service")) {
bundle.putBoolean(Restrictable.LOCATION_SERVICE.name, !bundle.getBoolean("no_location_service"));
}
if (!bundle.containsKey(Restrictable.CLEAR_HISTORY.name) && bundle.containsKey("no_clear_history")) {
bundle.putBoolean(Restrictable.CLEAR_HISTORY.name, !bundle.getBoolean("no_clear_history"));
}
if (!bundle.containsKey(Restrictable.MASTER_PASSWORD.name) && bundle.containsKey("no_master_password")) {
bundle.putBoolean(Restrictable.MASTER_PASSWORD.name, !bundle.getBoolean("no_master_password"));
}
if (!bundle.containsKey(Restrictable.GUEST_BROWSING.name) && bundle.containsKey("no_guest_browsing")) {
bundle.putBoolean(Restrictable.GUEST_BROWSING.name, !bundle.getBoolean("no_guest_browsing"));
}
if (!bundle.containsKey(Restrictable.ADVANCED_SETTINGS.name) && bundle.containsKey("no_advanced_settings")) {
bundle.putBoolean(Restrictable.ADVANCED_SETTINGS.name, !bundle.getBoolean("no_advanced_settings"));
}

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

@ -15,6 +15,7 @@ import android.content.Intent;
import android.content.RestrictionEntry;
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
import java.util.ArrayList;
@ -57,6 +58,10 @@ public class RestrictionProvider extends BroadcastReceiver {
continue;
}
if (RestrictedProfileConfiguration.shouldHide(restrictable)) {
continue;
}
RestrictionEntry entry = createRestrictionEntryWithDefaultValue(context, restrictable,
oldRestrictions.getBoolean(restrictable.name, false));
entries.add(entry);
@ -70,6 +75,11 @@ public class RestrictionProvider extends BroadcastReceiver {
entry.setTitle(restrictable.getTitle(context));
final String description = restrictable.getDescription(context);
if (!TextUtils.isEmpty(description)) {
entry.setDescription(description);
}
return entry;
}
}

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

@ -566,13 +566,15 @@
<!-- Restrictable features -->
<string name="restrictable_feature_addons_installation">&restrictable_feature_addons_installation;</string>
<string name="restrictable_feature_addons_installation_description">&restrictable_feature_addons_installation_description;</string>
<string name="restrictable_feature_private_browsing">&restrictable_feature_private_browsing;</string>
<string name="restrictable_feature_location_services">&restrictable_feature_location_services;</string>
<string name="restrictable_feature_private_browsing_description">&restrictable_feature_private_browsing_description;</string>
<string name="restrictable_feature_clear_history">&restrictable_feature_clear_history;</string>
<string name="restrictable_feature_guest_browsing">&restrictable_feature_guest_browsing;</string>
<string name="restrictable_feature_master_password">&restrictable_feature_master_password;</string>
<string name="restrictable_feature_clear_history_description">&restrictable_feature_clear_history_description;</string>
<string name="restrictable_feature_advanced_settings">&restrictable_feature_advanced_settings;</string>
<string name="restrictable_feature_advanced_settings_description">&restrictable_feature_advanced_settings_description;</string>
<string name="restrictable_feature_camera_microphone">&restrictable_feature_camera_microphone;</string>
<string name="restrictable_feature_camera_microphone_description">&restrictable_feature_camera_microphone_description;</string>
<!-- Miscellaneous -->
<string name="ellipsis">&ellipsis;</string>

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

@ -2268,8 +2268,6 @@ var NativeWindow = {
init: function() {
Services.obs.addObserver(this, "Menu:Clicked", false);
Services.obs.addObserver(this, "Doorhanger:Reply", false);
Services.obs.addObserver(this, "Toast:Click", false);
Services.obs.addObserver(this, "Toast:Hidden", false);
this.contextmenus.init();
},
@ -2288,38 +2286,6 @@ var NativeWindow = {
});
},
toast: {
_callbacks: {},
show: function(aMessage, aDuration, aOptions) {
let msg = {
type: "Toast:Show",
message: aMessage,
duration: aDuration
};
if (aOptions && aOptions.button) {
msg.button = {
id: uuidgen.generateUUID().toString(),
};
// null is badly handled by the receiver, so try to avoid including nulls.
if (aOptions.button.label) {
msg.button.label = aOptions.button.label;
}
if (aOptions.button.icon) {
// If the caller specified a button, make sure we convert any chrome urls
// to jar:jar urls so that the frontend can show them
msg.button.icon = resolveGeckoURI(aOptions.button.icon);
};
this._callbacks[msg.button.id] = aOptions.button.callback;
}
Messaging.sendRequest(msg);
}
},
menu: {
_callbacks: [],
_menuId: 1,
@ -2432,14 +2398,6 @@ var NativeWindow = {
if (aTopic == "Menu:Clicked") {
if (this.menu._callbacks[aData])
this.menu._callbacks[aData]();
} else if (aTopic == "Toast:Click") {
if (this.toast._callbacks[aData]) {
this.toast._callbacks[aData]();
delete this.toast._callbacks[aData];
}
} else if (aTopic == "Toast:Hidden") {
if (this.toast._callbacks[aData])
delete this.toast._callbacks[aData];
} else if (aTopic == "Doorhanger:Reply") {
let data = JSON.parse(aData);
let reply_id = data["callback"];
@ -3135,7 +3093,8 @@ XPCOMUtils.defineLazyModuleGetter(this, "PageActions",
// These alias to the old, deprecated NativeWindow interfaces
[
["pageactions", "resource://gre/modules/PageActions.jsm", "PageActions"]
["pageactions", "resource://gre/modules/PageActions.jsm", "PageActions"],
["toast", "resource://gre/modules/Snackbars.jsm", "Snackbars"]
].forEach(item => {
let [name, script, exprt] = item;

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

@ -22,6 +22,12 @@ var Snackbars = {
LENGTH_SHORT: LENGTH_SHORT,
show: function(aMessage, aDuration, aOptions) {
// Takes care of the deprecated toast calls
if (typeof aDuration === "string") {
[aDuration, aOptions] = migrateToastIfNeeded(aDuration, aOptions);
}
let msg = {
type: 'Snackbar:Show',
message: aMessage,
@ -41,3 +47,22 @@ var Snackbars = {
}
}
};
function migrateToastIfNeeded(aDuration, aOptions) {
let duration;
if (aDuration === "long") {
duration = LENGTH_LONG;
}
else {
duration = LENGTH_SHORT;
}
let options = {};
if (aOptions && aOptions.button) {
options.action = {
label: aOptions.button.label,
callback: () => aOptions.button.callback(),
};
}
return [duration, options];
}

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

@ -219,6 +219,7 @@ const TYPE_ALIASES = {
const CHROME_TYPES = new Set([
"extension",
"locale",
"experiment",
]);
const RESTARTLESS_TYPES = new Set([

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

@ -73,10 +73,35 @@ var resHandler = Services.io.getProtocolHandler("resource")
var dataURI = NetUtil.newURI(do_get_file("data", true));
resHandler.setSubstitution("xpcshell-data", dataURI);
function isManifestRegistered(file) {
let manifests = Components.manager.getManifestLocations();
for (let i = 0; i < manifests.length; i++) {
let manifest = manifests.queryElementAt(i, AM_Ci.nsIURI);
// manifest is the url to the manifest file either in an XPI or a directory.
// We want the location of the XPI or directory itself.
if (manifest instanceof AM_Ci.nsIJARURI) {
manifest = manifest.JARFile.QueryInterface(AM_Ci.nsIFileURL).file;
}
else if (manifest instanceof AM_Ci.nsIFileURL) {
manifest = manifest.file.parent;
}
else {
continue;
}
if (manifest.equals(file))
return true;
}
return false;
}
// Listens to messages from bootstrap.js telling us what add-ons were started
// and stopped etc. and performs some sanity checks that only installed add-ons
// are started etc.
this.BootstrapMonitor = {
inited: false,
// Contain the current state of add-ons in the system
installed: new Map(),
started: new Map(),
@ -89,9 +114,17 @@ this.BootstrapMonitor = {
installPromises: [],
init() {
this.inited = true;
Services.obs.addObserver(this, "bootstrapmonitor-event", false);
},
shutdownCheck() {
if (!this.inited)
return;
do_check_eq(this.started.size, 0);
},
clear(id) {
this.installed.delete(id);
this.started.delete(id);
@ -123,6 +156,11 @@ this.BootstrapMonitor = {
do_check_neq(started, undefined);
if (version != undefined)
do_check_eq(started.data.version, version);
// Chrome should be registered by now
let installPath = new FileUtils.File(started.data.installPath);
let isRegistered = isManifestRegistered(installPath);
do_check_true(isRegistered);
},
checkAddonNotStarted(id) {
@ -143,6 +181,7 @@ this.BootstrapMonitor = {
observe(subject, topic, data) {
let info = JSON.parse(data);
let id = info.data.id;
let installPath = new FileUtils.File(info.data.installPath);
// If this is the install event the add-ons shouldn't already be installed
if (info.event == "install") {
@ -164,18 +203,36 @@ this.BootstrapMonitor = {
this.started.delete(id);
this.stopped.set(id, info);
// Chrome should still be registered at this point
let isRegistered = isManifestRegistered(installPath);
do_check_true(isRegistered);
// XPIProvider doesn't bother unregistering chrome on app shutdown but
// since we simulate restarts we must do so manually to keep the registry
// consistent.
if (info.reason == 2 /* APP_SHUTDOWN */)
Components.manager.removeBootstrappedManifestLocation(installPath);
}
else {
this.checkAddonNotStarted(id);
}
if (info.event == "uninstall") {
// Chrome should be unregistered at this point
let isRegistered = isManifestRegistered(installPath);
do_check_false(isRegistered);
this.installed.delete(id);
this.uninstalled.set(id, info)
}
else if (info.event == "startup") {
this.started.set(id, info);
// Chrome should be registered at this point
let isRegistered = isManifestRegistered(installPath);
do_check_true(isRegistered);
for (let resolve of this.startupPromises)
resolve();
this.startupPromises = [];
@ -587,6 +644,7 @@ function promiseShutdownManager() {
return MockAsyncShutdown.hook()
.then(null, err => hookErr = err)
.then( () => {
BootstrapMonitor.shutdownCheck();
gInternalManager = null;
// Load the add-ons list as it was after application shutdown