Comply with new addjavascriptinterface enforcement
Bug: 7073422
Use @JavascriptInterface annotation to comply with modifications
to addjavascriptinterface method.
Change-Id: I0b8e803dcbdf6e0471dbc7c59e6cc8d424780149
diff --git a/tests/tests/webkit/src/android/webkit/cts/WebViewTest.java b/tests/tests/webkit/src/android/webkit/cts/WebViewTest.java
index 3f7ea78..6c66f52 100755
--- a/tests/tests/webkit/src/android/webkit/cts/WebViewTest.java
+++ b/tests/tests/webkit/src/android/webkit/cts/WebViewTest.java
@@ -45,6 +45,7 @@
import android.webkit.CacheManager.CacheResult;
import android.webkit.ConsoleMessage;
import android.webkit.DownloadListener;
+import android.webkit.JavascriptInterface;
import android.webkit.SslErrorHandler;
import android.webkit.WebBackForwardList;
import android.webkit.WebChromeClient;
@@ -411,6 +412,7 @@
return mWasProvideResultCalled;
}
+ @JavascriptInterface
public synchronized void provideResult(String result) {
mWasProvideResultCalled = true;
mResult = result;
@@ -483,9 +485,12 @@
public void testUseRemovedJavascriptInterface() throws Throwable {
class RemovedObject {
@Override
+ @JavascriptInterface
public String toString() {
return "removedObject";
}
+
+ @JavascriptInterface
public void remove() throws Throwable {
mOnUiThread.removeJavascriptInterface("removedObject");
System.gc();
@@ -494,6 +499,8 @@
class ResultObject {
private String mResult;
private boolean mIsResultAvailable;
+
+ @JavascriptInterface
public synchronized void setResult(String result) {
mResult = result;
mIsResultAvailable = true;
@@ -1170,6 +1177,7 @@
final class ImageLoaded {
public boolean mImageLoaded;
+ @JavascriptInterface
public void loaded() {
mImageLoaded = true;
}
@@ -1769,6 +1777,8 @@
public void testPauseResumeTimers() throws Throwable {
class Monitor {
private boolean mIsUpdated;
+
+ @JavascriptInterface
public synchronized void update() {
mIsUpdated = true;
notify();