diff options
author | Hong Teng <hongteng@google.com> | 2011-12-02 09:32:02 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-12-02 09:32:02 -0800 |
commit | 613ed4c69a53e6ffb1f104c7d45a0c6dd41c8eb0 (patch) | |
tree | a81e8f435c3db8d7b1f4705f7c7154c333d681fb /media/tests/MediaFrameworkTest | |
parent | e21dabf654e3d90e50e95174d5e9670bc930c194 (diff) | |
parent | 63149c81adf79f43c6508647614247277f8052e2 (diff) | |
download | frameworks_base-613ed4c69a53e6ffb1f104c7d45a0c6dd41c8eb0.zip frameworks_base-613ed4c69a53e6ffb1f104c7d45a0c6dd41c8eb0.tar.gz frameworks_base-613ed4c69a53e6ffb1f104c7d45a0c6dd41c8eb0.tar.bz2 |
Merge "Fixd for 5490443 Native crash while exporting a video - Add new onError callback to PreviewProgressListener, which is used to indicate video editor application for the error that has occurred during priviewing. With this modification, the application must implement the onError method, and then VideoEditorPreviewTest.java is changed accordingly." into ics-mr1
Diffstat (limited to 'media/tests/MediaFrameworkTest')
-rw-r--r-- | media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/videoeditor/VideoEditorPreviewTest.java | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/videoeditor/VideoEditorPreviewTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/videoeditor/VideoEditorPreviewTest.java index e848f5f..3c08138 100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/videoeditor/VideoEditorPreviewTest.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/videoeditor/VideoEditorPreviewTest.java @@ -93,6 +93,7 @@ public class VideoEditorPreviewTest extends private boolean previewStart; private boolean previewStop; + private boolean previewError; /* Minimum waiting time for Semaphore to wait for release */ private final long minWaitingTime = 3000; @@ -141,7 +142,9 @@ public class VideoEditorPreviewTest extends protected void setPreviewStop() { previewStop = true; } - + protected void setPreviewError() { + previewError = true; + } protected void validatePreviewProgress(int startMs, int endMs, boolean loop, long duration) throws Exception { @@ -149,6 +152,7 @@ public class VideoEditorPreviewTest extends final Semaphore blockTillPreviewCompletes = new Semaphore(1); previewStart = false; previewStop = false; + previewError = false; mVideoEditor.generatePreview(new MediaProcessingProgressListener() { int i = 0; public void onProgress(Object item, int action, int progress) { @@ -187,6 +191,10 @@ public class VideoEditorPreviewTest extends setPreviewStop(); blockTillPreviewCompletes.release(); } + public void onError(VideoEditor videoEditor, int error) { + setPreviewError(); + blockTillPreviewCompletes.release(); + } }); } catch (Exception e) { blockTillPreviewCompletes.release(); @@ -196,6 +204,7 @@ public class VideoEditorPreviewTest extends mVideoEditor.stopPreview(); assertTrue("Preview Failed to start", previewStart); assertTrue("Preview Failed to stop", previewStop); + assertFalse("Preview Error occurred", previewError); blockTillPreviewCompletes.release(); } @@ -399,6 +408,7 @@ public class VideoEditorPreviewTest extends "TransitionSpiral_QVGA.jpg"; previewStart = false; previewStop = false; + previewError = false; final Semaphore blockTillPreviewCompletes = new Semaphore(1); @@ -490,6 +500,10 @@ public class VideoEditorPreviewTest extends setPreviewStop(); blockTillPreviewCompletes.release(); } + public void onError(VideoEditor videoEditor, int error) { + setPreviewError(); + blockTillPreviewCompletes.release(); + } }); } catch (Exception e) { blockTillPreviewCompletes.release(); @@ -499,6 +513,7 @@ public class VideoEditorPreviewTest extends blockTillPreviewCompletes.release(); assertTrue("Preview Failed to start", previewStart); assertTrue("Preview Failed to stop", previewStop); + assertFalse("Preview Error occurred", previewError); assertEquals("Removing Transition " + transition1And2CrossFade.getId(), transition1And2CrossFade, @@ -677,6 +692,7 @@ public class VideoEditorPreviewTest extends final Semaphore blockTillPreviewCompletes = new Semaphore(1); previewStart = false; previewStop = false; + previewError = false; final MediaVideoItem mediaVideoItem1 = mVideoEditorHelper.createMediaItem(mVideoEditor, "m1", @@ -727,6 +743,10 @@ public class VideoEditorPreviewTest extends setPreviewStop(); blockTillPreviewCompletes.release(); } + public void onError(VideoEditor videoEditor, int error) { + setPreviewError(); + blockTillPreviewCompletes.release(); + } }); } catch (Exception e) { @@ -736,6 +756,8 @@ public class VideoEditorPreviewTest extends mVideoEditor.stopPreview(); assertTrue("Preview Failed to start", previewStart); assertTrue("Preview Failed to stop", previewStop); + assertFalse("Preview Error occurred", previewError); + blockTillPreviewCompletes.release(); } @@ -784,6 +806,10 @@ public class VideoEditorPreviewTest extends setPreviewStop(); blockTillPreviewCompletes.release(); } + public void onError(VideoEditor videoEditor, int error) { + setPreviewError(); + blockTillPreviewCompletes.release(); + } }); } catch (IllegalArgumentException e) { @@ -1023,7 +1049,10 @@ public class VideoEditorPreviewTest extends } public void onStop(VideoEditor videoEditor) { setPreviewStop(); - } + } + public void onError(VideoEditor videoEditor, int error) { + setPreviewError(); + } }); }catch (IllegalArgumentException e) { flagForException = true; @@ -1089,7 +1118,10 @@ public class VideoEditorPreviewTest extends } public void onStop(VideoEditor videoEditor) { setPreviewStop(); - } + } + public void onError(VideoEditor videoEditor, int error) { + setPreviewError(); + } }); }catch (IllegalArgumentException e) { flagForException = true; |