Skip to content

Commit

Permalink
feat(metadata):tests
Browse files Browse the repository at this point in the history
  • Loading branch information
YYChen01988 committed Jan 31, 2024
2 parents e49a839 + fcdb46e commit 4c6bd25
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<ID>MagicNumber:CXXExceptionWithUsageScenario.kt$CXXExceptionWithUsageScenario$1000</ID>
<ID>MagicNumber:CXXSigsegvWithUsageScenario.kt$CXXSigsegvWithUsageScenario$10</ID>
<ID>MagicNumber:EventTooBigScenario.kt$EventTooBigScenario$3</ID>
<ID>MagicNumber:ExitInfoScenario.kt$ExitInfoScenario$500</ID>
<ID>MagicNumber:ExitInfoScenario.kt$ExitInfoScenario.&lt;no name provided>$2726</ID>
<ID>MagicNumber:HandledExceptionWithUsageScenario.kt$HandledExceptionWithUsageScenario$10</ID>
<ID>MagicNumber:MetadataStringsTooLargeScenario.kt$MetadataStringsTooLargeScenario$3</ID>
<ID>MagicNumber:MetadataStringsTooLargeScenario.kt$MetadataStringsTooLargeScenario$995000</ID>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@ package com.bugsnag.android.mazerunner.scenarios
import android.content.Context
import android.os.Handler
import android.os.Looper
import android.util.Log
import com.bugsnag.android.Bugsnag
import com.bugsnag.android.Configuration

class ExitInfoScenario(
config: com.bugsnag.android.Configuration,
config: Configuration,
context: android.content.Context,
eventMetadata: String?
) : Scenario(config, context, eventMetadata) {
external fun crash(value: Int): Int
override fun startScenario() {
super.startScenario()
Bugsnag.startSession()
val time1 = 2726
val time2 = 500
val main: android.os.Handler = android.os.Handler(android.os.Looper.getMainLooper())
main.postDelayed(object : java.lang.Runnable {
override fun run() {
crash(time1)
}
}, time2)
main.postDelayed(
object : java.lang.Runnable {
override fun run() {
crash(2726)
}
},
500
)
}
}
2 changes: 1 addition & 1 deletion features/full_tests/usage.feature
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Feature: Reporting Errors with usage info
And the event "usage.callbacks.ndkOnError" equals 1
And the event "usage.callbacks.onBreadcrumb" equals 1
And the event "usage.callbacks.onError" equals 3
And the event "usage.callbacks.onSession" equals 3
And the event "usage.callbacks.onSession" equals 4

Scenario: Report a handled exception with custom configuration and set callbacks, usage disabled
When I configure the app to run in the "disable-usage" state
Expand Down

0 comments on commit 4c6bd25

Please sign in to comment.