summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autocomplete/autocomplete_unittest.cc
Commit message (Collapse)AuthorAgeFilesLines
* Make various types of input work better with ctrl-enter. If we detected ↵pkasting@chromium.org2010-03-221-0/+16
| | | | | | | | | | that the hostname without adding the TLD was illegal, we'd sometimes fail to allow the TLD to be added. BUG=38605 TEST=Should be able to hit ctrl-enter on "401k" and "999999999999" to open them with www. and .com attached. Review URL: http://codereview.chromium.org/1088004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42246 0039d316-1c4b-4281-b951-d872f2087c98
* chrome 2: string_util.h -> utf_string_conversions.h fix.jhawkins@chromium.org2010-03-081-1/+2
| | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/672007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40945 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Revert r31175 r31176 r31187"hclam@chromium.org2009-11-061-0/+2
| | | | | | | | | | | | The bustage seems to be a WebKit change upstream. It is not reverted in WebKit and merger. So bring the innocent change back in. TBR=jam TEST=green tree Review URL: http://codereview.chromium.org/375009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31214 0039d316-1c4b-4281-b951-d872f2087c98
* Rever r31175 r31176 r31187hclam@chromium.org2009-11-061-2/+0
| | | | | | | | | | | XP tests are failing, the guess is r31175 and r31176. TBR=beng TEST=XP tests go green Review URL: http://codereview.chromium.org/376008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31201 0039d316-1c4b-4281-b951-d872f2087c98
* Fifth patch in making destructors of refcounted objects private.jam@chromium.org2009-11-061-0/+2
| | | | | | | | BUG=26749 Review URL: http://codereview.chromium.org/361025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31175 0039d316-1c4b-4281-b951-d872f2087c98
* Better handling of UNKNOWN versus QUERY in a couple ways.pkasting@chromium.org2009-11-031-4/+7
| | | | | | | | | | | | First, made it possible to navigate to "invalid" hostnames in a number of additional cases, including when the user types an explicit scheme or when we have a valid TLD and no spaces. The default action for these kinds of inputs is still search, but we'll pull up an accidental search infobar if need be now. Second, made the HistoryURLProvider show a What You Typed match for UNKNOWN inputs when the user explicitly typed "http:" or "https:" at the front, since these have the highest probability of being navigational inputs. BUG=26341 TEST=Type "http://foo bar baz.com" and verify you are given a (non-default) entry in the dropdown to navigate. Review URL: http://codereview.chromium.org/353010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30830 0039d316-1c4b-4281-b951-d872f2087c98
* Loosen RFC 1738 compliance check to allow underscores where we already ↵pkasting@chromium.org2009-10-271-0/+2
| | | | | | | | | | | | allowed hyphens, to match real-world needs. I don't believe further loosening will be required but that data will hopefully be coming soon. In the meantime people are asking for this fix. BUG=25714 TEST=Entring "a_b.com" in the omnibox should default to navigate, not search Review URL: http://codereview.chromium.org/339017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30245 0039d316-1c4b-4281-b951-d872f2087c98
* Parse input with explicit schemes better. Before, if the user typed ↵pkasting@chromium.org2009-10-191-1/+20
| | | | | | | | | | "http://..." we always parsed as a URL. Now we parse more like we would without the scheme, so that we can reject various kinds of invalid inputs. BUG=none TEST=Input "http://foo:bar" (without quotes) in the address bar, and the default action should be search, not navigate. Review URL: http://codereview.chromium.org/292003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29450 0039d316-1c4b-4281-b951-d872f2087c98
* Classify more types of input as queries.pkasting@chromium.org2009-10-161-0/+4
| | | | | | | | | | | | This adds an oracle that can determine if a hostname is RFC 1738 compliant; if we get a hostname that's not an IP address and not compliant here, we almost certainly have a query. This also rejects "ports" that don't consist of a number between 0 and 65535 (e.g. port "abc" or port "123456"). BUG=18817 TEST=The string "foo: bar" (with quotes) should default to search, not navigate, in the address bar. Review URL: http://codereview.chromium.org/271116 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29317 0039d316-1c4b-4281-b951-d872f2087c98
* More work fixing miscellaneous issues in the autocomplete code, probably ↵pkasting@chromium.org2009-09-011-5/+3
| | | | | | | | | | | | | | | | | none of which will help my crasher :( * Force the query to stop if the user deletes a match. This makes more sense from a UI perspective and allows some code to be simpler. * Prevent us from potentially doing a "minimal changes" match in a different profile (hard to trigger, likely no practical effects) * Remove unneeded Reset() call on a repeating timer (which will auto-reset itself) * Rename one of the notifications and move its listener to the edit, since that's who really cares about it anyway. * Make the controller's Stop(true) notify the popup via the normal observer pipeline rather than coding something special into the popup's StopAutocomplete(). * Rename |paste_and_go_controller| |synchronous_controller| and use it instead of using the main popup controller to do the synchronous query when calling URLsForDefaultMatch(). This makes things both simpler and safer. BUG=none TEST=Using the omnibox still works fine Review URL: http://codereview.chromium.org/178049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25044 0039d316-1c4b-4281-b951-d872f2087c98
* Original patch by pmarks@google.com (see http://codereview.chromium.org/113944)ericroman@google.com2009-06-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | - Pull in googleurl r107, which includes the new CanonicalizeHostVerbose() function: http://code.google.com/p/google-url/source/detail?r=107 - Atomically update Chromium to make use of this new function. This allows us to extract better information about IP addresses using fewer, and cleaner, calls to googleurl. - Also, change a call to CanonicalizeIPAddress() to stay compatible with r107. The upshot of all this is, Chrome will no longer try to connect to IPv4 addresses with overflow "http://192.168.0.257", or hostnames surrounded by square brackets "http://[google.com]" BUG=none TEST={unit_tests,googleurl_unittests,net_unittests} Review URL: http://codereview.chromium.org/146053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19076 0039d316-1c4b-4281-b951-d872f2087c98
* Fix crash due to AutocompletePopup trying to draw the old results when they ↵pkasting@chromium.org2009-06-031-1/+1
| | | | | | | | were no longer available.I introduced this regression when moving |result_| to the AutocompleteController; the specific problem was the "result_.CopyFrom(latest_result_);" line I added when handling the synchronous messages being available. This was done so the popup could get at the new results to update the edit with them.Instead, go back to the old method (of not updating the results until the first coalesced update came in), and pass the appropriate result set as a Details<> in the notification, so the popup can get at it without having to know how the controller works under-the-hood.BUG=11742 Review URL: http://codereview.chromium.org/119116 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17562 0039d316-1c4b-4281-b951-d872f2087c98
* Allow IPv6 literals to be typed directly into the address bar, withoutabarth@chromium.org2009-05-181-0/+4
| | | | | | | | | | | | | | | | | | requiring a preceding http://. The square brackets are still needed, though. Fix some of the style problems in url_fixer_upper.cc: - Multi-line if should have {}s - "using namespace" is bad. Patch by pmarks@google.com. R=abarth TEST=New unit tests. http://codereview.chromium.org/113509 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16267 0039d316-1c4b-4281-b951-d872f2087c98
* Color/emphasize correct portions of view-source: URLs. Original patch by ↵pkasting@chromium.org2009-04-141-0/+45
| | | | | | | | Shinichiro Hamaji (see http://codereview.chromium.org/62094/show ), r=me. BUG=2349 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13671 0039d316-1c4b-4281-b951-d872f2087c98
* Properly handle empty components when converting url_parse::Parsed object.estade@chromium.org2009-04-081-0/+1
| | | | | | | | | | Add a unittest for the below bug. BUG=9859 Review URL: http://codereview.chromium.org/62162 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13388 0039d316-1c4b-4281-b951-d872f2087c98
* Temporary fix for omnibox crash.estade@chromium.org2009-04-081-0/+6
| | | | | | | | BUG=9760 Review URL: http://codereview.chromium.org/63095 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13340 0039d316-1c4b-4281-b951-d872f2087c98
* Remove unneeded uses of base/ref_counted.h.thestig@chromium.org2009-03-181-1/+0
| | | | | | Review URL: http://codereview.chromium.org/48105 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11974 0039d316-1c4b-4281-b951-d872f2087c98
* Porting unit tests in chrome/phajdan.jr@chromium.org2009-03-171-1/+1
| | | | | | | | | | | | | | | | | Enable following tests on Linux: browser/autocomplete/autocomplete_unittest.cc browser/navigation_controller_unittest.cc browser/search_engines/template_url_model_unittest.cc browser/sessions/session_backend_unittest.cc browser/tab_contents/web_contents_unittest.cc Remove not-existing file from remove list for Linux. Check for zero-size write in SessionBackend because it's an error in POSIX (but is ok from the session backend's perspective). Review URL: http://codereview.chromium.org/42223 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11852 0039d316-1c4b-4281-b951-d872f2087c98
* Enable AutocompleteTest, HistoryURLProviderTest,shess@chromium.org2009-03-161-8/+8
| | | | | | | | | | | HistoryContentsProviderTest, and KeywordProviderTest from chrome/browser/autocomplete. NOTIMPLEMENTED bits where HistoryURLProviderTest and AutocompleteTest have UI dependencies, and ExternalProtocolHandler has OS dependencies. Review URL: http://codereview.chromium.org/43034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11729 0039d316-1c4b-4281-b951-d872f2087c98
* Misc formatting / cleanup in the autocomplete code.deanm@chromium.org2009-02-271-1/+0
| | | | | | | | | | | | | | - Reformat / reword some comments. - Update include guards to the new style. - Remove trailing blank lines from end of files. - Clean up some includes. - Pull the CompareQuality functor into the implementation. - Pull kQueryDelayMs into the implementation. Review URL: http://codereview.chromium.org/27206 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10603 0039d316-1c4b-4281-b951-d872f2087c98
* Remove most header file dependencies on the notification type list. It isbrettw@chromium.org2009-02-011-3/+6
| | | | | | | | | | | really painful to add more types, since lots of headers include the notification service to derive from the notification observer. This splits that out, so much less of the project should end up including notification_types.h ---Paths modified but not in any changelist: Review URL: http://codereview.chromium.org/19744 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9020 0039d316-1c4b-4281-b951-d872f2087c98
* Make the autocomplete system and various other connected bits of code use ↵pkasting@chromium.org2008-12-101-5/+7
| | | | | | | | GURL instead of wstring where appropriate. Original patch by phajdan.jr@gmail.com, r=me,sky. See http://codereview.chromium.org/13205 . BUG=715234 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6758 0039d316-1c4b-4281-b951-d872f2087c98
* Omnibox metrics logging patch splitout, part 5: Add additional ↵pkasting@chromium.org2008-11-131-3/+4
| | | | | | | | | AutocompleteMatch types, and pass a type to the AutocompleteMatch constructor. The added detail in the new types is not used for anything functional; its sole purpose is for metric logging. Someday we could probably update other bits of the code to make use of this, though (e.g. the paste-and-search vs. paste-and-go determinant code). These are separable changes, but doing either one without the other would have required an annoying number of fragile temporary changes. Review URL: http://codereview.chromium.org/10855 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5329 0039d316-1c4b-4281-b951-d872f2087c98
* Omnibox metrics logging patch splitout, part 2: Remove the AutocompleteMatch ↵pkasting@chromium.org2008-11-121-2/+2
| | | | | | | | | NULL constructor. It's too easy to forget to set various members with this. The changes from .resize() to .erase() are necessary because the compiler doesn't know resize() won't be enlarging the vector and thus needing to access the NULL constructor. The changes to the HistoryContents shortcut code were similarly necessary to avoid a NULL construction, but in the end I think made the resulting code a bit clearer. Review URL: http://codereview.chromium.org/10837 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5271 0039d316-1c4b-4281-b951-d872f2087c98
* Move |result_| and |latest_result_| to the autocomplete controller.pkasting@chromium.org2008-10-091-22/+29
| | | | | | | This purposefully does not change the communication interface between the edit and the popup; that's coming in a subsequent pass. As a result, right now the popup isn't really much simpler. That should eventually change. Review URL: http://codereview.chromium.org/6596 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3113 0039d316-1c4b-4281-b951-d872f2087c98
* Stop exposing manually_selected_match_ outside the AutocompletePopupModel. ↵pkasting@chromium.org2008-09-191-79/+4
| | | | | | | | | | | | | | | | | | | The main goal of this is to be a first step towards divorcing the popup and the edit from each other. To do this, I changed the behavior of manual selections. They now do not persist once the user types more characters, hits esc, etc. Our old behavior, which Brett and I designed long ago, turns out to have been a mistake; users who arrowed to an item and then typed more weren't expecting "stickiness" on their previous choice, and it led to user mistakes. This also required changing how we do the "keyword UI" persistence in the case where the user switches into keyword UI, but then deletes all his text. Previously, we used manually_selected_match_ with a provider affinity to the keyword provider in order to accomplish this. Now we stick another flag on the AutocompleteInput, which, when set, biases the keyword provider to return the best results. The user-visible effect of this is that when in keyword UI mode with no query string, the selected entry in the popup will be the first, rather than third, entry. This is a small win. While here I fixed the bug where editing a string and transforming it into a keyword search would avoid switching into keyword UI (as expected), but also delete the keyword off the visible string (oops). I also made us lock the popup once the user changes the manually_selected_match_, in order to give a little more stability to it. I'm sorry this makes so many behavioral changes at once. All this code is tangled together and untangling it is hard :( The keyword-related variables in the AutocompleteEditModel seem a mess. They are probably worse now than before this change; I think I need a followup change at some point to make them all more sane. It seems like we have three variables and complex conditionals where two, and simpler ones, would do. BUG=997976,1201974,1204173 Review URL: http://codereview.chromium.org/3172 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2426 0039d316-1c4b-4281-b951-d872f2087c98
* Chrome changes corresponding to my message_loop_type CL.darin@google.com2008-08-261-0/+1
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1363 0039d316-1c4b-4281-b951-d872f2087c98
* Use a more compact license header in source files.license.bot2008-08-241-28/+4
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1287 0039d316-1c4b-4281-b951-d872f2087c98
* Add chrome to the repository.initial.commit2008-07-261-0/+361
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15 0039d316-1c4b-4281-b951-d872f2087c98