| Index: android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
 | 
| diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
 | 
| index 08c6ebc7b8244df355e8272fdf9b7f95db466fe2..49af5c2928fc53bb851d964c32c08e85788c2407 100644
 | 
| --- a/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
 | 
| +++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
 | 
| @@ -273,6 +273,26 @@ public class AwTestBase
 | 
|                  TimeUnit.MILLISECONDS);
 | 
|      }
 | 
|  
 | 
| +    public void waitForVisualStateCallback(final AwContents awContents) throws Exception {
 | 
| +        final CallbackHelper ch = new CallbackHelper();
 | 
| +        final int chCount = ch.getCallCount();
 | 
| +        getInstrumentation().runOnMainSync(new Runnable() {
 | 
| +            @Override
 | 
| +            public void run() {
 | 
| +                final long requestId = 666;
 | 
| +                awContents.insertVisualStateCallback(requestId,
 | 
| +                        new AwContents.VisualStateCallback() {
 | 
| +                            @Override
 | 
| +                            public void onComplete(long id) {
 | 
| +                                assertEquals(requestId, id);
 | 
| +                                ch.notifyCalled();
 | 
| +                            }
 | 
| +                        });
 | 
| +            }
 | 
| +        });
 | 
| +        ch.waitForCallback(chCount);
 | 
| +    }
 | 
| +
 | 
|      /**
 | 
|       * Checks the current test has |clazz| annotation. Note this swallows NoSuchMethodException
 | 
|       * and returns false in that case.
 | 
| 
 |