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

Commit 0554f32a authored by Basavapatna Dattaguru's avatar Basavapatna Dattaguru
Browse files

VideoEditor:IssueID:3396697: Added Preview Test code

This has dependency on Ide5ee82b24806a52b4e612db4bc3c34f75e4465a
Removed trailing space in xml file
Removed dependency on test cases other than Preview & API

Change-Id: I835c0ca17d6ff15819407eb930cca8a08b095287
parent e7734596
Loading
Loading
Loading
Loading
+15 −11
Original line number Original line Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2007 The Android Open Source Project
<!-- Copyright (C) 2011 The Android Open Source Project


     Licensed under the Apache License, Version 2.0 (the "License");
     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     you may not use this file except in compliance with the License.
@@ -30,6 +30,10 @@
     android:layout_centerInParent="true"
     android:layout_centerInParent="true"
     />
     />


  <ImageView android:id="@+id/overlay_layer"
     android:layout_width="0dip"
     android:layout_height="392dip"/>

  <VideoView
  <VideoView
   android:id="@+id/video_view"
   android:id="@+id/video_view"
        android:layout_width="320px"
        android:layout_width="320px"
+15 −1
Original line number Original line Diff line number Diff line
/*
/*
 * Copyright (C) 2008 The Android Open Source Project
 * Copyright (C) 2011 The Android Open Source Project
 *
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * you may not use this file except in compliance with the License.
@@ -40,6 +40,9 @@ import android.widget.MediaController;
import android.widget.VideoView;
import android.widget.VideoView;
import com.android.mediaframeworktest.MediaNames;
import com.android.mediaframeworktest.MediaNames;


import android.graphics.Bitmap;
import android.widget.ImageView;

import java.io.File;
import java.io.File;
import java.io.FileDescriptor;
import java.io.FileDescriptor;
import java.net.InetAddress;
import java.net.InetAddress;
@@ -58,6 +61,8 @@ public class MediaFrameworkTest extends Activity {
    public static AssetFileDescriptor midiafd;
    public static AssetFileDescriptor midiafd;
    public static AssetFileDescriptor mp3afd;
    public static AssetFileDescriptor mp3afd;
    
    
    public static Bitmap mDestBitmap;
    public static ImageView mOverlayView;
    
    
    public MediaFrameworkTest() {
    public MediaFrameworkTest() {
    }
    }
@@ -69,6 +74,7 @@ public class MediaFrameworkTest extends Activity {
        super.onCreate(icicle);
        super.onCreate(icicle);
        setContentView(R.layout.surface_view);
        setContentView(R.layout.surface_view);
        mSurfaceView = (SurfaceView)findViewById(R.id.surface_view);
        mSurfaceView = (SurfaceView)findViewById(R.id.surface_view);
        mOverlayView = (ImageView)findViewById(R.id.overlay_layer);
        ViewGroup.LayoutParams lp = mSurfaceView.getLayoutParams();
        ViewGroup.LayoutParams lp = mSurfaceView.getLayoutParams();
        mSurfaceView.getHolder().setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
        mSurfaceView.getHolder().setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
        
        
@@ -77,6 +83,9 @@ public class MediaFrameworkTest extends Activity {
        
        
        //Get the mp3 fd
        //Get the mp3 fd
        mp3afd = this.getResources().openRawResourceFd(R.raw.testmp3);
        mp3afd = this.getResources().openRawResourceFd(R.raw.testmp3);
        mOverlayView.setLayoutParams(lp);
        mDestBitmap = Bitmap.createBitmap((int)640, (int)480, Bitmap.Config.ARGB_8888);
        mOverlayView.setImageBitmap(mDestBitmap);
    }
    }
    
    
    public void startPlayback(String filename){
    public void startPlayback(String filename){
@@ -148,4 +157,9 @@ public class MediaFrameworkTest extends Activity {
      InetAddress address = InetAddress.getByAddress(MediaNames.STREAM_SERVER);
      InetAddress address = InetAddress.getByAddress(MediaNames.STREAM_SERVER);
      return address.isReachable(10000);
      return address.isReachable(10000);
  }
  }

  public static void testInvalidateOverlay() {
      mOverlayView.invalidate();
  }

}
}
+2 −0
Original line number Original line Diff line number Diff line
@@ -37,6 +37,7 @@ import com.android.mediaframeworktest.functional.MediaItemThumbnailTest;
import com.android.mediaframeworktest.functional.MediaPropertiesTest;
import com.android.mediaframeworktest.functional.MediaPropertiesTest;
import com.android.mediaframeworktest.functional.VideoEditorAPITest;
import com.android.mediaframeworktest.functional.VideoEditorAPITest;
import com.android.mediaframeworktest.functional.VideoEditorExportTest;
import com.android.mediaframeworktest.functional.VideoEditorExportTest;
import com.android.mediaframeworktest.functional.VideoEditorPreviewTest;
import junit.framework.TestSuite;
import junit.framework.TestSuite;


import android.test.InstrumentationTestRunner;
import android.test.InstrumentationTestRunner;
@@ -79,6 +80,7 @@ public class MediaFrameworkTestRunner extends InstrumentationTestRunner {
        suite.addTestSuite(MediaPropertiesTest.class);
        suite.addTestSuite(MediaPropertiesTest.class);
        suite.addTestSuite(VideoEditorAPITest.class);
        suite.addTestSuite(VideoEditorAPITest.class);
        suite.addTestSuite(VideoEditorExportTest.class);
        suite.addTestSuite(VideoEditorExportTest.class);
        suite.addTestSuite(VideoEditorPreviewTest.class);
        return suite;
        return suite;
    }
    }