Closed Bug 1152392 Opened 9 years ago Closed 9 years ago

Autophone - webappstartup should detect and use the proper profile

Categories

(Testing Graveyard :: Autophone, defect)

defect
Not set
normal

Tracking

(firefox40 affected)

RESOLVED FIXED
Tracking Status
firefox40 --- affected

People

(Reporter: bc, Assigned: bc)

References

Details

Attachments

(2 files)

Currently the webappstartup test does not use the correct profile in terms of setting preferences, detecting crashes etc. It should determine and use the appropriate profile.
Basically what we need to do to get the profile path for the webapp is:

* pull /data/data/{appname}/files/mozilla/profile.ini
* parse the ini file
* find the profile section with the Name property ~ webapp<N>. Typically webapp0.
* construct the profile path from the Path property as relative (IsRelative=1) or absolute
Actually, since the webapp profile directory is not created until launch, I think what I need to do is:

1. create the profile in the /data/data/{appname}/files/mozilla/ directory.
2. pull profile.ini
3. edit it to contain a section for the webapp
4. push back to the device.

Then when the webappstarts, it will?|should use the specified profile directory.
This adds a call to Quitter to shutdown the app cleanly. It uses the old Quitter version and I'll have to update this when we deploy the new version but I want to get it in now instead of waiting.
Attachment #8597708 - Flags: review?(snorp)
Attached file pr 26
This kludge works but is definitely not the preferred method but it is all I can come up with until webapps support specifying the profile path.

This creates the profile for the webapp by starting the webapp and waiting for the profiles.ini file to be created and the Path to be available in the webapp0 profile.

It then waits 10 seconds before killing the webapp.

This 10 seconds is definitely a kludge, but I've tried any number of ways to detect when the relevant directories are initialized and none of them have worked. Even trying 5 seconds is insufficient. I end up with a webapp which won't output the WEBAPP STARTUP COMPLETE message. The real fix is to have the webapp be able to specify the profile directory it will use so I don't have to do all this stuff to set the preferences and install add-ons.

It then deletes the contents of the profile directory specified in the profiles.ini, and uses FirefoxProfile to create the initial contents with the specified preferences and xpis to install.

When the test starts running, the other related directories already exist and the path specified in the profiles.ini is used to re-initialize the profile with the preferences in user.js and the specified add-ons.

Since the profile directory changes for every iteration since we uninstall and install the webapp for every iteration, AutophoneCrashProcessor's remote_dump_dir no longer caches the value and calculates it every time it is accessed.

WebAppStartupTest's run_test now checks for crashes etc after every run of webapp since the minidump directory is deleted/recreated every iteration.

In addition, the WebAppStartupTest's tear_down has to call PerfTest's tear_down before uninstalling the webapp otherwise the profile directory would have been deleted before we could do the final crash check.

I'm using the same style of preference setting as in the PerfTests. I'll file a bug on refactoring the preference handling, but I don't want to do it in this bug.

I ran tests and posted to phonedash-dev.

The test runs on Apr 23 were using an initial version of this patch where I actually launched the webapp one time as part of creating the profile. In these runs, the profile is completely initialized by a complete run before the First Run measurement is done.

The test runs on Apr 24 up to 2015-04-24 06:19:06 were using the existing code before this patch so I could compare before and after.

The test runs after 2015-04-24 09:47:56 were using this version of the patch.

first run throbber start
http://phonedash-dev.allizom.org/#/org.mozilla.fennec/throbberstart/webappstartup/norejected/2015-04-23/2015-04-25/notcached/errorbars/standarderror/notry

This patch agrees with the unpatched version on the throbber start. The Apr 23 run is a bit faster on the startup since its directories were completely initialized before the test began.

first run throbber stop
http://phonedash-dev.allizom.org/#/org.mozilla.fennec/throbberstop/webappstartup/norejected/2015-04-23/2015-04-25/notcached/errorbars/standarderror/notry

This patch shows that the unpatched version spends a considerable amount of time creating all of the initial directories and files. This version of the patch loses the measurement of the time required to create these other directories with the exception that it does measure the time needed to initialize the profile path found in the profiles.ini file.

second run throbber start
http://phonedash-dev.allizom.org/#/org.mozilla.fennec/throbberstart/webappstartup/norejected/2015-04-23/2015-04-25/cached/errorbars/standarderror/notry

essentially the same

second run throbber stop
http://phonedash-dev.allizom.org/#/org.mozilla.fennec/throbberstop/webappstartup/norejected/2015-04-23/2015-04-25/cached/errorbars/standarderror/notry

essentially the same
Attachment #8597713 - Flags: review?(gbrown)
Attachment #8597708 - Flags: review?(snorp) → review+
Comment on attachment 8597713 [details] [review]
pr 26

This seems easily breakable, but it sounds like there are no better options.
Attachment #8597713 - Flags: review?(gbrown) → review+
done
Flags: needinfo?(snorp)
Thanks a roo!
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Blocks: 1160155
No longer blocks: 1160155
Blocks: 1163129
Product: Testing → Testing Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: