diff options
author | Teng-Hui Zhu <ztenghui@google.com> | 2016-06-22 11:40:47 -0700 |
---|---|---|
committer | Teng-Hui Zhu <ztenghui@google.com> | 2016-06-22 15:43:45 -0700 |
commit | 57fc7599e89ff37e2a92d315baa6576b9dc80dde (patch) | |
tree | b0ead6cddbb520c20615e539148bb7f604e68921 /apct-tests/perftests/utils | |
parent | 4cbaff6be1117f32c9706657b3f27c6f77e76492 (diff) |
Update VectorDrawablePerfTest to use JUnit 4
Merge StubActivity into utils.
b/28980976
Change-Id: I2ea53d5b6e3e508b2f83846940dc617f1fdff248
Diffstat (limited to 'apct-tests/perftests/utils')
-rw-r--r-- | apct-tests/perftests/utils/src/android/perftests/utils/BitmapUtils.java | 9 | ||||
-rw-r--r-- | apct-tests/perftests/utils/src/android/perftests/utils/StubActivity.java | 22 |
2 files changed, 26 insertions, 5 deletions
diff --git a/apct-tests/perftests/utils/src/android/perftests/utils/BitmapUtils.java b/apct-tests/perftests/utils/src/android/perftests/utils/BitmapUtils.java index 4d0d97196241..6a3a6da6e5f6 100644 --- a/apct-tests/perftests/utils/src/android/perftests/utils/BitmapUtils.java +++ b/apct-tests/perftests/utils/src/android/perftests/utils/BitmapUtils.java @@ -27,7 +27,7 @@ import java.io.IOException; public class BitmapUtils { private static final String TAG = "BitmapUtils"; - public static void saveBitmapIntoPNG(Context context, Bitmap bitmap, int resId) throws IOException { + public static void saveBitmapIntoPNG(Context context, Bitmap bitmap, int resId) { // Save the image to the disk. FileOutputStream out = null; try { @@ -44,13 +44,12 @@ public class BitmapUtils { out = new FileOutputStream(outputFile, false); bitmap.compress(Bitmap.CompressFormat.PNG, 100, out); - Log.v(TAG, "Write test No." + outputFile.getAbsolutePath() + " to file successfully."); - } catch (Exception e) { - e.printStackTrace(); - } finally { if (out != null) { out.close(); } + Log.v(TAG, "Write test No." + outputFile.getAbsolutePath() + " to file successfully."); + } catch (Exception e) { + e.printStackTrace(); } } } diff --git a/apct-tests/perftests/utils/src/android/perftests/utils/StubActivity.java b/apct-tests/perftests/utils/src/android/perftests/utils/StubActivity.java new file mode 100644 index 000000000000..6012f4b12b3d --- /dev/null +++ b/apct-tests/perftests/utils/src/android/perftests/utils/StubActivity.java @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2016 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.perftests.utils; + +import android.app.Activity; + +public class StubActivity extends Activity { +}
\ No newline at end of file |