Skip to content

Commit

Permalink
Switch to a different crash testing mechanism.
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeWharton committed Jun 19, 2016
1 parent 3d8a1de commit 330f9de
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
4 changes: 2 additions & 2 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Release

7. Install the release APK.

8. Launch the app. Long press and release the "Launch" button 5 times. Ensure that the app crashed
and that the exception was reported to Bugsnag.
8. Run `adb shell am start -n com.jakewharton.telecine/.TelecineActivity -e crash true` and ensure
that the app crashed and that the exception was reported to Bugsnag.

9. :shipit:
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@
import butterknife.OnCheckedChanged;
import butterknife.OnClick;
import butterknife.OnItemSelected;
import butterknife.OnLongClick;
import com.google.android.gms.analytics.HitBuilders;
import timber.log.Timber;

import javax.inject.Inject;
import timber.log.Timber;

import static android.graphics.Bitmap.Config.ARGB_8888;

Expand All @@ -47,11 +45,14 @@ public final class TelecineActivity extends AppCompatActivity {
@Inject Analytics analytics;

private VideoSizePercentageAdapter videoSizePercentageAdapter;
private int longClickCount;

@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

if ("true".equals(getIntent().getStringExtra("crash"))) {
throw new RuntimeException("Crash! Bang! Pow! This is only a test...");
}

((TelecineApplication) getApplication()).injector().inject(this);

setContentView(R.layout.activity_main);
Expand Down Expand Up @@ -88,23 +89,10 @@ public final class TelecineActivity extends AppCompatActivity {
}

@OnClick(R.id.launch) void onLaunchClicked() {
if (longClickCount > 0) {
longClickCount = 0;
Timber.d("Long click count reset.");
}

Timber.d("Attempting to acquire permission to screen capture.");
CaptureHelper.fireScreenCaptureIntent(this, analytics);
}

@OnLongClick(R.id.launch) boolean onLongClick() {
if (++longClickCount == 5) {
throw new RuntimeException("Crash! Bang! Pow! This is only a test...");
}
Timber.d("Long click count updated to %s", longClickCount);
return true;
}

@OnItemSelected(R.id.spinner_video_size_percentage) void onVideoSizePercentageSelected(
int position) {
int newValue = videoSizePercentageAdapter.getItem(position);
Expand Down

0 comments on commit 330f9de

Please sign in to comment.