-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #235 from bugsnag/tms/mobile-fixture
Mobile targets test fixture foundation
- Loading branch information
Showing
56 changed files
with
8,601 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Prebuilt stuffs | ||
Sample* | ||
|
||
[Ll]ibrary/ | ||
[Tt]emp/ | ||
[Oo]bj/ | ||
[Bb]uild/ | ||
[Bb]uilds/ | ||
Assets/AssetStoreTools* | ||
|
||
# Visual Studio cache directory | ||
.vs/ | ||
.vsconfig | ||
|
||
# Autogenerated VS/MD/Consulo solution and project files | ||
ExportedObj/ | ||
.consulo/ | ||
*.csproj | ||
*.unityproj | ||
*.sln | ||
*.suo | ||
*.tmp | ||
*.user | ||
*.userprefs | ||
*.pidb | ||
*.booproj | ||
*.svd | ||
*.pdb | ||
*.opendb | ||
|
||
# Unity3D generated meta files | ||
*.pidb.meta | ||
*.pdb.meta | ||
|
||
# Unity3D Generated File On Crash Reports | ||
sysinfo.txt | ||
|
||
# Imported assets | ||
Assets/Plugins | ||
Assets/Plugins.meta | ||
Assets/Standard\ Assets/Bugsnag/BugsnagBehaviour.cs | ||
|
||
# Builds | ||
*.apk | ||
*.unitypackage | ||
|
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using UnityEngine.SceneManagement; | ||
|
||
public class OtherSceneScript : MonoBehaviour { | ||
|
||
public void ReturnToSample() { | ||
SceneManager.LoadScene("SampleScene"); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
test/mobile/features/fixtures/Assets/OtherSceneScript.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
test/mobile/features/fixtures/Assets/Plugins/Android/AndroidManifest.xml
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.example.Parky"> | ||
<application android:usesCleartextTraffic="true" android:label="@string/app_name" android:icon="@mipmap/app_icon"> | ||
<activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
<category android:name="android.intent.category.LAUNCHER" /> | ||
<category android:name="android.intent.category.LEANBACK_LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
</manifest> |
130 changes: 130 additions & 0 deletions
130
test/mobile/features/fixtures/Assets/ReporterBehavior.cs
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 |
---|---|---|
@@ -0,0 +1,130 @@ | ||
using System; | ||
using UnityEngine; | ||
using BugsnagUnity; | ||
using System.Collections.Generic; | ||
using BugsnagUnity.Payload; | ||
using UnityEngine.SceneManagement; | ||
|
||
public class ReporterBehavior : MonoBehaviour { | ||
|
||
// Use this for initialization | ||
void Start () { | ||
Configuration config = new Configuration("12312312312312312312312312312312"); | ||
config.Endpoint = new Uri("http://192.168.178.53:9339/notify"); | ||
config.Endpoint = new Uri("http://192.168.178.53:9339/session"); | ||
config.Context = "My context"; | ||
config.AppVersion = "1.2.3"; | ||
Bugsnag.Start(config); | ||
} | ||
|
||
public void ThrowException() { | ||
throw new System.Exception("You threw an exception!"); | ||
} | ||
|
||
public void AssertionFailure() { | ||
var items = new int[]{1, 2, 3}; | ||
Debug.Log("Item4 is: " + items[4]); | ||
} | ||
|
||
public void NativeException() { | ||
BugsnagNative.Crash(); | ||
} | ||
|
||
public void LogCaughtException() { | ||
try { | ||
var items = new int[]{1, 2, 3}; | ||
Debug.Log("Item4 is: " + items[4]); | ||
} catch (System.Exception ex) { | ||
Debug.LogException(ex); | ||
} | ||
} | ||
|
||
public void LogWithClasPrefix() { | ||
throw new ExecutionEngineException("Haven't gotten around to making this work, sorry"); | ||
} | ||
|
||
public void NotifyCaughtException() { | ||
try { | ||
var items = new int[]{1, 2, 3}; | ||
Debug.Log("Item4 is: " + items[4]); | ||
} catch (System.Exception ex) { | ||
Bugsnag.Notify(ex); | ||
} | ||
} | ||
public void NotifyWithCallback() { | ||
Bugsnag.Notify(new ExecutionEngineException("This one has a callback"), report => | ||
{ | ||
report.Context = "Callback Context"; | ||
report.Metadata.Add("Callback", new Dictionary<string, string>() | ||
{ | ||
{"region", "US"} | ||
}); | ||
}); | ||
} | ||
public void StartSession() { | ||
Bugsnag.SessionTracking.StartSession(); | ||
} | ||
public void SetUser() { | ||
Bugsnag.User.Id = "mcpacman"; | ||
Bugsnag.User.Name = "Geordi McPacman"; | ||
Bugsnag.User.Email = "[email protected]"; | ||
} | ||
public void ClearUser() { | ||
Bugsnag.User.Clear(); | ||
} | ||
public void AddMetadata() { | ||
Bugsnag.Metadata.Add("ConfigMetadata", new Dictionary<string, string>(){ | ||
{ "subsystem", "Player Mechanics" } | ||
}); | ||
} | ||
public void AddCallbackMetadata() { | ||
Bugsnag.BeforeNotify(report => | ||
{ | ||
report.Metadata.Add("CallbackMetadata", new Dictionary<string, string>(){ | ||
{ "subsystem", "Player Mechanics" } | ||
}); | ||
}); | ||
} | ||
public void AddCallbackContext() { | ||
Bugsnag.BeforeNotify(report => | ||
{ | ||
report.Context = "BeforeNotify Context"; | ||
}); | ||
} | ||
public void AddCallbackUser() { | ||
Bugsnag.BeforeNotify(report => | ||
{ | ||
report.User.Id = "lunchfrey"; | ||
report.User.Name = "Lunchfrey Jones"; | ||
report.User.Email = "[email protected]"; | ||
}); | ||
} | ||
public void AddCallbackSeverity() { | ||
Bugsnag.BeforeNotify(report => | ||
{ | ||
report.Severity = Severity.Info; | ||
}); | ||
} | ||
public void AddCallbackCancellation() { | ||
Bugsnag.BeforeNotify(report => | ||
{ | ||
report.Ignore(); | ||
}); | ||
} | ||
public void RemoveAllCallbacks() { | ||
throw new ExecutionEngineException("Hmm, doesn't seem to exist"); | ||
} | ||
public void LeaveBreadcrumbString() { | ||
Bugsnag.Breadcrumbs.Leave("String breadcrumb clicked"); | ||
} | ||
public void LeaveBreadcrumbTuple() { | ||
Bugsnag.Breadcrumbs.Leave( | ||
"Tuple breadcrumb clicked", | ||
BreadcrumbType.Navigation, | ||
new Dictionary<string, string>() {{ "scene", "SomeVeryRealScene" }} | ||
); | ||
} | ||
public void ChangeScene() { | ||
SceneManager.LoadScene("OtherScene"); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
test/mobile/features/fixtures/Assets/ReporterBehavior.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.