Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2155)

Unified Diff: android_webview/javatests/src/org/chromium/android_webview/test/AwContentsTest.java

Issue 914373003: Exceptions for Web Notifications and the Push API by default. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: android_webview/javatests/src/org/chromium/android_webview/test/AwContentsTest.java
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsTest.java
index feae27ee2dc05b124e4cdfbdabefad3c4dacf44c..1a8dbdc845785bfec6477c32d0b2a5a8cf3cd079 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsTest.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsTest.java
@@ -565,4 +565,21 @@ public class AwContentsTest extends AwTestBase {
loadUrlSync(awContents, mContentsClient.getOnPageFinishedHelper(), pageUrl);
assertEquals(onSslErrorCallCount + 1, onReceivedSslErrorHelper.getCallCount());
}
+
+ /**
+ * Verifies that Web Notifications and the Push API are not exposed in WebView.
+ */
+ @Feature({"AndroidWebView"})
+ @SmallTest
+ public void testPushAndNotificationsDisabled() throws Throwable {
+ AwTestContainerView testView = createAwTestContainerViewOnMainSync(mContentsClient);
+ AwContents awContents = testView.getAwContents();
+
+ String script = "window.Notification || window.PushManager";
+
+ enableJavaScriptOnUiThread(awContents);
+ loadUrlSync(awContents, mContentsClient.getOnPageFinishedHelper(), "about:blank");
+ assertEquals("false", executeJavaScriptAndWaitForResult(awContents, mContentsClient,
+ script));
+ }
}
« no previous file with comments | « no previous file | android_webview/lib/main/aw_main_delegate.cc » ('j') | android_webview/lib/main/aw_main_delegate.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698