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
This commit is contained in:
Basavapatna Dattaguru
2011-02-13 20:28:38 -08:00
parent e77345966c
commit 0554f32afd
4 changed files with 1193 additions and 12 deletions

View File

@@ -1,12 +1,12 @@
<?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");
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.
@@ -14,29 +14,33 @@
limitations under the License.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<SurfaceView
android:id="@+id/surface_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
/>
<VideoView
android:id="@+id/video_view"
<ImageView android:id="@+id/overlay_layer"
android:layout_width="0dip"
android:layout_height="392dip"/>
<VideoView
android:id="@+id/video_view"
android:layout_width="320px"
android:layout_height="240px"
/>
</FrameLayout>
</LinearLayout>

View File

@@ -1,5 +1,5 @@
/*
* 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");
* 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 com.android.mediaframeworktest.MediaNames;
import android.graphics.Bitmap;
import android.widget.ImageView;
import java.io.File;
import java.io.FileDescriptor;
import java.net.InetAddress;
@@ -58,6 +61,8 @@ public class MediaFrameworkTest extends Activity {
public static AssetFileDescriptor midiafd;
public static AssetFileDescriptor mp3afd;
public static Bitmap mDestBitmap;
public static ImageView mOverlayView;
public MediaFrameworkTest() {
}
@@ -69,6 +74,7 @@ public class MediaFrameworkTest extends Activity {
super.onCreate(icicle);
setContentView(R.layout.surface_view);
mSurfaceView = (SurfaceView)findViewById(R.id.surface_view);
mOverlayView = (ImageView)findViewById(R.id.overlay_layer);
ViewGroup.LayoutParams lp = mSurfaceView.getLayoutParams();
mSurfaceView.getHolder().setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
@@ -77,6 +83,9 @@ public class MediaFrameworkTest extends Activity {
//Get the mp3 fd
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){
@@ -148,4 +157,9 @@ public class MediaFrameworkTest extends Activity {
InetAddress address = InetAddress.getByAddress(MediaNames.STREAM_SERVER);
return address.isReachable(10000);
}
public static void testInvalidateOverlay() {
mOverlayView.invalidate();
}
}

View File

@@ -37,6 +37,7 @@ import com.android.mediaframeworktest.functional.MediaItemThumbnailTest;
import com.android.mediaframeworktest.functional.MediaPropertiesTest;
import com.android.mediaframeworktest.functional.VideoEditorAPITest;
import com.android.mediaframeworktest.functional.VideoEditorExportTest;
import com.android.mediaframeworktest.functional.VideoEditorPreviewTest;
import junit.framework.TestSuite;
import android.test.InstrumentationTestRunner;
@@ -79,6 +80,7 @@ public class MediaFrameworkTestRunner extends InstrumentationTestRunner {
suite.addTestSuite(MediaPropertiesTest.class);
suite.addTestSuite(VideoEditorAPITest.class);
suite.addTestSuite(VideoEditorExportTest.class);
suite.addTestSuite(VideoEditorPreviewTest.class);
return suite;
}