| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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.support.test.filters.SmallTest; | 7 import android.support.test.filters.SmallTest; |
| 8 | 8 |
| 9 import org.chromium.android_webview.AwContents; | 9 import org.chromium.android_webview.AwContents; |
| 10 import org.chromium.android_webview.permission.AwPermissionRequest; | 10 import org.chromium.android_webview.permission.AwPermissionRequest; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 */ | 23 */ |
| 24 public class KeySystemTest extends AwTestBase { | 24 public class KeySystemTest extends AwTestBase { |
| 25 /** | 25 /** |
| 26 * AwContentsClient subclass that allows permissions requests for the | 26 * AwContentsClient subclass that allows permissions requests for the |
| 27 * protected media ID. This is required for all supported key systems other | 27 * protected media ID. This is required for all supported key systems other |
| 28 * than Clear Key. | 28 * than Clear Key. |
| 29 */ | 29 */ |
| 30 private static class EmeAllowingAwContentsClient extends TestAwContentsClien
t { | 30 private static class EmeAllowingAwContentsClient extends TestAwContentsClien
t { |
| 31 @Override | 31 @Override |
| 32 public void onPermissionRequest(AwPermissionRequest awPermissionRequest)
{ | 32 public void onPermissionRequest(AwPermissionRequest awPermissionRequest)
{ |
| 33 if (awPermissionRequest.getResources() == Resource.ProtectedMediaId)
{ | 33 if (awPermissionRequest.getResources() == Resource.PROTECTED_MEDIA_I
D) { |
| 34 awPermissionRequest.grant(); | 34 awPermissionRequest.grant(); |
| 35 } else { | 35 } else { |
| 36 awPermissionRequest.deny(); | 36 awPermissionRequest.deny(); |
| 37 } | 37 } |
| 38 } | 38 } |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 private TestAwContentsClient mContentsClient = new EmeAllowingAwContentsClie
nt(); | 41 private TestAwContentsClient mContentsClient = new EmeAllowingAwContentsClie
nt(); |
| 42 private AwContents mAwContents; | 42 private AwContents mAwContents; |
| 43 | 43 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 assertEquals(getPlatformKeySystemExpectations(), | 126 assertEquals(getPlatformKeySystemExpectations(), |
| 127 isKeySystemSupported("x-com.oem.test-keysystem")); | 127 isKeySystemSupported("x-com.oem.test-keysystem")); |
| 128 } | 128 } |
| 129 | 129 |
| 130 @Feature({"AndroidWebView"}) | 130 @Feature({"AndroidWebView"}) |
| 131 @SmallTest | 131 @SmallTest |
| 132 public void testSupportPlatformKeySystemNoPrefix() throws Throwable { | 132 public void testSupportPlatformKeySystemNoPrefix() throws Throwable { |
| 133 assertEquals("\"NotSupportedError\"", isKeySystemSupported("com.oem.test
-keysystem")); | 133 assertEquals("\"NotSupportedError\"", isKeySystemSupported("com.oem.test
-keysystem")); |
| 134 } | 134 } |
| 135 } | 135 } |
| OLD | NEW |