-
Notifications
You must be signed in to change notification settings - Fork 564
[tests] added forms test #818
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
the build will fail as it will need a fix from #815 to be able to use custom timing definitions |
|
PR #515 has been merged. Indentation is...weirdly all over the map. It should be corrected. |
| public string AdbTarget { get; set; } | ||
| public string AdbOptions { get; set; } | ||
|
|
||
| [Required] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be left-aligned with the public on the following line.
tests/forms/App.xaml.cs
Outdated
|
|
||
| namespace forms | ||
| { | ||
| public partial class App : Application |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I take it that the default Xamarin.Forms template uses spaces? Not sure if this needs to be fixed, just seems weird.
tests/forms/Droid/MainActivity.cs
Outdated
| public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity | ||
| { | ||
| bool firstOnCreate = true; | ||
| bool firstOnStart = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bool on this and the following line should be indented the same amount as the previous line.
tests/forms/Droid/MainActivity.cs
Outdated
| Console.WriteLine("startup-timing: OnCreate end reached"); | ||
| firstOnCreate = false; | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is indented too much; it should be aligned with the { for OnCreate().
tests/forms/Droid/MainActivity.cs
Outdated
| Console.WriteLine("startup-timing: OnStart end reached"); | ||
| firstOnStart = false; | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is indented too much; it should be aligned with the { for OnStart().
tests/forms/Droid/MainActivity.cs
Outdated
| { | ||
| if (firstOnStart) | ||
| Console.WriteLine("startup-timing: OnStart reached"); | ||
| base.OnStart(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is indented too much; it should be aligned with the if, two lines above.
| <!-- colorPrimaryDark is used for the status bar --> | ||
| <item name="colorPrimaryDark">#1976D2</item> | ||
| <!-- colorAccent is used as the default value for colorControlActivated | ||
| which is used to tint widgets --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What made this line wrap decision? It's ugly. :-/
| public async Task<IEnumerable<Item>> GetItemsAsync(bool forceRefresh = false) | ||
| { | ||
| if (forceRefresh && CrossConnectivity.Current.IsConnected) | ||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This { should be on the previous line.
| public async Task<Item> GetItemAsync(string id) | ||
| { | ||
| if (id != null && CrossConnectivity.Current.IsConnected) | ||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
| { | ||
| Title = "About"; | ||
|
|
||
| OpenWebCommand = new Command(() => Device.OpenUri(new Uri("https://xamarin.com/platform"))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space before (.
|
|
||
| bool isBusy = false; | ||
| public bool IsBusy | ||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be on the previous line.
|
|
||
| string title = string.Empty; | ||
| public string Title | ||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
| LoadItemsCommand = new Command(async () => await ExecuteLoadItemsCommand()); | ||
|
|
||
| MessagingCenter.Subscribe<NewItemPage, Item>(this, "AddItem", async (obj, item) => | ||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This { should be on the previous line.
| { | ||
| Title = "Browse"; | ||
| Items = new ObservableCollection<Item>(); | ||
| LoadItemsCommand = new Command(async () => await ExecuteLoadItemsCommand()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space before (.
| }); | ||
| } | ||
|
|
||
| async Task ExecuteLoadItemsCommand() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space before (.
tests/forms/Views/MainPage.cs
Outdated
| { | ||
| case Device.iOS: | ||
| itemsPage = new NavigationPage(new ItemsPage()) | ||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This { should be on the previous line.
|
Overall, I don't like the name I would prefer |
cfaaf06 to
c766a6b
Compare
|
rebased on current master, so hopefully it will build OK now. regenerated the test with mono coding style set in VisualStudio/Mac, so hopefully it looks better now. also renamed the test directory and package name as suggested. |
c766a6b to
e2e6c52
Compare
|
build |
|
One downside to renaming |
| @@ -0,0 +1,19 @@ | |||
|
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file shouldn't exist. Instead, the .csproj should be added to the top level Xamarin.Android-Tests.sln file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, updated.
e2e6c52 to
d0a5c2d
Compare
|
The monodroid changes are simple, created https://github.com/xamarin/monodroid/pull/665 to do that. It can be completed with adding XA bump. |
d0a5c2d to
86d6af0
Compare
- to measure UI app startup times
- added RunUITests task (similar to unInstrumentationTests) to start
app/activity
- renamed .*UnitTestApk.* to .*TestApk.* as it handles also the new
UI test
- updated ProcessLogcatTiming to be able to process logcat output of
started Android activity process
86d6af0 to
2e8966e
Compare
to measure UI app startup times
added RunUITests task (similar to unInstrumentationTests) to start
app/activity
renamed .UnitTestApk. to .TestApk. as it handles also the new
UI test
updated ProcessLogcatTiming to be able to process logcat output of
started Android activity process