Skip to content

Commit 4209fc6

Browse files
committed
Reduce CN1SS chunk size and mirror logs
1 parent cc85133 commit 4209fc6

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

scripts/android/tests/HelloCodenameOneInstrumentedTest.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import android.graphics.Bitmap;
77
import android.graphics.Canvas;
88
import android.util.Base64;
9+
import android.util.Log;
910
import android.util.DisplayMetrics;
1011
import android.view.View;
1112

@@ -35,7 +36,8 @@
3536
@RunWith(AndroidJUnit4.class)
3637
public class HelloCodenameOneInstrumentedTest {
3738

38-
private static final int CHUNK_SIZE = 2000;
39+
private static final String LOG_TAG = "CN1SS";
40+
private static final int CHUNK_SIZE = 600;
3941
private static final String PREVIEW_CHANNEL = "PREVIEW";
4042
private static final int[] PREVIEW_JPEG_QUALITIES =
4143
new int[] {60, 50, 40, 35, 30, 25, 20, 18, 16, 14, 12, 10, 8, 6, 5, 4, 3, 2, 1};
@@ -45,6 +47,7 @@ public class HelloCodenameOneInstrumentedTest {
4547

4648
private static void println(String s) {
4749
System.out.println(s);
50+
Log.i(LOG_TAG, s);
4851
}
4952

5053
private static void settle(long millis) {
@@ -250,15 +253,20 @@ private static void emitScreenshotChannel(byte[] bytes, String testName, String
250253
+ String.format(Locale.US, "%06d", pos)
251254
+ ":"
252255
+ chunk;
253-
System.out.println(line);
256+
emitLine(line);
254257
count++;
255258
}
256259
println("CN1SS:INFO:test=" + safeName + " chunks=" + count + " total_b64_len=" + b64.length());
257260
String endLine = prefix + ":END:" + safeName;
258-
System.out.println(endLine);
261+
emitLine(endLine);
259262
System.out.flush();
260263
}
261264

265+
private static void emitLine(String line) {
266+
System.out.println(line);
267+
Log.i(LOG_TAG, line);
268+
}
269+
262270
private static void prepareBrowserComponentContent(ActivityScenario<Activity> scenario) throws InterruptedException {
263271
final CountDownLatch supportLatch = new CountDownLatch(1);
264272
final boolean[] supported = new boolean[1];

0 commit comments

Comments
 (0)