OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |