Merge lp://qastaging/~artmello/webbrowser-app/webbrowser-app-statesaver into lp://qastaging/webbrowser-app
- webbrowser-app-statesaver
- Merge into trunk
Status: | Rejected | ||||
---|---|---|---|---|---|
Rejected by: | Olivier Tilloy | ||||
Proposed branch: | lp://qastaging/~artmello/webbrowser-app/webbrowser-app-statesaver | ||||
Merge into: | lp://qastaging/webbrowser-app | ||||
Diff against target: |
180 lines (+31/-1) 9 files modified
src/app/webbrowser/Browser.qml (+7/-0) src/app/webbrowser/webbrowser-app.cpp (+3/-0) src/app/webbrowser/webbrowser-app.qml (+2/-0) src/app/webcontainer/WebApp.qml (+2/-0) src/app/webcontainer/WebViewImplOxide.qml (+4/-0) src/app/webcontainer/WebViewImplWebkit.qml (+4/-0) src/app/webcontainer/WebappContainerWebview.qml (+3/-1) src/app/webcontainer/webapp-container.cpp (+4/-0) src/app/webcontainer/webapp-container.qml (+2/-0) |
||||
To merge this branch: | bzr merge lp://qastaging/~artmello/webbrowser-app/webbrowser-app-statesaver | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Olivier Tilloy | Disapprove | ||
PS Jenkins bot | continuous-integration | Approve | |
Bill Filler (community) | Needs Fixing | ||
Review via email:
|
Commit message
Save the last visited url for a webapp
Description of the change
Save the last visited url for a webapp
- 633. By Arthur Mello
-
Add state saver to the webbrowser last visited url
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:633
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
- 634. By Arthur Mello
-
If a specialized url was provided to the webapp it is used instead of the state saved one
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:634
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Bill Filler (bfiller) wrote : | # |
tried this out and there is one problem:
- for webapps (tested amazon and gmail), the state save/restore works only once and does not work correctly the second time
To test:
- open amazon
- navigate to a page
- kill -2 on the pid
- relaunch amazon
- verify that the last url was restored
- then navigate to a different page
- kill -2 on the pid
- relaunch amazon
- the first url that was saved is restored, not the last visited page
This works fine for webbrowser-app, just not webapps
- 635. By Arthur Mello
-
Change the property saved to fix the issue of not saving the correct values
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Arthur Mello (artmello) wrote : | # |
> tried this out and there is one problem:
>
> - for webapps (tested amazon and gmail), the state save/restore works only
> once and does not work correctly the second time
> To test:
> - open amazon
> - navigate to a page
> - kill -2 on the pid
> - relaunch amazon
> - verify that the last url was restored
> - then navigate to a different page
> - kill -2 on the pid
> - relaunch amazon
> - the first url that was saved is restored, not the last visited page
>
> This works fine for webbrowser-app, just not webapps
Seems to work on r635
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:635
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Olivier Tilloy (osomon) wrote : | # |
I’ve tested only the browser app on desktop so far, and the general use case seems to work fine, however I’m seeing a case that doesn’t:
webbrowser-app http://
killall -9 webbrowser-app
webbrowser-app http://
I expect the second invokation of webbrowser-app to open ubuntu.com, however the previous state is restored and it browses to example.org instead.
Note that this issue is most likely affecting desktop only, not phone, where this kind of URL opening will go through the UriHandler, which will ignore the saved state, according to documentation.
To address this, you probably need a mechanism similar to what you did for the webapp-container, where you recognize whether a URL was explicitly requested on the command line.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Olivier Tilloy (osomon) wrote : | # |
As a side note, I wonder whether this kind of functionality can be tested with autopilot? Would you mind checking with someone from QA? Since the StateSaver works only if all the ancestors of a given item have an id explicitly set, it seems very prone to regressions (if someone accidentally removes a seemingly unused id), and having an integration test would prevent such regressions.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Olivier Tilloy (osomon) wrote : | # |
From the looks of the diff, it seems WebViewImplWebkit doesn’t actually implement state restore.
While we want to get rid of the webkit implementation ASAP, for the time being we have to support it, so there should be feature parity where possible. You can easily force the use of webkit instead of oxide by passing "--webkit" as a command line parameter when launching webapp-container.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Olivier Tilloy (osomon) wrote : | # |
What exactly is the use case that requires an extra 'specializedUrl
- 636. By Arthur Mello
-
Merge with trunk
- 637. By Arthur Mello
-
Make sure that if a url is provided as a parameter to webbrowser it will override the state saved url
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Arthur Mello (artmello) wrote : | # |
> I’ve tested only the browser app on desktop so far, and the general use case
> seems to work fine, however I’m seeing a case that doesn’t:
>
> webbrowser-app http://
> killall -9 webbrowser-app
> webbrowser-app http://
>
> I expect the second invokation of webbrowser-app to open ubuntu.com, however
> the previous state is restored and it browses to example.org instead.
>
> Note that this issue is most likely affecting desktop only, not phone, where
> this kind of URL opening will go through the UriHandler, which will ignore the
> saved state, according to documentation.
>
> To address this, you probably need a mechanism similar to what you did for the
> webapp-container, where you recognize whether a URL was explicitly requested
> on the command line.
Fixed on r637
- 638. By Arthur Mello
-
Implement the same strategy used on Oxide to WebKit
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Arthur Mello (artmello) wrote : | # |
> From the looks of the diff, it seems WebViewImplWebkit doesn’t actually
> implement state restore.
> While we want to get rid of the webkit implementation ASAP, for the time being
> we have to support it, so there should be feature parity where possible. You
> can easily force the use of webkit instead of oxide by passing "--webkit" as a
> command line parameter when launching webapp-container.
Fixed on r638
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Arthur Mello (artmello) wrote : | # |
> As a side note, I wonder whether this kind of functionality can be tested with
> autopilot? Would you mind checking with someone from QA? Since the StateSaver
> works only if all the ancestors of a given item have an id explicitly set, it
> seems very prone to regressions (if someone accidentally removes a seemingly
> unused id), and having an integration test would prevent such regressions.
I will check with QA guys to check how that could be done.
- 639. By Arthur Mello
-
Change the WebApp implementation to work on the same way as webbrowser
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Arthur Mello (artmello) wrote : | # |
> What exactly is the use case that requires an extra 'specializedUrl
> property (I remember you mentioned it yesterday, but I don’t remember exactly
> what it was)?
specializedUrlP
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:638
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:639
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Olivier Tilloy (osomon) wrote : | # |
This might be working (I haven’t actually tested this time round), but the implementation doesn’t look right: from a semantics point of view, it doesn’t make sense to add a 'restoreUrl' parameter to the newTab(…) function in webbrowser-app.qml and to the openUrlInNewTab(…) function in Browser.qml. openUrlInNewTab(…) is being called in several other places where this parameter is meaningless.
Since in this iteration we are saving only one URL (that of the current tab), we should probably add a 'currentUrl' property to the top-level Browser component (or maybe even to the top-level BrowserView component, so that it’s shared between the two apps) that will be updated whenever the URL of the current webview changes (but not be a direct binding to currentWebview.url to avoid it being set when we don’t want to), and upon restore can be used to selectively open a new tab with the saved URL depending on the situation.
I have not tested the above suggestion, so there may be caveats, but the approach looks sounder to me.
On a related note, did you get feedback from the QA team on the feasability of autopilot tests for the feature? We would need a test that launches the app, browses to a given URL, stops the app, then launches it again and verifies that the URL is restored.
- 640. By Arthur Mello
-
Make sure that a new tab is not restored when created
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:640
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
- 641. By Arthur Mello
-
Create a property on TabsModel to store all opened urls
- 642. By Arthur Mello
-
Restore all opened urls
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Arthur Mello (artmello) wrote : | # |
Removed the restoreUrl parameter from the newTab function, as mentioned. Using the currentUrl property to store the last visited url.
Added to support to restore all the open tabs. I am trying to use the StateSaver to do that, but since it does not seem to be able to restore a model I am saving a list of open urls and creating new tabs during the restore process.
I am not restoring any tab if a url/list of urls is passed as a command line parameter. Should we keep that or open the provided urls as new tabs?
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:642
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Bill Filler (bfiller) wrote : | # |
tested latest debs on device build 153
Things are not working correctly for webbrowser-app. First time I opened two tabs and did kill -2 and it worked correctly, restoring tabs. Now everytime after that it won't save restore any urls regardless if I have single or multiple tabs. So something is broken.
webapp-container seems to be working correctly
- 643. By Arthur Mello
-
Remove option to restore all tabs
Add option to restore the last visited url
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:643
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Arthur Mello (artmello) wrote : | # |
I removed the support for restoring all the tabs and return the code to restore only the last current url. I tested the support for only the last current url on desktop and on last device image and it seems to be working as expected.
Took me some time debugging the error reported by Bill about restoring tabs. So basically I had added a "urls" property to the TabsModel component that stored a list of all urls opened on tabs. Since when restoring this list I need to create all webviews and populate the model correctly I was using a property on the Browser component with the value of this list. This Browser's property was the one stored by StateSaver. When this property was restored I call the properly function to create the tabs.
This seems to work correctly on desktop but on device the Browser property seems not to be updated as frequently as the TabsModel one. With this the wrong data was stored by StateSaver. If we try to print the value of the property (for debug purposes) the value is the same as the TabModel one. But if we call something like this console.
While we think on a better way to do that. I keep only the last current url code
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:643
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Olivier Tilloy (osomon) wrote : | # |
Superseded by https:/
Thanks for your initial work on this Arthur!
Unmerged revisions
- 643. By Arthur Mello
-
Remove option to restore all tabs
Add option to restore the last visited url - 642. By Arthur Mello
-
Restore all opened urls
- 641. By Arthur Mello
-
Create a property on TabsModel to store all opened urls
- 640. By Arthur Mello
-
Make sure that a new tab is not restored when created
- 639. By Arthur Mello
-
Change the WebApp implementation to work on the same way as webbrowser
- 638. By Arthur Mello
-
Implement the same strategy used on Oxide to WebKit
- 637. By Arthur Mello
-
Make sure that if a url is provided as a parameter to webbrowser it will override the state saved url
- 636. By Arthur Mello
-
Merge with trunk
- 635. By Arthur Mello
-
Change the property saved to fix the issue of not saving the correct values
- 634. By Arthur Mello
-
If a specialized url was provided to the webapp it is used instead of the state saved one
PASSED: Continuous integration, rev:632 jenkins. qa.ubuntu. com/job/ webbrowser- app-ci/ 961/ jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- utopic- touch/2316 jenkins. qa.ubuntu. com/job/ generic- mediumtests- utopic/ 1908 jenkins. qa.ubuntu. com/job/ webbrowser- app-utopic- amd64-ci/ 160 jenkins. qa.ubuntu. com/job/ webbrowser- app-utopic- armhf-ci/ 160 jenkins. qa.ubuntu. com/job/ webbrowser- app-utopic- armhf-ci/ 160/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ webbrowser- app-utopic- i386-ci/ 160 jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- runner- mako/2501 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- armhf/3525 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- armhf/3525/ artifact/ work/output/ *zip*/output. zip s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 10222 jenkins. qa.ubuntu. com/job/ autopilot- testrunner- otto-utopic/ 1599 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- amd64/2138 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- amd64/2138/ artifact/ work/output/ *zip*/output. zip
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/webbrowser- app-ci/ 961/rebuild
http://