Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / android_webview / javatests / src / org / chromium / android_webview / test / util / VideoTestUtil.java
index 5df2a03..4ec4e40 100644 (file)
@@ -20,12 +20,12 @@ public class VideoTestUtil {
      * @return true if the event happened,
      * @throws Throwable throw exception if timeout.
      */
-   public static boolean runVideoTest(final AwTestBase testCase, final boolean requiredUserGesture,
-           long waitTime) throws Throwable {
+    public static boolean runVideoTest(final AwTestBase testCase, final boolean requiredUserGesture,
+            long waitTime) throws Throwable {
         final JavascriptEventObserver observer = new JavascriptEventObserver();
         TestAwContentsClient client = new TestAwContentsClient();
         final AwContents awContents =
-            testCase.createAwTestContainerViewOnMainSync(client).getAwContents();
+                testCase.createAwTestContainerViewOnMainSync(client).getAwContents();
         testCase.getInstrumentation().runOnMainSync(new Runnable() {
             @Override
             public void run() {
@@ -35,17 +35,17 @@ public class VideoTestUtil {
                 observer.register(awContents.getContentViewCore(), "javaObserver");
             }
         });
-        VideoTestWebServer webServer = new VideoTestWebServer(testCase.getActivity());
+        VideoTestWebServer webServer = new VideoTestWebServer();
         try {
-            String data = "<html><head><script>" +
-                "addEventListener('DOMContentLoaded', function() { " +
-                "  document.getElementById('video').addEventListener('play', function() { " +
-                "    javaObserver.notifyJava(); " +
-                "  }, false); " +
-                "}, false); " +
-                "</script></head><body>" +
-                "<video id='video' autoplay control src='" +
-                webServer.getOnePixelOneFrameWebmURL() + "' /> </body></html>";
+            String data = "<html><head><script>"
+                    + "addEventListener('DOMContentLoaded', function() { "
+                    + "  document.getElementById('video').addEventListener('play', function() { "
+                    + "    javaObserver.notifyJava(); "
+                    + "  }, false); "
+                    + "}, false); "
+                    + "</script></head><body>"
+                    + "<video id='video' autoplay control src='"
+                    + webServer.getOnePixelOneFrameWebmURL() + "' /> </body></html>";
             testCase.loadDataAsync(awContents, data, "text/html", false);
             return observer.waitForEvent(waitTime);
         } finally {