Merge lp:~uriboni/webbrowser-app/search-suggestions into lp:webbrowser-app
| Status: | Merged |
|---|---|
| Approved by: | Olivier Tilloy on 2015-05-12 |
| Approved revision: | 995 |
| Merged at revision: | 1006 |
| Proposed branch: | lp:~uriboni/webbrowser-app/search-suggestions |
| Merge into: | lp:webbrowser-app |
| Prerequisite: | lp:~osomon/webbrowser-app/autopilot-temp-profile-config |
| Diff against target: |
659 lines (+272/-54) 11 files modified
CMakeLists.txt (+2/-0) src/app/config.h.in (+5/-0) src/app/webbrowser/Browser.qml (+26/-5) src/app/webbrowser/SearchSuggestions.qml (+78/-0) src/app/webbrowser/Suggestion.qml (+5/-2) src/app/webbrowser/Suggestions.qml (+22/-11) src/app/webbrowser/searchengine.cpp (+13/-1) src/app/webbrowser/searchengine.h (+4/-0) tests/autopilot/webbrowser_app/tests/__init__.py (+6/-6) tests/autopilot/webbrowser_app/tests/http_server.py (+14/-1) tests/autopilot/webbrowser_app/tests/test_suggestions.py (+97/-28) |
| To merge this branch: | bzr merge lp:~uriboni/webbrowser-app/search-suggestions |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Olivier Tilloy | 2015-05-12 | Approve on 2015-05-12 | |
| PS Jenkins bot | continuous-integration | 2015-05-12 | Needs Fixing on 2015-05-12 |
|
Review via email:
|
|||
This proposal supersedes a proposal from 2015-04-22.
Commit Message
Add suggestions from search engines in the suggestions list.
Description of the Change
Add suggestions from search engines in the suggestions list.
| Ugo Riboni (uriboni) wrote : | # |
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:972
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:975
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| Olivier Tilloy (osomon) wrote : | # |
From a very quick functional test, this seems to work nicely (I’ll do more in-depth testing and a code review later).
One thing that I noticed is that the terms are not highlighted in search suggestions, as they are for history entries and bookmarks. According to the visual spec they should be.
| Olivier Tilloy (osomon) wrote : | # |
« This API is not official, but it is what Google products and everyone else uses to implement search suggestions. The "client=firefox" is there to request JSON output. »
Can you add this as a comment in config.h.in ?
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:976
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:978
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:979
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| Olivier Tilloy (osomon) wrote : | # |
I’m seeing one funny behaviour: I’m adding a custom search engine definition (https:/
There are two things to fix here:
- that XML description file seems to have a valid suggestions URL, for some reason it’s not being parsed/used, it should be
- when loading a valid XML description file that doesn’t have a suggestions URL, we shouldn’t fall back to Google, instead there shouldn’t be any search suggestions
| Olivier Tilloy (osomon) wrote : | # |
When launching the app, the address bar is not focused, so the suggestions list is not shown, yet I’m seeing a query issued to the suggestions URL with the current URL. There shouldn’t be any queries issued until the address bar has focus and its contents change.
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:980
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:980
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:981
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:982
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:983
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:984
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:983
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| Olivier Tilloy (osomon) wrote : | # |
A few minor additional remarks:
In SearchSuggestio
- QQuickItem already has an 'enabled' property, I don’t think it’s necessary to override its definition
- in resetSearch(), the request (if any) should be aborted even if !enabled
A suggestion (pun not intended): in Browser.qml, in the two instances of LimitProxyModel that populate the list of suggestions for history entries and bookmarks, properties 'icon' and 'displayUrl' can be marked 'readonly'.
Similarly, in Suggestions.qml, the new properties added can be marked readonly.
In test_suggestion
- in setup_suggestio
- In highlight_term(), this function won’t work if there’s more than one occurrence of term in text. This is arguably unimportant for the scope of the tests, but the function could be simplified (and made to work in all cases) by simply returning "<html>
- in test_search_
| Olivier Tilloy (osomon) wrote : | # |
There is now a (trivial) conflict when merging this branch into the latest trunk.
test_suggestions.py will require a bit of refactoring to make use of the newly-introduced self.data_location (revision 994) to write test search engine descriptions.
| Ugo Riboni (uriboni) wrote : | # |
All suggestions implemented except for the following:
> In SearchSuggestio
> - QQuickItem already has an 'enabled' property, I don’t think it’s necessary
> to override its definition
Item.enabled has a completely different meaning tied to keyboard focus, and re-using it to do something else is wrong (and actually does not ever work since the property is toggled on and off various times by QML itself).
It was my mistake to redefine it though, as the original can't be accessed any more, so I defined a new "active" property that does the same thing, while leaving Item.enabled alone and with its original meaning.
> In test_suggestion
> - in setup_suggestio
> "http://
> test:80 requests to localhost:port
Is this a DNS mapping or a redirect of some sort ? Because it does not seem to work when using XmlHttpRequest from QML to get the list of suggestions. The responseText comes out empty, which is the way XmlHttpRequest signals errors, but I can't tell more details on why.
I spent way too much time on this already, so I will leave it as it was for now.
> - In highlight_term(), this function won’t work if there’s more than one
> occurrence of term in text. This is arguably unimportant for the scope of the
> tests, but the function could be simplified (and made to work in all cases) by
> simply returning "<html>
> self.highlight(
This does not work. In some cases I get a complain from re.py of "unbalanced parenthesis". Unless you have a quick fix I would leave it as it is.
- 991. By Ugo Riboni on 2015-05-12
-
Add project name in main cmake file, for convenience in qtcreator
| Olivier Tilloy (osomon) wrote : | # |
> It was my mistake to redefine it though, as the original can't be accessed
> any more, so I defined a new "active" property that does the same thing,
> while leaving Item.enabled alone and with its original meaning.
Yeah, that’s better and safer indeed.
> Is this a DNS mapping or a redirect of some sort ? Because it does not seem
> to work when using XmlHttpRequest from QML to get the list of suggestions.
This is oxide-specific (see Oxide.WebContex
> This does not work. In some cases I get a complain from re.py of
> "unbalanced parenthesis". Unless you have a quick fix I would leave
> it as it is.
Yeah, that’s fine.
| Olivier Tilloy (osomon) wrote : | # |
That looks all good now.
I have only one minor concern: in TestSuggestions
- 992. By Ugo Riboni on 2015-05-12
-
Keep the server in a temporary variable, instead of in the test instance
- 993. By Ugo Riboni on 2015-05-12
-
More safely store the server in an instance variable
- 994. By Ugo Riboni on 2015-05-12
-
Do the same in the package main
- 995. By Ugo Riboni on 2015-05-12
-
Better names
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:991
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://

Added inline comments