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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.android_webview.test; 5 package org.chromium.android_webview.test;
6 6
7 import android.graphics.Bitmap; 7 import android.graphics.Bitmap;
8 import android.graphics.BitmapFactory; 8 import android.graphics.BitmapFactory;
9 import android.graphics.Canvas; 9 import android.graphics.Canvas;
10 import android.os.Build; 10 import android.os.Build;
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 onSslErrorCallCount = onReceivedSslErrorHelper.getCallCount(); 558 onSslErrorCallCount = onReceivedSslErrorHelper.getCallCount();
559 loadUrlSync(awContents, mContentsClient.getOnPageFinishedHelper(), pageU rl); 559 loadUrlSync(awContents, mContentsClient.getOnPageFinishedHelper(), pageU rl);
560 assertEquals(onSslErrorCallCount + 1, onReceivedSslErrorHelper.getCallCo unt()); 560 assertEquals(onSslErrorCallCount + 1, onReceivedSslErrorHelper.getCallCo unt());
561 561
562 // Now load the same page again. This time, we still expect onReceivedSs lError, 562 // Now load the same page again. This time, we still expect onReceivedSs lError,
563 // because we only remember user's decision if it is "allow". 563 // because we only remember user's decision if it is "allow".
564 onSslErrorCallCount = onReceivedSslErrorHelper.getCallCount(); 564 onSslErrorCallCount = onReceivedSslErrorHelper.getCallCount();
565 loadUrlSync(awContents, mContentsClient.getOnPageFinishedHelper(), pageU rl); 565 loadUrlSync(awContents, mContentsClient.getOnPageFinishedHelper(), pageU rl);
566 assertEquals(onSslErrorCallCount + 1, onReceivedSslErrorHelper.getCallCo unt()); 566 assertEquals(onSslErrorCallCount + 1, onReceivedSslErrorHelper.getCallCo unt());
567 } 567 }
568
569 /**
570 * Verifies that Web Notifications and the Push API are not exposed in WebVi ew.
571 */
572 @Feature({"AndroidWebView"})
573 @SmallTest
574 public void testPushAndNotificationsDisabled() throws Throwable {
575 AwTestContainerView testView = createAwTestContainerViewOnMainSync(mCont entsClient);
576 AwContents awContents = testView.getAwContents();
577
578 String script = "window.Notification || window.PushManager";
579
580 enableJavaScriptOnUiThread(awContents);
581 loadUrlSync(awContents, mContentsClient.getOnPageFinishedHelper(), "abou t:blank");
582 assertEquals("false", executeJavaScriptAndWaitForResult(awContents, mCon tentsClient,
583 script));
584 }
568 } 585 }
OLDNEW
« 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