зеркало из https://github.com/mozilla/gecko-dev.git
Merge inbound to mozilla-central. a=merge
This commit is contained in:
Коммит
3d5e6205ca
|
@ -159,6 +159,10 @@ add_task(async function test_opensearch_disabled() {
|
|||
});
|
||||
|
||||
add_task(async function test_AddSearchProvider() {
|
||||
if (!Services.prefs.getBoolPref("dom.sidebar.enabled", false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Mock the modal error dialog
|
||||
let mockPrompter = {
|
||||
promptCount: 0,
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
[DEFAULT]
|
||||
prefs = dom.sidebar.enabled=true
|
||||
support-files =
|
||||
426329.xml
|
||||
483086-1.xml
|
||||
|
|
|
@ -2716,25 +2716,6 @@ nsINode::AddSizeOfIncludingThis(nsWindowSizes& aSizes, size_t* aNodeSize) const
|
|||
AddSizeOfExcludingThis(aSizes, aNodeSize);
|
||||
}
|
||||
|
||||
#define EVENT(name_, id_, type_, struct_) \
|
||||
EventHandlerNonNull* nsINode::GetOn##name_() { \
|
||||
EventListenerManager *elm = GetExistingListenerManager(); \
|
||||
return elm ? elm->GetEventHandler(nsGkAtoms::on##name_) : nullptr; \
|
||||
} \
|
||||
void nsINode::SetOn##name_(EventHandlerNonNull* handler) \
|
||||
{ \
|
||||
EventListenerManager *elm = GetOrCreateListenerManager(); \
|
||||
if (elm) { \
|
||||
elm->SetEventHandler(nsGkAtoms::on##name_, handler); \
|
||||
} \
|
||||
}
|
||||
#define TOUCH_EVENT EVENT
|
||||
#define DOCUMENT_ONLY_EVENT EVENT
|
||||
#include "mozilla/EventNameList.h"
|
||||
#undef DOCUMENT_ONLY_EVENT
|
||||
#undef TOUCH_EVENT
|
||||
#undef EVENT
|
||||
|
||||
bool
|
||||
nsINode::Contains(const nsINode* aOther) const
|
||||
{
|
||||
|
|
|
@ -1998,17 +1998,20 @@ protected:
|
|||
mozilla::ErrorResult&);
|
||||
|
||||
public:
|
||||
/* Event stuff that documents and elements share. This needs to be
|
||||
NS_IMETHOD because some subclasses implement DOM methods with
|
||||
this exact name and signature and then the calling convention
|
||||
needs to match.
|
||||
/* Event stuff that documents and elements share.
|
||||
|
||||
Note that we include DOCUMENT_ONLY_EVENT events here so that we
|
||||
can forward all the document stuff to this implementation.
|
||||
*/
|
||||
#define EVENT(name_, id_, type_, struct_) \
|
||||
mozilla::dom::EventHandlerNonNull* GetOn##name_(); \
|
||||
void SetOn##name_(mozilla::dom::EventHandlerNonNull* listener);
|
||||
#define EVENT(name_, id_, type_, struct_) \
|
||||
mozilla::dom::EventHandlerNonNull* GetOn##name_() \
|
||||
{ \
|
||||
return GetEventHandler(nsGkAtoms::on##name_); \
|
||||
} \
|
||||
void SetOn##name_(mozilla::dom::EventHandlerNonNull* handler) \
|
||||
{ \
|
||||
SetEventHandler(nsGkAtoms::on##name_, handler); \
|
||||
}
|
||||
#define TOUCH_EVENT EVENT
|
||||
#define DOCUMENT_ONLY_EVENT EVENT
|
||||
#include "mozilla/EventNameList.h"
|
||||
|
|
|
@ -205,6 +205,7 @@ public:
|
|||
// its state could be the wrong one. The spec doesn't say anything
|
||||
// about it, yet (bug 1384006)
|
||||
RefPtr<Promise> put = mCache->PutAll(aCx, mRequestList, responseList, result);
|
||||
result.WouldReportJSException();
|
||||
if (NS_WARN_IF(result.Failed())) {
|
||||
// TODO: abort the fetch requests we have running (bug 1157434)
|
||||
mPromise->MaybeReject(result);
|
||||
|
|
|
@ -58,6 +58,8 @@ namespace {
|
|||
void
|
||||
AbortStream(JSContext* aCx, JS::Handle<JSObject*> aStream, ErrorResult& aRv)
|
||||
{
|
||||
aRv.MightThrowJSException();
|
||||
|
||||
bool isReadable;
|
||||
if (!JS::ReadableStreamIsReadable(aCx, aStream, &isReadable)) {
|
||||
aRv.StealExceptionFromJSContext(aCx);
|
||||
|
@ -1119,8 +1121,10 @@ FetchBody<Derived>::GetBodyUsed(ErrorResult& aRv) const
|
|||
return true;
|
||||
}
|
||||
|
||||
// If this stream is disturbed or locked, return true.
|
||||
// If this stream is disturbed, return true.
|
||||
if (mReadableStreamBody) {
|
||||
aRv.MightThrowJSException();
|
||||
|
||||
AutoJSAPI jsapi;
|
||||
if (!jsapi.Init(mOwner)) {
|
||||
aRv.Throw(NS_ERROR_FAILURE);
|
||||
|
@ -1130,16 +1134,12 @@ FetchBody<Derived>::GetBodyUsed(ErrorResult& aRv) const
|
|||
JSContext* cx = jsapi.cx();
|
||||
JS::Rooted<JSObject*> body(cx, mReadableStreamBody);
|
||||
bool disturbed;
|
||||
bool locked;
|
||||
bool readable;
|
||||
if (!JS::ReadableStreamIsDisturbed(cx, body, &disturbed) ||
|
||||
!JS::ReadableStreamIsLocked(cx, body, &locked) ||
|
||||
!JS::ReadableStreamIsReadable(cx, body, &readable)) {
|
||||
if (!JS::ReadableStreamIsDisturbed(cx, body, &disturbed)) {
|
||||
aRv.StealExceptionFromJSContext(cx);
|
||||
return false;
|
||||
}
|
||||
|
||||
return disturbed || locked || !readable;
|
||||
return disturbed;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -1182,6 +1182,8 @@ FetchBody<Derived>::SetBodyUsed(JSContext* aCx, ErrorResult& aRv)
|
|||
// If we already have a ReadableStreamBody and it has been created by DOM, we
|
||||
// have to lock it now because it can have been shared with other objects.
|
||||
if (mReadableStreamBody) {
|
||||
aRv.MightThrowJSException();
|
||||
|
||||
JS::Rooted<JSObject*> readableStreamObj(aCx, mReadableStreamBody);
|
||||
|
||||
JS::ReadableStreamMode mode;
|
||||
|
@ -1223,6 +1225,8 @@ already_AddRefed<Promise>
|
|||
FetchBody<Derived>::ConsumeBody(JSContext* aCx, FetchConsumeType aType,
|
||||
ErrorResult& aRv)
|
||||
{
|
||||
aRv.MightThrowJSException();
|
||||
|
||||
RefPtr<AbortSignalImpl> signalImpl = DerivedClass()->GetSignalImpl();
|
||||
if (signalImpl && signalImpl->Aborted()) {
|
||||
aRv.Throw(NS_ERROR_DOM_ABORT_ERR);
|
||||
|
@ -1431,6 +1435,8 @@ FetchBody<Derived>::LockStream(JSContext* aCx,
|
|||
JS::HandleObject aStream,
|
||||
ErrorResult& aRv)
|
||||
{
|
||||
aRv.MightThrowJSException();
|
||||
|
||||
#if DEBUG
|
||||
JS::ReadableStreamMode streamMode;
|
||||
if (!JS::ReadableStreamGetMode(aCx, aStream, &streamMode)) {
|
||||
|
@ -1484,6 +1490,8 @@ FetchBody<Derived>::MaybeTeeReadableStreamBody(JSContext* aCx,
|
|||
return;
|
||||
}
|
||||
|
||||
aRv.MightThrowJSException();
|
||||
|
||||
JS::Rooted<JSObject*> stream(aCx, mReadableStreamBody);
|
||||
|
||||
// If this is a ReadableStream with an external source, this has been
|
||||
|
|
|
@ -119,9 +119,7 @@ FetchStreamReader::CloseAndRelease(JSContext* aCx, nsresult aStatus)
|
|||
|
||||
RefPtr<FetchStreamReader> kungFuDeathGrip = this;
|
||||
|
||||
if (aCx) {
|
||||
MOZ_ASSERT(mReader);
|
||||
|
||||
if (aCx && mReader) {
|
||||
RefPtr<DOMException> error = DOMException::Create(aStatus);
|
||||
|
||||
JS::Rooted<JS::Value> errorValue(aCx);
|
||||
|
@ -157,6 +155,8 @@ FetchStreamReader::StartConsuming(JSContext* aCx,
|
|||
MOZ_DIAGNOSTIC_ASSERT(!mReader);
|
||||
MOZ_DIAGNOSTIC_ASSERT(aStream);
|
||||
|
||||
aRv.MightThrowJSException();
|
||||
|
||||
JS::Rooted<JSObject*> reader(aCx,
|
||||
JS::ReadableStreamGetReader(aCx, aStream,
|
||||
JS::ReadableStreamReaderMode::Default));
|
||||
|
|
|
@ -239,6 +239,8 @@ Response::Constructor(const GlobalObject& aGlobal,
|
|||
|
||||
const fetch::ResponseBodyInit& body = aBody.Value().Value();
|
||||
if (body.IsReadableStream()) {
|
||||
aRv.MightThrowJSException();
|
||||
|
||||
JSContext* cx = aGlobal.Context();
|
||||
const ReadableStream& readableStream = body.GetAsReadableStream();
|
||||
|
||||
|
@ -246,14 +248,12 @@ Response::Constructor(const GlobalObject& aGlobal,
|
|||
|
||||
bool disturbed;
|
||||
bool locked;
|
||||
bool readable;
|
||||
if (!JS::ReadableStreamIsDisturbed(cx, readableStreamObj, &disturbed) ||
|
||||
!JS::ReadableStreamIsLocked(cx, readableStreamObj, &locked) ||
|
||||
!JS::ReadableStreamIsReadable(cx, readableStreamObj, &readable)) {
|
||||
!JS::ReadableStreamIsLocked(cx, readableStreamObj, &locked)) {
|
||||
aRv.StealExceptionFromJSContext(cx);
|
||||
return nullptr;
|
||||
}
|
||||
if (disturbed || locked || !readable) {
|
||||
if (disturbed || locked) {
|
||||
aRv.ThrowTypeError<MSG_FETCH_BODY_CONSUMED_ERROR>();
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -341,6 +341,29 @@ Response::Clone(JSContext* aCx, ErrorResult& aRv)
|
|||
if (NS_WARN_IF(aRv.Failed())) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!bodyUsed && mReadableStreamBody) {
|
||||
aRv.MightThrowJSException();
|
||||
|
||||
AutoJSAPI jsapi;
|
||||
if (!jsapi.Init(mOwner)) {
|
||||
aRv.Throw(NS_ERROR_FAILURE);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
JSContext* cx = jsapi.cx();
|
||||
JS::Rooted<JSObject*> body(cx, mReadableStreamBody);
|
||||
bool locked;
|
||||
// We just need to check the 'locked' state because GetBodyUsed() already
|
||||
// checked the 'disturbed' state.
|
||||
if (!JS::ReadableStreamIsLocked(cx, body, &locked)) {
|
||||
aRv.StealExceptionFromJSContext(cx);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bodyUsed = locked;
|
||||
}
|
||||
|
||||
if (bodyUsed) {
|
||||
aRv.ThrowTypeError<MSG_FETCH_BODY_CONSUMED_ERROR>();
|
||||
return nullptr;
|
||||
|
|
|
@ -246,7 +246,7 @@ skip-if = android_version # no simulcast support on android
|
|||
[test_peerConnection_simulcastOddResolution.html]
|
||||
skip-if = android_version # no simulcast support on android
|
||||
[test_peerConnection_relayOnly.html]
|
||||
disabled=
|
||||
skip-if = toolkit == 'android' # android(Bug 1189784, timeouts on 4.3 emulator)
|
||||
[test_peerConnection_callbacks.html]
|
||||
skip-if = toolkit == 'android' # android(Bug 1189784, timeouts on 4.3 emulator)
|
||||
[test_peerConnection_replaceTrack.html]
|
||||
|
|
|
@ -799,7 +799,7 @@ function PeerConnectionWrapper(label, configuration) {
|
|||
if (iceState === "connected") {
|
||||
this.iceConnectedResolve();
|
||||
} else if (iceState === "failed") {
|
||||
this.iceConnectedReject();
|
||||
this.iceConnectedReject(new Error("ICE failed"));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -22,8 +22,8 @@ function PC_BOTH_WAIT_FOR_ICE_FAILED(test) {
|
|||
e => is(e.message, reason, msg + " must fail with: " + e.message));
|
||||
|
||||
return Promise.all([
|
||||
isFail(() => waitForIceConnected(test, test.pcLocal), "ICE failed", "Local ICE"),
|
||||
isFail(() => waitForIceConnected(test, test.pcRemote), "ICE failed", "Remote ICE")
|
||||
isFail(() => test.pcLocal.waitForIceConnected(), "ICE failed", "Local ICE"),
|
||||
isFail(() => test.pcRemote.waitForIceConnected(), "ICE failed", "Remote ICE")
|
||||
])
|
||||
.then(() => ok(true, "ICE on both sides must fail."));
|
||||
}
|
||||
|
|
|
@ -32,7 +32,6 @@ CSPService::CSPService()
|
|||
|
||||
CSPService::~CSPService()
|
||||
{
|
||||
mAppStatusCache.Clear();
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(CSPService, nsIContentPolicy, nsIChannelEventSink)
|
||||
|
|
|
@ -30,8 +30,5 @@ public:
|
|||
protected:
|
||||
virtual ~CSPService();
|
||||
|
||||
private:
|
||||
// Maps origins to app status.
|
||||
nsDataHashtable<nsCStringHashKey, uint16_t> mAppStatusCache;
|
||||
};
|
||||
#endif /* nsCSPService_h___ */
|
||||
|
|
|
@ -678,6 +678,7 @@ RespondWithHandler::ResolvedCallback(JSContext* aCx, JS::Handle<JS::Value> aValu
|
|||
{
|
||||
ErrorResult error;
|
||||
bool bodyUsed = response->GetBodyUsed(error);
|
||||
error.WouldReportJSException();
|
||||
if (NS_WARN_IF(error.Failed())) {
|
||||
autoCancel.SetCancelErrorResult(aCx, error);
|
||||
return;
|
||||
|
@ -759,6 +760,7 @@ RespondWithHandler::ResolvedCallback(JSContext* aCx, JS::Handle<JS::Value> aValu
|
|||
if (body) {
|
||||
ErrorResult error;
|
||||
response->SetBodyUsed(aCx, error);
|
||||
error.WouldReportJSException();
|
||||
if (NS_WARN_IF(error.Failed())) {
|
||||
autoCancel.SetCancelErrorResult(aCx, error);
|
||||
return;
|
||||
|
|
|
@ -618,13 +618,11 @@ private:
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
ErrorResult result;
|
||||
nsCOMPtr<nsIInputStream> body;
|
||||
result = NS_NewCStringInputStream(getter_AddRefs(body),
|
||||
NS_ConvertUTF16toUTF8(aCN->Buffer()));
|
||||
if (NS_WARN_IF(result.Failed())) {
|
||||
MOZ_ASSERT(!result.IsErrorWithMessage());
|
||||
return result.StealNSResult();
|
||||
nsresult rv = NS_NewCStringInputStream(getter_AddRefs(body),
|
||||
NS_ConvertUTF16toUTF8(aCN->Buffer()));
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
RefPtr<InternalResponse> ir =
|
||||
|
@ -650,7 +648,9 @@ private:
|
|||
// For now we have to wait until the Put Promise is fulfilled before we can
|
||||
// continue since Cache does not yet support starting a read that is being
|
||||
// written to.
|
||||
ErrorResult result;
|
||||
RefPtr<Promise> cachePromise = aCache->Put(aCx, request, *response, result);
|
||||
result.WouldReportJSException();
|
||||
if (NS_WARN_IF(result.Failed())) {
|
||||
// No exception here because there are no ReadableStreams involved here.
|
||||
MOZ_ASSERT(!result.IsJSException());
|
||||
|
|
|
@ -8,5 +8,5 @@
|
|||
interface External
|
||||
{
|
||||
void AddSearchProvider(DOMString aDescriptionURL);
|
||||
unsigned long IsSearchProviderInstalled(DOMString aSearchURL);
|
||||
void IsSearchProviderInstalled();
|
||||
};
|
||||
|
|
|
@ -387,7 +387,7 @@ partial interface Window {
|
|||
#ifdef HAVE_SIDEBAR
|
||||
// Mozilla extension
|
||||
partial interface Window {
|
||||
[Replaceable, Throws, UseCounter]
|
||||
[Replaceable, Throws, UseCounter, Pref="dom.sidebar.enabled"]
|
||||
readonly attribute (External or WindowProxy) sidebar;
|
||||
};
|
||||
#endif
|
||||
|
|
|
@ -2026,6 +2026,10 @@ RuntimeService::Cleanup()
|
|||
{
|
||||
AssertIsOnMainThread();
|
||||
|
||||
if (!mShuttingDown) {
|
||||
Shutdown();
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
|
||||
NS_WARNING_ASSERTION(obs, "Failed to get observer service?!");
|
||||
|
||||
|
|
|
@ -842,6 +842,7 @@ private:
|
|||
ErrorResult error;
|
||||
RefPtr<Promise> cachePromise =
|
||||
mCacheCreator->Cache_()->Put(jsapi.cx(), request, *response, error);
|
||||
error.WouldReportJSException();
|
||||
if (NS_WARN_IF(error.Failed())) {
|
||||
nsresult rv = error.StealNSResult();
|
||||
channel->Cancel(rv);
|
||||
|
|
|
@ -24,8 +24,8 @@ var obj = {};
|
|||
propBag.setProperty("foopy", obj);
|
||||
ok(SpecialPowers.unwrap(propBag.getProperty("foopy")) === obj,
|
||||
"nsIVariant works with regular objects");
|
||||
propBag.setProperty("foopy1", sidebar);
|
||||
ok(SpecialPowers.unwrap(propBag.getProperty("foopy1")) === sidebar,
|
||||
propBag.setProperty("foopy1", external);
|
||||
ok(SpecialPowers.unwrap(propBag.getProperty("foopy1")) === external,
|
||||
"nsIVariant works with bizarre objects");
|
||||
|
||||
</script>
|
||||
|
|
|
@ -35,6 +35,7 @@ import org.junit.Test
|
|||
import org.junit.Before
|
||||
import org.junit.After
|
||||
import org.junit.runner.RunWith
|
||||
import org.mozilla.geckoview.test.rule.GeckoSessionTestRule.ReuseSession
|
||||
|
||||
const val DISPLAY_WIDTH = 480
|
||||
const val DISPLAY_HEIGHT = 640
|
||||
|
@ -54,7 +55,8 @@ class AccessibilityTest : BaseSessionTest() {
|
|||
try {
|
||||
val getVirtualDescendantIdMethod =
|
||||
AccessibilityNodeInfo::class.java.getMethod("getVirtualDescendantId", Long::class.java)
|
||||
return getVirtualDescendantIdMethod.invoke(null, childId) as Int
|
||||
val virtualDescendantId = getVirtualDescendantIdMethod.invoke(null, childId) as Int
|
||||
return if (virtualDescendantId == Int.MAX_VALUE) -1 else virtualDescendantId
|
||||
} catch (ex: Exception) {
|
||||
return 0
|
||||
}
|
||||
|
@ -498,6 +500,7 @@ class AccessibilityTest : BaseSessionTest() {
|
|||
return screenRect.contains(nodeBounds)
|
||||
}
|
||||
|
||||
@ReuseSession(false)
|
||||
@Test fun testScroll() {
|
||||
var nodeId = View.NO_ID
|
||||
sessionRule.session.loadString(
|
||||
|
|
|
@ -141,7 +141,8 @@ var IdentityHandler = {
|
|||
// Don't show identity data for pages with an unknown identity or if any
|
||||
// mixed content is loaded (mixed display content is loaded by default).
|
||||
if (identityMode === this.IDENTITY_MODE_UNKNOWN ||
|
||||
(aState & Ci.nsIWebProgressListener.STATE_IS_BROKEN)) {
|
||||
(aState & Ci.nsIWebProgressListener.STATE_IS_BROKEN) ||
|
||||
(aState & Ci.nsIWebProgressListener.STATE_IS_INSECURE)) {
|
||||
result.secure = false;
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -5888,6 +5888,12 @@ pref("dom.xhr.lowercase_header.enabled", true);
|
|||
// this can be removed.
|
||||
pref("dom.clients.openwindow_favors_same_process", true);
|
||||
|
||||
#ifdef RELEASE_OR_BETA
|
||||
pref("toolkit.aboutPerformance.showInternals", false);
|
||||
#else
|
||||
pref("toolkit.aboutPerformance.showInternals", true);
|
||||
#endif
|
||||
|
||||
// When a crash happens, whether to include heap regions of the crash context
|
||||
// in the minidump. Enabled by default on nightly and aurora.
|
||||
#ifdef RELEASE_OR_BETA
|
||||
|
@ -5942,3 +5948,9 @@ pref("dom.datatransfer.mozAtAPIs", true);
|
|||
#ifdef MOZ_LIBPRIO
|
||||
pref("prio.enabled", false);
|
||||
#endif
|
||||
|
||||
#ifdef NIGHTLY_BUILD
|
||||
pref("dom.sidebar.enabled", false);
|
||||
#else
|
||||
pref("dom.sidebar.enabled", true);
|
||||
#endif
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
[response-stream-disturbed-6.html]
|
||||
[A non-closed stream on which read() has been called]
|
||||
expected: FAIL
|
||||
|
||||
[A non-closed stream on which cancel() has been called]
|
||||
expected: FAIL
|
||||
|
||||
[A closed stream on which read() has been called]
|
||||
expected: FAIL
|
||||
|
||||
[An errored stream on which read() has been called]
|
||||
expected: FAIL
|
||||
|
||||
[An errored stream on which cancel() has been called]
|
||||
expected: FAIL
|
||||
|
|
@ -9,6 +9,7 @@
|
|||
const { PerformanceStats } = ChromeUtils.import("resource://gre/modules/PerformanceStats.jsm", {});
|
||||
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm", {});
|
||||
const { ObjectUtils } = ChromeUtils.import("resource://gre/modules/ObjectUtils.jsm", {});
|
||||
const { AddonManager } = ChromeUtils.import("resource://gre/modules/AddonManager.jsm", {});
|
||||
const { ExtensionParent } = ChromeUtils.import("resource://gre/modules/ExtensionParent.jsm", {});
|
||||
|
||||
const {WebExtensionPolicy} = Cu.getGlobalForObject(Services);
|
||||
|
@ -77,6 +78,13 @@ function extensionCountersEnabled() {
|
|||
return Services.prefs.getBoolPref("extensions.webextensions.enablePerformanceCounters", false);
|
||||
}
|
||||
|
||||
// The ids of system add-ons, so that we can hide them when the
|
||||
// toolkit.aboutPerformance.showInternals pref is false.
|
||||
// The API to access addons is async, so we cache the list during init.
|
||||
// The list is unlikely to change while the about:performance
|
||||
// tab is open, so not updating seems fine.
|
||||
var gSystemAddonIds = new Set();
|
||||
|
||||
let tabFinder = {
|
||||
update() {
|
||||
this._map = new Map();
|
||||
|
@ -602,7 +610,8 @@ var State = {
|
|||
|
||||
let previous = this._buffer[Math.max(this._buffer.length - 2, 0)].tabs;
|
||||
let current = this._latest.tabs;
|
||||
return Object.keys(current).map(id => {
|
||||
let counters = [];
|
||||
for (let id of Object.keys(current)) {
|
||||
let tab = current[id];
|
||||
let oldest;
|
||||
for (let index = 0; index <= this._buffer.length - 2; ++index) {
|
||||
|
@ -614,7 +623,7 @@ var State = {
|
|||
let prev = previous[id];
|
||||
let host = tab.host;
|
||||
|
||||
let type = "tab";
|
||||
let type = "other";
|
||||
let name = `${host} (${id})`;
|
||||
let image = "chrome://mozapps/skin/places/defaultFavicon.svg";
|
||||
let found = tabFinder.get(parseInt(id));
|
||||
|
@ -622,10 +631,10 @@ var State = {
|
|||
if (found.tabbrowser) {
|
||||
name = found.tab.getAttribute("label");
|
||||
image = found.tab.getAttribute("image");
|
||||
type = "tab";
|
||||
} else {
|
||||
name = {id: "preloaded-tab",
|
||||
title: found.tab.linkedBrowser.contentTitle};
|
||||
type = "other";
|
||||
}
|
||||
} else if (id == 1) {
|
||||
name = BRAND_NAME;
|
||||
|
@ -635,10 +644,14 @@ var State = {
|
|||
let addon = WebExtensionPolicy.getByHostname(host);
|
||||
name = `${addon.name} (${addon.id})`;
|
||||
image = "chrome://mozapps/skin/extensions/extensionGeneric-16.svg";
|
||||
type = "addon";
|
||||
type = gSystemAddonIds.has(addon.id) ? "system-addon" : "addon";
|
||||
} else if (id == 0 && !tab.isWorker) {
|
||||
name = {id: "ghost-windows"};
|
||||
type = "other";
|
||||
}
|
||||
|
||||
if (type != "tab" && type != "addon" &&
|
||||
!Services.prefs.getBoolPref("toolkit.aboutPerformance.showInternals", false)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Create a map of all the child items from the previous time we read the
|
||||
|
@ -697,12 +710,13 @@ var State = {
|
|||
durationSinceStartOfBuffer =
|
||||
duration - oldest.duration - (oldest.durationFromFormerChildren || 0);
|
||||
}
|
||||
return ({id, name, image, type,
|
||||
totalDispatches: dispatches, totalDuration: duration,
|
||||
durationSincePrevious, dispatchesSincePrevious,
|
||||
durationSinceStartOfBuffer, dispatchesSinceStartOfBuffer,
|
||||
children});
|
||||
});
|
||||
counters.push({id, name, image, type,
|
||||
totalDispatches: dispatches, totalDuration: duration,
|
||||
durationSincePrevious, dispatchesSincePrevious,
|
||||
durationSinceStartOfBuffer, dispatchesSinceStartOfBuffer,
|
||||
children});
|
||||
}
|
||||
return counters;
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -1029,6 +1043,8 @@ var View = {
|
|||
row.appendChild(elt);
|
||||
|
||||
elt = document.createElement("td");
|
||||
if (type == "system-addon")
|
||||
type = "addon";
|
||||
document.l10n.setAttributes(elt, "type-" + type);
|
||||
row.appendChild(elt);
|
||||
|
||||
|
@ -1352,6 +1368,13 @@ var go = async function() {
|
|||
let opt = document.querySelector(".options");
|
||||
opt.style.display = "none";
|
||||
opt.nextElementSibling.style.display = "none";
|
||||
|
||||
let addons = await AddonManager.getAddonsByTypes(["extension"]);
|
||||
for (let addon of addons) {
|
||||
if (addon.isSystem) {
|
||||
gSystemAddonIds.add(addon.id);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
document.getElementById("dispatch-table").parentNode.style.display = "none";
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
function nsSidebar() {
|
||||
}
|
||||
|
@ -18,6 +19,10 @@ nsSidebar.prototype = {
|
|||
// The capitalization, although nonstandard here, is to match other browsers'
|
||||
// APIs and is therefore important.
|
||||
AddSearchProvider(engineURL) {
|
||||
if (!Services.prefs.getBoolPref("dom.sidebar.enabled", false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.mm) {
|
||||
Cu.reportError(`Installing a search provider from this context is not currently supported: ${Error().stack}.`);
|
||||
return;
|
||||
|
@ -32,9 +37,7 @@ nsSidebar.prototype = {
|
|||
// This function exists to implement window.external.IsSearchProviderInstalled(),
|
||||
// for compatibility with other browsers. The function has been deprecated
|
||||
// and so will not be implemented.
|
||||
IsSearchProviderInstalled(engineURL) {
|
||||
return 0;
|
||||
},
|
||||
IsSearchProviderInstalled() {},
|
||||
|
||||
classID: Components.ID("{22117140-9c6e-11d3-aaf1-00805f8a4905}"),
|
||||
QueryInterface: ChromeUtils.generateQI([Ci.nsIDOMGlobalPropertyInitializer]),
|
||||
|
|
Двоичный файл не отображается.
|
@ -0,0 +1,7 @@
|
|||
Manifest-Version: 1.0
|
||||
|
||||
Name: install.rdf
|
||||
Digest-Algorithms: MD5 SHA1
|
||||
MD5-Digest: 59ZQahS8eYm678dptqF2fQ==
|
||||
SHA1-Digest: fCpbSYnLdjYZpC1t1zwsEztrYA8=
|
||||
|
Двоичные данные
toolkit/mozapps/extensions/test/browser/addons/browser_bug596336_1/META-INF/mozilla.rsa
Normal file
Двоичные данные
toolkit/mozapps/extensions/test/browser/addons/browser_bug596336_1/META-INF/mozilla.rsa
Normal file
Двоичный файл не отображается.
|
@ -0,0 +1,4 @@
|
|||
Signature-Version: 1.0
|
||||
MD5-Digest-Manifest: Cp9ofwdMdvAralffnWqQww==
|
||||
SHA1-Digest-Manifest: TpmukUYFQ+eJgQzFeAUYw+PzUdY=
|
||||
|
Двоичный файл не отображается.
|
@ -0,0 +1,7 @@
|
|||
Manifest-Version: 1.0
|
||||
|
||||
Name: install.rdf
|
||||
Digest-Algorithms: MD5 SHA1
|
||||
MD5-Digest: 1gYPkSqlgVzw1RWJIVLXrQ==
|
||||
SHA1-Digest: 046B+AIjFVBHO7G2BQfj2zoPvRw=
|
||||
|
Двоичные данные
toolkit/mozapps/extensions/test/browser/addons/browser_bug596336_2/META-INF/mozilla.rsa
Normal file
Двоичные данные
toolkit/mozapps/extensions/test/browser/addons/browser_bug596336_2/META-INF/mozilla.rsa
Normal file
Двоичный файл не отображается.
|
@ -0,0 +1,4 @@
|
|||
Signature-Version: 1.0
|
||||
MD5-Digest-Manifest: whMuT0nKTV49pQyLDTgTfA==
|
||||
SHA1-Digest-Manifest: WzDdDwYCt5znpmOn2Sz8eCWWcvA=
|
||||
|
Двоичный файл не отображается.
|
@ -0,0 +1,8 @@
|
|||
Manifest-Version: 1.0
|
||||
|
||||
Name: manifest.json
|
||||
Digest-Algorithms: MD5 SHA1 SHA256
|
||||
MD5-Digest: mCLu38qfGN3trj7qKQQeEA==
|
||||
SHA1-Digest: A1BaJErQY6KqnYDijP0lglrehk0=
|
||||
SHA256-Digest: p2vjGP7DRqrK81NfT4LqnF7a5p8+lEuout5WLBhk9AA=
|
||||
|
Двоичные данные
toolkit/mozapps/extensions/test/browser/addons/browser_dragdrop1/META-INF/mozilla.rsa
Normal file
Двоичные данные
toolkit/mozapps/extensions/test/browser/addons/browser_dragdrop1/META-INF/mozilla.rsa
Normal file
Двоичный файл не отображается.
|
@ -0,0 +1,5 @@
|
|||
Signature-Version: 1.0
|
||||
MD5-Digest-Manifest: LrrwWBKNYWeVd205Hq+JwQ==
|
||||
SHA1-Digest-Manifest: MeqqQN+uuf0MVesMXxbBtYN+5tU=
|
||||
SHA256-Digest-Manifest: iWCxfAJX593Cn4l8R63jaQETO5HX3XOhcnpQ7nMiPlg=
|
||||
|
Двоичный файл не отображается.
|
@ -0,0 +1,8 @@
|
|||
Manifest-Version: 1.0
|
||||
|
||||
Name: manifest.json
|
||||
Digest-Algorithms: MD5 SHA1 SHA256
|
||||
MD5-Digest: 3dL7JFDBPC63pSFI5x+Z7Q==
|
||||
SHA1-Digest: l1cKPyWJIYdZyvumH9VfJ6fpqVA=
|
||||
SHA256-Digest: QHTjPqTMXxt5tl8zOaAzpQ8FZLqZx8LRF9LmzY+RCDQ=
|
||||
|
Двоичные данные
toolkit/mozapps/extensions/test/browser/addons/browser_dragdrop2/META-INF/mozilla.rsa
Normal file
Двоичные данные
toolkit/mozapps/extensions/test/browser/addons/browser_dragdrop2/META-INF/mozilla.rsa
Normal file
Двоичный файл не отображается.
|
@ -0,0 +1,5 @@
|
|||
Signature-Version: 1.0
|
||||
MD5-Digest-Manifest: c30hzcI1ISlt46ODjVVJ2w==
|
||||
SHA1-Digest-Manifest: 2yMpQHuLM0J61T7vt11NHoYI1tU=
|
||||
SHA256-Digest-Manifest: qtsYxiv1zGWBp7JWxLWrIztIdxIt+i3CToReEx5fkyw=
|
||||
|
Двоичный файл не отображается.
|
@ -0,0 +1,8 @@
|
|||
Manifest-Version: 1.0
|
||||
|
||||
Name: manifest.json
|
||||
Digest-Algorithms: MD5 SHA1 SHA256
|
||||
MD5-Digest: Wzo/k6fhArpFb4UB2hIKlg==
|
||||
SHA1-Digest: D/WDy9api0X7OgRM6Gkvfbyzogo=
|
||||
SHA256-Digest: IWBdbytHgPLtCMKKhiZ3jenxKmKiRAhh3ce8iP5AVWU=
|
||||
|
Двоичные данные
toolkit/mozapps/extensions/test/browser/addons/browser_dragdrop_incompat/META-INF/mozilla.rsa
Normal file
Двоичные данные
toolkit/mozapps/extensions/test/browser/addons/browser_dragdrop_incompat/META-INF/mozilla.rsa
Normal file
Двоичный файл не отображается.
|
@ -0,0 +1,5 @@
|
|||
Signature-Version: 1.0
|
||||
MD5-Digest-Manifest: ovtNeIie34gMM5l18zP2MA==
|
||||
SHA1-Digest-Manifest: c5owdrvcOINxKp/HprYkWXXI/js=
|
||||
SHA256-Digest-Manifest: uLPmoONlxFYxWeSTOEPJ9hN2yMDDZMJL1PoNIWcqKG4=
|
||||
|
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
|
@ -0,0 +1,8 @@
|
|||
Manifest-Version: 1.0
|
||||
|
||||
Name: manifest.json
|
||||
Digest-Algorithms: MD5 SHA1 SHA256
|
||||
MD5-Digest: b4Q2C4GsIJfRLsXc7T2ldQ==
|
||||
SHA1-Digest: UG5rHxpzKmdlGrquXaguiAGDu8E=
|
||||
SHA256-Digest: WZrN9SdGBux9t3lV7TVIvyUG/L1px4er2dU3TsBpC4s=
|
||||
|
Двоичные данные
toolkit/mozapps/extensions/test/browser/addons/browser_installssl/META-INF/mozilla.rsa
Normal file
Двоичные данные
toolkit/mozapps/extensions/test/browser/addons/browser_installssl/META-INF/mozilla.rsa
Normal file
Двоичный файл не отображается.
|
@ -0,0 +1,5 @@
|
|||
Signature-Version: 1.0
|
||||
MD5-Digest-Manifest: zqRm8+jxS0iRUGWeArGkXg==
|
||||
SHA1-Digest-Manifest: pa/31Ll1PYx0dPBQ6C+fd1/wJO4=
|
||||
SHA256-Digest-Manifest: DJELIyswfwgeL0kaRqogXW2bzUKhn+Pickfv6WHBsW8=
|
||||
|
Двоичные данные
toolkit/mozapps/extensions/test/browser/addons/browser_theme.xpi
Двоичные данные
toolkit/mozapps/extensions/test/browser/addons/browser_theme.xpi
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
|
@ -1,10 +0,0 @@
|
|||
/* exported startup, shutdown, install, uninstall */
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
function startup(data, reason) {
|
||||
Services.prefs.setIntPref("webapitest.active_version", 1);
|
||||
}
|
||||
|
||||
function shutdown(data, reason) {
|
||||
Services.prefs.setIntPref("webapitest.active_version", 0);
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
|
||||
|
||||
<Description about="urn:mozilla:install-manifest">
|
||||
<em:id>webapi_install@tests.mozilla.org</em:id>
|
||||
<em:version>1.1</em:version>
|
||||
<em:name>AddonManger web API test</em:name>
|
||||
<em:bootstrap>true</em:bootstrap>
|
||||
|
||||
<em:targetApplication>
|
||||
<Description>
|
||||
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
|
||||
<em:minVersion>0.3</em:minVersion>
|
||||
<em:maxVersion>*</em:maxVersion>
|
||||
</Description>
|
||||
</em:targetApplication>
|
||||
|
||||
<em:targetApplication>
|
||||
<Description>
|
||||
<em:id>toolkit@mozilla.org</em:id>
|
||||
<em:minVersion>0</em:minVersion>
|
||||
<em:maxVersion>*</em:maxVersion>
|
||||
</Description>
|
||||
</em:targetApplication>
|
||||
|
||||
</Description>
|
||||
</RDF>
|
Двоичный файл не отображается.
|
@ -0,0 +1,12 @@
|
|||
Manifest-Version: 1.0
|
||||
|
||||
Name: manifest.json
|
||||
Digest-Algorithms: MD5 SHA1
|
||||
MD5-Digest: Rnoaa6yWePDor5y5/SLFaw==
|
||||
SHA1-Digest: k51DtKj7bYrwkFJDdmYNDQeUBlA=
|
||||
|
||||
Name: options.html
|
||||
Digest-Algorithms: MD5 SHA1
|
||||
MD5-Digest: vTjxWlRpioEhTZGKTNUqIw==
|
||||
SHA1-Digest: Y/mr6A34LsvekgRpdhyZRwPF1Vw=
|
||||
|
Двоичные данные
toolkit/mozapps/extensions/test/browser/addons/options_signed/META-INF/mozilla.rsa
Normal file
Двоичные данные
toolkit/mozapps/extensions/test/browser/addons/options_signed/META-INF/mozilla.rsa
Normal file
Двоичный файл не отображается.
|
@ -0,0 +1,4 @@
|
|||
Signature-Version: 1.0
|
||||
MD5-Digest-Manifest: rdmx8VMNzkZ5tRf7tt8G1w==
|
||||
SHA1-Digest-Manifest: gjtTe8X9Tg46Hz2h4Tru3T02hmE=
|
||||
|
|
@ -1,7 +1,17 @@
|
|||
[DEFAULT]
|
||||
tags = addons
|
||||
support-files =
|
||||
addons/*
|
||||
addons/browser_bug596336_1.xpi
|
||||
addons/browser_bug596336_2.xpi
|
||||
addons/browser_dragdrop1.xpi
|
||||
addons/browser_dragdrop2.xpi
|
||||
addons/browser_dragdrop_incompat.xpi
|
||||
addons/browser_installssl.xpi
|
||||
addons/browser_theme.xpi
|
||||
addons/browser_update1_1.xpi
|
||||
addons/browser_update1_2.xpi
|
||||
addons/options_signed.xpi
|
||||
addons/options_signed/*
|
||||
addon_prefs.xul
|
||||
discovery.html
|
||||
head.js
|
||||
|
@ -27,6 +37,18 @@ support-files =
|
|||
!/toolkit/mozapps/extensions/test/xpinstall/amosigned.xpi
|
||||
!/toolkit/mozapps/extensions/test/xpinstall/amosigned-restart-required.xpi
|
||||
|
||||
generated-files =
|
||||
addons/browser_bug596336_1.xpi
|
||||
addons/browser_bug596336_2.xpi
|
||||
addons/browser_dragdrop1.xpi
|
||||
addons/browser_dragdrop2.xpi
|
||||
addons/browser_dragdrop_incompat.xpi
|
||||
addons/browser_installssl.xpi
|
||||
addons/browser_theme.xpi
|
||||
addons/browser_update1_1.xpi
|
||||
addons/browser_update1_2.xpi
|
||||
addons/options_signed.xpi
|
||||
|
||||
[browser_CTP_plugins.js]
|
||||
tags = blocklist
|
||||
[browser_bug523784.js]
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
const TESTPAGE = `${SECURE_TESTROOT}webapi_checkavailable.html`;
|
||||
const XPI_URL = `${SECURE_TESTROOT}addons/browser_webapi_install.xpi`;
|
||||
const XPI_SHA = "sha256:d4bab17ff9ba5f635e97c84021f4c527c502250d62ab7f6e6c9e8ee28822f772";
|
||||
const XPI_URL = `${SECURE_TESTROOT}../xpinstall/amosigned.xpi`;
|
||||
|
||||
const ID = "webapi_install@tests.mozilla.org";
|
||||
const XPI_SHA = "sha256:91121ed2c27f670f2307b9aebdd30979f147318c7fb9111c254c14ddbb84e4b0";
|
||||
|
||||
const ID = "amosigned-xpi@tests.mozilla.org";
|
||||
// eh, would be good to just stat the real file instead of this...
|
||||
const XPI_LEN = 4782;
|
||||
const XPI_LEN = 4287;
|
||||
|
||||
function waitForClear() {
|
||||
const MSG = "WebAPICleanup";
|
||||
|
@ -38,6 +39,10 @@ add_task(async function setup() {
|
|||
// with properties that the AddonInstall object is expected to have when
|
||||
// that event is triggered.
|
||||
async function testInstall(browser, args, steps, description) {
|
||||
promisePopupNotificationShown("addon-webext-permissions").then(panel => {
|
||||
panel.button.click();
|
||||
});
|
||||
|
||||
let success = await ContentTask.spawn(browser, {args, steps}, async function(opts) {
|
||||
let { args, steps } = opts;
|
||||
let install = await content.navigator.mozAddonManager.createInstall(args);
|
||||
|
@ -203,24 +208,21 @@ function makeRegularTest(options, what) {
|
|||
|
||||
await promptPromise;
|
||||
|
||||
let version = Services.prefs.getIntPref("webapitest.active_version");
|
||||
is(version, 1, "the install really did work");
|
||||
|
||||
// Sanity check to ensure that the test in makeInstallTest() that
|
||||
// installs.size == 0 means we actually did clean up.
|
||||
ok(AddonManager.webAPI.installs.size > 0, "webAPI is tracking the AddonInstall");
|
||||
|
||||
let addons = await promiseAddonsByIDs([ID]);
|
||||
isnot(addons[0], null, "Found the addon");
|
||||
let addon = await promiseAddonByID(ID);
|
||||
isnot(addon, null, "Found the addon");
|
||||
|
||||
// Check that the expected installTelemetryInfo has been stored in the addon details.
|
||||
Assert.deepEqual(addons[0].installTelemetryInfo, {source: "test-host", method: "amWebAPI"},
|
||||
Assert.deepEqual(addon.installTelemetryInfo, {source: "test-host", method: "amWebAPI"},
|
||||
"Got the expected addon.installTelemetryInfo");
|
||||
|
||||
await addons[0].uninstall();
|
||||
await addon.uninstall();
|
||||
|
||||
addons = await promiseAddonsByIDs([ID]);
|
||||
is(addons[0], null, "Addon was uninstalled");
|
||||
addon = await promiseAddonByID(ID);
|
||||
is(addon, null, "Addon was uninstalled");
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -7,3 +7,29 @@
|
|||
BROWSER_CHROME_MANIFESTS += [
|
||||
'browser.ini',
|
||||
]
|
||||
|
||||
addons = [
|
||||
'browser_bug596336_1',
|
||||
'browser_bug596336_2',
|
||||
'browser_dragdrop1',
|
||||
'browser_dragdrop2',
|
||||
'browser_dragdrop_incompat',
|
||||
'browser_installssl',
|
||||
'browser_theme',
|
||||
'browser_update1_1',
|
||||
'browser_update1_2',
|
||||
'options_signed',
|
||||
]
|
||||
|
||||
output_dir = OBJDIR_FILES._tests.testing.mochitest.browser.toolkit.mozapps.extensions.test.browser.addons
|
||||
|
||||
for addon in addons:
|
||||
indir = 'addons/%s' % addon
|
||||
xpi = '%s.xpi' % indir
|
||||
|
||||
GENERATED_FILES += [xpi]
|
||||
GENERATED_FILES[xpi].script = '../create_xpi.py'
|
||||
GENERATED_FILES[xpi].inputs = [indir]
|
||||
|
||||
output_dir += ['!%s' % xpi]
|
||||
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
from os.path import abspath
|
||||
|
||||
from mozbuild.action.zip import main as create_zip
|
||||
|
||||
def main(output, input_dir):
|
||||
output.close()
|
||||
|
||||
return create_zip(['-C', input_dir, abspath(output.name), '**'])
|
|
@ -43,7 +43,6 @@ function testWindowlessBrowser(chromePrivileged) {
|
|||
ok(win.outerWidth == 0, "window.outerWidth should be 0 in a windowless browser");
|
||||
ok(win.outerHeight == 0, "window.outerHeight should be 0 in a windowless browser");
|
||||
|
||||
ok(win.sidebar, "window.sidebar should be defined");
|
||||
ok(win.external, "window.external should be defined");
|
||||
|
||||
var exception;
|
||||
|
|
Загрузка…
Ссылка в новой задаче