Skip to content

Conversation

@radekdoulik
Copy link
Member

  • 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

@radekdoulik
Copy link
Member Author

the build will fail as it will need a fix from #815 to be able to use custom timing definitions

@jonpryor
Copy link
Contributor

jonpryor commented Sep 5, 2017

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]
Copy link
Contributor

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.


namespace forms
{
public partial class App : Application
Copy link
Contributor

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.

public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
{
bool firstOnCreate = true;
bool firstOnStart = true;
Copy link
Contributor

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.

Console.WriteLine("startup-timing: OnCreate end reached");
firstOnCreate = false;
}
}
Copy link
Contributor

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().

Console.WriteLine("startup-timing: OnStart end reached");
firstOnStart = false;
}
}
Copy link
Contributor

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().

{
if (firstOnStart)
Console.WriteLine("startup-timing: OnStart reached");
base.OnStart();
Copy link
Contributor

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 -->
Copy link
Contributor

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)
{
Copy link
Contributor

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)
{
Copy link
Contributor

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")));
Copy link
Contributor

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
{
Copy link
Contributor

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
{
Copy link
Contributor

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) =>
{
Copy link
Contributor

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());
Copy link
Contributor

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()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space before (.

{
case Device.iOS:
itemsPage = new NavigationPage(new ItemsPage())
{
Copy link
Contributor

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.

@jonpryor
Copy link
Contributor

jonpryor commented Sep 5, 2017

Overall, I don't like the name tests/forms. It doesn't have any semantic meaning, to answer "why does this directory exist?" (Compare to tests/CodeGen-*, which deals with code generation, or tests/ResolveImports, which deals with project resolution.) "forms" is a what, not a why.

I would prefer tests/Xamarin.Forms-Performace-Integration, or something otherwise semantically meaningful.

@radekdoulik
Copy link
Member Author

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.

@jonpryor
Copy link
Contributor

jonpryor commented Sep 6, 2017

build

@jonpryor
Copy link
Contributor

jonpryor commented Sep 7, 2017

One downside to renaming @(UnitTestApk) to @(TestApk) is that this will require additional monodroid-side changes in order to merge. Is this desirable?

@@ -0,0 +1,19 @@

Copy link
Contributor

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, updated.

@radekdoulik
Copy link
Member Author

The monodroid changes are simple, created https://github.com/xamarin/monodroid/pull/665 to do that. It can be completed with adding XA bump.

 - 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
@jonpryor jonpryor merged commit 09ba1ee into dotnet:master Sep 7, 2017
@github-actions github-actions bot locked and limited conversation to collaborators Feb 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants