зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset d52680bbda73 (bug 1642345) for Mochitest failures in toolkit/components/alerts/test/test_alerts_noobserve.html. CLOSED TREE
This commit is contained in:
Родитель
9a5c7b4d86
Коммит
d05df77874
|
@ -1703,7 +1703,6 @@ package org.mozilla.geckoview {
|
|||
field @Nullable public final String imageUrl;
|
||||
field @Nullable public final String lang;
|
||||
field @NonNull public final boolean requireInteraction;
|
||||
field @NonNull public final String source;
|
||||
field @NonNull public final String tag;
|
||||
field @Nullable public final String text;
|
||||
field @Nullable public final String textDirection;
|
||||
|
|
|
@ -56,7 +56,6 @@ class WebNotificationTest : BaseSessionTest() {
|
|||
assertThat("Direction should match", notification.textDirection, equalTo("ltr"))
|
||||
assertThat("Require Interaction should match", notification.requireInteraction,
|
||||
equalTo(requireInteraction))
|
||||
assertThat("Source should match", notification.source, equalTo(createTestUrl(HELLO_HTML_PATH)))
|
||||
notificationResult.complete(null)
|
||||
}
|
||||
})
|
||||
|
|
|
@ -19,6 +19,7 @@ import org.mozilla.geckoview.*
|
|||
import org.mozilla.geckoview.test.rule.GeckoSessionTestRule
|
||||
import org.mozilla.geckoview.test.rule.GeckoSessionTestRule.RejectedPromiseException
|
||||
import org.mozilla.geckoview.test.util.Callbacks
|
||||
import java.math.BigInteger
|
||||
import java.security.KeyPair
|
||||
import java.security.KeyPairGenerator
|
||||
import java.security.SecureRandom
|
||||
|
@ -168,7 +169,6 @@ class WebPushTest : BaseSessionTest() {
|
|||
override fun onShowNotification(notification: WebNotification) {
|
||||
assertThat("Title should match", notification.title, equalTo(expectedTitle))
|
||||
assertThat("Body should match", notification.text, equalTo(expectedBody))
|
||||
assertThat("Source should match", notification.source, endsWith("sw.js"))
|
||||
notificationResult.complete(null)
|
||||
}
|
||||
})
|
||||
|
|
|
@ -74,17 +74,11 @@ public class WebNotification {
|
|||
*/
|
||||
public final @NonNull boolean requireInteraction;
|
||||
|
||||
/**
|
||||
* This is the URL of the page or Service Worker that generated the notification.
|
||||
*/
|
||||
public final @NonNull String source;
|
||||
|
||||
@WrapForJNI
|
||||
/* package */ WebNotification(@Nullable final String title, @NonNull final String tag,
|
||||
@Nullable final String cookie, @Nullable final String text,
|
||||
@Nullable final String imageUrl, @Nullable final String textDirection,
|
||||
@Nullable final String lang, @NonNull final boolean requireInteraction,
|
||||
@NonNull final String source) {
|
||||
@Nullable final String lang, @NonNull final boolean requireInteraction) {
|
||||
this.tag = tag;
|
||||
this.mCookie = cookie;
|
||||
this.title = title;
|
||||
|
@ -93,7 +87,6 @@ public class WebNotification {
|
|||
this.textDirection = textDirection;
|
||||
this.lang = lang;
|
||||
this.requireInteraction = requireInteraction;
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -17,12 +17,8 @@ exclude: true
|
|||
- Added `runtime.openOptionsPage` support. For `options_ui.open_in_new_tab` ==
|
||||
`false`, [`TabDelegate.onOpenOptionsPage`][79.1] is called.
|
||||
([bug 1618058]({{bugzilla}}1619766))
|
||||
- Added [`WebNotification.source`][79.2], which is the URL of the page
|
||||
or Service Worker that created the notification.
|
||||
|
||||
|
||||
[79.1]: {{javadoc_uri}}/WebExtension.TabDelegate.html#onOpenOptionsPage-org.mozilla.geckoview.WebExtension-
|
||||
[79.2]: {{javadoc_uri}}/WebNotification.html#source
|
||||
|
||||
## v78
|
||||
- Added [`WebExtensionController.installBuiltIn`][78.1] that allows installing an
|
||||
|
@ -723,4 +719,4 @@ exclude: true
|
|||
[65.24]: {{javadoc_uri}}/CrashReporter.html#sendCrashReport-android.content.Context-android.os.Bundle-java.lang.String-
|
||||
[65.25]: {{javadoc_uri}}/GeckoResult.html
|
||||
|
||||
[api-version]: 820c4bbc052bd8b8b19c2460c3996b86e1786ff7
|
||||
[api-version]: c75d02b7653f49b0d301d95a50f6d559dca1c48c
|
||||
|
|
|
@ -6,8 +6,7 @@
|
|||
#include "AndroidAlerts.h"
|
||||
#include "mozilla/java/GeckoRuntimeWrappers.h"
|
||||
#include "mozilla/java/WebNotificationWrappers.h"
|
||||
#include "nsIPrincipal.h"
|
||||
#include "nsIURI.h"
|
||||
#include "nsAlertsUtils.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace widget {
|
||||
|
@ -77,13 +76,12 @@ AndroidAlerts::ShowPersistentNotification(const nsAString& aPersistentData,
|
|||
rv = aAlert->GetRequireInteraction(&requireInteraction);
|
||||
NS_ENSURE_SUCCESS(rv, NS_OK);
|
||||
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
rv = aAlert->GetURI(getter_AddRefs(uri));
|
||||
nsCOMPtr<nsIPrincipal> principal;
|
||||
rv = aAlert->GetPrincipal(getter_AddRefs(principal));
|
||||
NS_ENSURE_SUCCESS(rv, NS_OK);
|
||||
|
||||
nsCString spec;
|
||||
rv = uri->GetDisplaySpec(spec);
|
||||
NS_ENSURE_SUCCESS(rv, NS_OK);
|
||||
nsAutoString host;
|
||||
nsAlertsUtils::GetSourceHostPort(principal, host);
|
||||
|
||||
if (aPersistentData.IsEmpty() && aAlertListener) {
|
||||
if (!sListenerMap) {
|
||||
|
@ -94,7 +92,7 @@ AndroidAlerts::ShowPersistentNotification(const nsAString& aPersistentData,
|
|||
}
|
||||
|
||||
java::WebNotification::LocalRef notification = notification->New(
|
||||
title, name, cookie, text, imageUrl, dir, lang, requireInteraction, spec);
|
||||
title, name, cookie, text, imageUrl, dir, lang, requireInteraction);
|
||||
java::GeckoRuntime::LocalRef runtime = java::GeckoRuntime::GetInstance();
|
||||
if (runtime != NULL) {
|
||||
runtime->NotifyOnShow(notification);
|
||||
|
|
Загрузка…
Ссылка в новой задаче