summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.ControlGallery.Android
diff options
context:
space:
mode:
authorE.Z. Hart <hartez@users.noreply.github.com>2016-11-16 14:07:30 -0700
committerJason Smith <jason.smith@xamarin.com>2016-11-16 13:07:30 -0800
commit122f0e3e6060711d6c3b2b8523236b8a057434df (patch)
tree719b2a3f4a3146602e764ebeca3939b8788db1a8 /Xamarin.Forms.ControlGallery.Android
parentacc6efb3d7d502d0a40020ec86eaff4d018de8be (diff)
downloadxamarin-forms-122f0e3e6060711d6c3b2b8523236b8a057434df.tar.gz
xamarin-forms-122f0e3e6060711d6c3b2b8523236b8a057434df.tar.bz2
xamarin-forms-122f0e3e6060711d6c3b2b8523236b8a057434df.zip
Run multiple UI tests without restarting ControlGallery (#539)
* Allow UI tests to bypass "manual" navigation to isses pages * Add missing Preserve attribute * Make Issue198 test work with direct navigation * Remove empty UI tests * Fix error handling for iOS * Use navigation which works for subsequent TestNavigationPages on iOS * Fix race condition in 39530 test Remove master page nesting when doing direct nav for UI tests * Set up and run a single instance of Control Gallery for UI tests * Force NavigateToIssue to wait for main page appearing to deal with iOS timing * Move remaining UI tests into Issues namespace * Change the connection check URL so it'll work on iOS * Make Appearing Gallery tests work without restarting app * Prevent ContextActions tests from stepping on each other * Make context menu test more robust * Move ButtonExtensions back to Controls namespace * Have test 774 dismiss the action sheet before ending * Update UITest package to 2.0.0 stable * Make 2948 restore orientation when it's done * Null check on PageController before calling SendDisappearing * Adding a wait for the root page in the core tests * Add consecutive tests reset to prevent memory slog on older iOS devices
Diffstat (limited to 'Xamarin.Forms.ControlGallery.Android')
-rw-r--r--Xamarin.Forms.ControlGallery.Android/Activity1.cs24
-rw-r--r--Xamarin.Forms.ControlGallery.Android/CustomRenderers.cs1
-rw-r--r--Xamarin.Forms.ControlGallery.Android/Xamarin.Forms.ControlGallery.Android.csproj1
3 files changed, 25 insertions, 1 deletions
diff --git a/Xamarin.Forms.ControlGallery.Android/Activity1.cs b/Xamarin.Forms.ControlGallery.Android/Activity1.cs
index ad3945ee..cfd8350f 100644
--- a/Xamarin.Forms.ControlGallery.Android/Activity1.cs
+++ b/Xamarin.Forms.ControlGallery.Android/Activity1.cs
@@ -21,7 +21,8 @@ using System.IO.IsolatedStorage;
using Droid = Android;
using System.Globalization;
-
+using Java.Interop;
+using Xamarin.Forms.Controls.Issues;
[assembly: Dependency (typeof (CacheService))]
[assembly: Dependency (typeof (TestCloudService))]
@@ -274,6 +275,12 @@ namespace Xamarin.Forms.ControlGallery.Android
{
base.OnDestroy();
}
+
+ [Export("NavigateToTest")]
+ public bool NavigateToTest(string test)
+ {
+ return _app.NavigateToTestPage(test);
+ }
}
#else
@@ -297,6 +304,8 @@ namespace Xamarin.Forms.ControlGallery.Android
]
public class Activity1 : FormsAppCompatActivity
{
+ App _app;
+
protected override void OnCreate (Bundle bundle)
{
ToolbarResource = Resource.Layout.Toolbar;
@@ -319,6 +328,7 @@ namespace Xamarin.Forms.ControlGallery.Android
//Forms.SetTitleBarVisibility (AndroidTitleBarVisibility.Never);
var app = new App();
+ _app = app;
// When the native control gallery loads up, it'll let us know so we can add the nested native controls
MessagingCenter.Subscribe<NestedNativeControlGalleryPage>(this, NestedNativeControlGalleryPage.ReadyForNativeControlsMessage, AddNativeControls);
@@ -446,6 +456,18 @@ namespace Xamarin.Forms.ControlGallery.Android
return null;
}
}
+
+ [Export("NavigateToTest")]
+ public bool NavigateToTest(string test)
+ {
+ return _app.NavigateToTestPage(test);
+ }
+
+ [Export("Reset")]
+ public void Reset()
+ {
+ _app.Reset();
+ }
}
#endif
}
diff --git a/Xamarin.Forms.ControlGallery.Android/CustomRenderers.cs b/Xamarin.Forms.ControlGallery.Android/CustomRenderers.cs
index 0530fc3c..86876a38 100644
--- a/Xamarin.Forms.ControlGallery.Android/CustomRenderers.cs
+++ b/Xamarin.Forms.ControlGallery.Android/CustomRenderers.cs
@@ -19,6 +19,7 @@ using AButton = Android.Widget.Button;
using AView = Android.Views.View;
using Android.OS;
using System.Reflection;
+using Xamarin.Forms.Controls.Issues;
[assembly: ExportRenderer(typeof(Bugzilla31395.CustomContentView), typeof(CustomContentRenderer))]
[assembly: ExportRenderer(typeof(NativeListView), typeof(NativeListViewRenderer))]
diff --git a/Xamarin.Forms.ControlGallery.Android/Xamarin.Forms.ControlGallery.Android.csproj b/Xamarin.Forms.ControlGallery.Android/Xamarin.Forms.ControlGallery.Android.csproj
index 199e16d6..32f92ecc 100644
--- a/Xamarin.Forms.ControlGallery.Android/Xamarin.Forms.ControlGallery.Android.csproj
+++ b/Xamarin.Forms.ControlGallery.Android/Xamarin.Forms.ControlGallery.Android.csproj
@@ -114,6 +114,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Mono.Android" />
+ <Reference Include="Mono.Android.Export" />
<Reference Include="mscorlib" />
<Reference Include="System" />
<Reference Include="System.Core" />