summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autocomplete/autocomplete_unittest.cc
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-22 20:05:59 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-22 20:05:59 +0000
commit7e563816b35dcc102eb69849295b5f6f9d048a63 (patch)
treeb6a833b3b32b58ed8453f1d63682c77d6b158d08 /chrome/browser/autocomplete/autocomplete_unittest.cc
parent1679e8667e258a9903a18792894e13a17639e122 (diff)
downloadchromium_src-7e563816b35dcc102eb69849295b5f6f9d048a63.zip
chromium_src-7e563816b35dcc102eb69849295b5f6f9d048a63.tar.gz
chromium_src-7e563816b35dcc102eb69849295b5f6f9d048a63.tar.bz2
Make various types of input work better with ctrl-enter. If we detected 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
Diffstat (limited to 'chrome/browser/autocomplete/autocomplete_unittest.cc')
-rw-r--r--chrome/browser/autocomplete/autocomplete_unittest.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_unittest.cc b/chrome/browser/autocomplete/autocomplete_unittest.cc
index 2507310..8042724 100644
--- a/chrome/browser/autocomplete/autocomplete_unittest.cc
+++ b/chrome/browser/autocomplete/autocomplete_unittest.cc
@@ -280,6 +280,22 @@ TEST(AutocompleteTest, InputType) {
}
}
+TEST(AutocompleteTest, InputTypeWithDesiredTLD) {
+ struct test_data {
+ const wchar_t* input;
+ const AutocompleteInput::Type type;
+ } input_cases[] = {
+ { L"401k", AutocompleteInput::REQUESTED_URL },
+ { L"999999999999999", AutocompleteInput::REQUESTED_URL },
+ };
+
+ for (size_t i = 0; i < ARRAYSIZE_UNSAFE(input_cases); ++i) {
+ AutocompleteInput input(input_cases[i].input, L"com", true, false, false);
+ EXPECT_EQ(input_cases[i].type, input.type()) << "Input: " <<
+ input_cases[i].input;
+ }
+}
+
// This tests for a regression where certain input in the omnibox caused us to
// crash. As long as the test completes without crashing, we're fine.
TEST(AutocompleteTest, InputCrash) {