-
-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
328 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,8 +18,9 @@ const String _testDsnWithPath = | |
const String _testDsnWithPort = | ||
'https://public:[email protected]:8888/1'; | ||
|
||
SentryOptions defaultTestOptions() { | ||
return SentryOptions(dsn: testDsn)..automatedTestMode = true; | ||
SentryOptions defaultTestOptions([PlatformChecker? checker]) { | ||
return SentryOptions(dsn: testDsn, checker: checker) | ||
..automatedTestMode = true; | ||
} | ||
|
||
void testHeaders( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ import 'package:flutter/services.dart'; | |
import 'package:flutter/src/widgets/binding.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:mockito/annotations.dart'; | ||
import 'package:mockito/mockito.dart'; | ||
import 'package:sentry/src/platform/platform.dart'; | ||
import 'package:sentry/src/sentry_tracer.dart'; | ||
|
||
|
@@ -18,8 +19,9 @@ import 'no_such_method_provider.dart'; | |
const fakeDsn = 'https://[email protected]/1234567'; | ||
const fakeProguardUuid = '3457d982-65ef-576d-a6ad-65b5f30f49a5'; | ||
|
||
SentryFlutterOptions defaultTestOptions() { | ||
return SentryFlutterOptions(dsn: fakeDsn)..automatedTestMode = true; | ||
SentryFlutterOptions defaultTestOptions([PlatformChecker? checker]) { | ||
return SentryFlutterOptions(dsn: fakeDsn, checker: checker) | ||
..automatedTestMode = true; | ||
} | ||
|
||
// https://github.com/dart-lang/mockito/blob/master/NULL_SAFETY_README.md#fallback-generators | ||
|
@@ -44,6 +46,7 @@ ISentrySpan startTransactionShim( | |
SentryTracer, | ||
SentryTransaction, | ||
SentrySpan, | ||
SentryClient, | ||
MethodChannel, | ||
SentryNativeBinding | ||
], customMocks: [ | ||
|
@@ -166,8 +169,6 @@ class TestBindingWrapper implements BindingWrapper { | |
} | ||
} | ||
|
||
class MockSentryClient with NoSuchMethodProvider implements SentryClient {} | ||
|
||
// All these values are based on the fakeFrameDurations list. | ||
// The expected total frames is also based on the span duration of 1000ms and the slow and frozen frames. | ||
const expectedTotalFrames = 17; | ||
|
@@ -199,6 +200,8 @@ class NativeChannelFixture { | |
TestWidgetsFlutterBinding.ensureInitialized(); | ||
channel = MethodChannel('test.channel', StandardMethodCodec(), _messenger); | ||
handler = MockCallbacks().methodCallHandler; | ||
when(handler('initNativeSdk', any)).thenAnswer((_) => Future.value()); | ||
when(handler('closeNativeSdk', any)).thenAnswer((_) => Future.value()); | ||
_messenger.setMockMethodCallHandler( | ||
channel, (call) => handler(call.method, call.arguments)); | ||
} | ||
|
Oops, something went wrong.