@@ -0,0 +1,2194 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.%0A// Use of this source code is governed by a BSD-style license that can be%0A// found in the LICENSE file.%0A%0Apackage org.chromium.android_webview.test;%0A%0Aimport android.test.suitebuilder.annotation.SmallTest;%0A%0Aimport org.chromium.android_webview.AwContents;%0Aimport org.chromium.base.test.util.Feature;%0A%0A/**%0A * TestSuite for EME key systems.%0A */%0Apublic class KeySystemTest extends AwTestBase %7B%0A%0A    private TestAwContentsClient mContentsClient = new TestAwContentsClient();%0A    private AwContents mAwContents;%0A%0A    @Override%0A    protected void setUp() throws Exception %7B%0A        super.setUp();%0A%0A        final AwTestContainerView testContainerView =%0A                createAwTestContainerViewOnMainSync(mContentsClient);%0A        mAwContents = testContainerView.getAwContents();%0A        enableJavaScriptOnUiThread(mAwContents);%0A%0A        loadDataSync(mAwContents, mContentsClient.getOnPageFinishedHelper(),%0A            getKeySystemTestPage(), %22text/html%22, false);%0A    %7D%0A%0A    private String getKeySystemTestPage() %7B%0A        return %22%3Chtml%3E %3Cscript%3E%22 +%0A                %22function isKeySystemSupported(keySystem) %7B%22 +%0A                    %22var video = document.createElement('video');%22 +%0A                    %22return video.canPlayType('video/mp4', keySystem);%22 +%0A                %22%7D%22 +%0A                %22%3C/script%3E %3C/html%3E%22;%0A    %7D%0A%0A    private String IsKeySystemSupported(String keySystem) throws Exception %7B%0A        return executeJavaScriptAndWaitForResult(mAwContents, mContentsClient,%0A                  %22isKeySystemSupported('%22 + keySystem + %22')%22);%0A    %7D%0A%0A    @Feature(%7B%22AndroidWebView%22%7D)%0A    @SmallTest%0A    public void testSupportClearKeySystem() throws Throwable %7B%0A        assertEquals(%22%5C%22maybe%5C%22%22, IsKeySystemSupported(%22webkit-org.w3.clearkey%22));%0A    %7D%0A%0A    @Feature(%7B%22AndroidWebView%22%7D)%0A    @SmallTest%0A    public void testSupportWidevineKeySystem() throws Throwable %7B%0A        assertEquals(%22%5C%22maybe%5C%22%22, IsKeySystemSupported(%22com.widevine.alpha%22));%0A    %7D%0A%0A    @Feature(%7B%22AndroidWebView%22%7D)%0A    @SmallTest%0A    public void testNotSupportFooKeySystem() throws Throwable %7B%0A        assertEquals(%22%5C%22%5C%22%22, IsKeySystemSupported(%22com.foo.keysystem%22));%0A    %7D%0A%7D%0A

Add EME key system tests in android_webview_instrumentation_tests.