Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8bf7cace authored by Svetoslav Ganov's avatar Svetoslav Ganov
Browse files

Added tests for WebView accessibility no JS

bug:3421690

This change is related to change:Idfec7e6a

1. Added tests for cases in which the previous
   implementation was not behaving as expected.

2. Refatered the tests to be intrumentation tests
   since the code under tests uses the DOM element
   dimensions to determine visibility and if the
   the WebView has no size i.e. not attached to
   ViewRoot the size of all DOM elements is zero
   forcing all tests to fail.

Change-Id: Ib4c01af8feb09f2b2a6b9d906e08bfaaa9e9bc74
parent 61eadaa6
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1210,6 +1210,13 @@
                android:authorities="android.app.SuggestionProvider">
        </provider>

        <activity android:name="android.webkit.AccessibilityInjectorTestActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
            </intent-filter>
        </activity>

    </application>

    <instrumentation android:name="android.test.InstrumentationTestRunner"
+20 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<WebView xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/webview"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
+289 −51

File changed.

Preview size limit exceeded, changes collapsed.

+38 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2011 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.webkit;

import com.android.frameworks.coretests.R;

import android.app.Activity;
import android.os.Bundle;

public class AccessibilityInjectorTestActivity extends Activity {

    private WebView mWebView;

    @Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        setContentView(R.layout.accessibility_injector_test);
        mWebView = (WebView) findViewById(R.id.webview);
    }

    public WebView getWebView() {
        return mWebView;
    }
}