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

Commit 568d91bd authored by Xia Wang's avatar Xia Wang
Browse files

fix the bug of testStartupTime in MediaPlayerPerformance test throws exception...

fix the bug of testStartupTime in MediaPlayerPerformance test throws exception for an existing table
parent c34c8c6f
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ import android.media.MediaMetadataRetriever;
 */
public class MediaPlayerPerformance extends ActivityInstrumentationTestCase<MediaFrameworkTest> {

    private String TAG = "MediaFrameworkPerformance";
    private String TAG = "MediaPlayerPerformance";

    private SQLiteDatabase mDB;
    private SurfaceHolder mSurfaceHolder = null;
@@ -80,9 +80,11 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase<Medi

    public void createDB() {
        mDB = SQLiteDatabase.openOrCreateDatabase("/sdcard/perf.db", null);
        mDB.execSQL("CREATE TABLE perfdata (_id INTEGER PRIMARY KEY," + 
        mDB.execSQL("CREATE TABLE IF NOT EXISTS perfdata (_id INTEGER PRIMARY KEY," + 
                "file TEXT," + "setdatatime LONG," + "preparetime LONG," +
                "playtime LONG" + ");");
        //clean the table before adding new data
        mDB.execSQL("DELETE FROM perfdata");
    }

    public void audioPlaybackStartupTime(String[] testFile) {
@@ -141,6 +143,10 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase<Medi
        audioPlaybackStartupTime(MediaNames.MP3FILES);
        audioPlaybackStartupTime(MediaNames.AACFILES);

        //close the database after all transactions
        if (mDB.isOpen()) {
            mDB.close();
        }
    }

    public void wmametadatautility(String[] testFile) {