OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/message_loop.h" | 5 #include "base/message_loop.h" |
6 #include "base/string_util.h" | 6 #include "base/string_util.h" |
7 #include "chrome/browser/autocomplete/autocomplete.h" | 7 #include "chrome/browser/autocomplete/autocomplete.h" |
8 #include "chrome/common/notification_registrar.h" | 8 #include "chrome/common/notification_registrar.h" |
9 #include "chrome/common/notification_service.h" | 9 #include "chrome/common/notification_service.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 { L"\\\\Server\\Folder\\File", AutocompleteInput::URL }, | 232 { L"\\\\Server\\Folder\\File", AutocompleteInput::URL }, |
233 #endif // defined(OS_WIN) | 233 #endif // defined(OS_WIN) |
234 { L"http://foo.com/", AutocompleteInput::URL }, | 234 { L"http://foo.com/", AutocompleteInput::URL }, |
235 { L"127.0.0.1", AutocompleteInput::URL }, | 235 { L"127.0.0.1", AutocompleteInput::URL }, |
236 { L"127.0.1", AutocompleteInput::UNKNOWN }, | 236 { L"127.0.1", AutocompleteInput::UNKNOWN }, |
237 { L"127.0.1/", AutocompleteInput::UNKNOWN }, | 237 { L"127.0.1/", AutocompleteInput::UNKNOWN }, |
238 { L"browser.tabs.closeButtons", AutocompleteInput::UNKNOWN }, | 238 { L"browser.tabs.closeButtons", AutocompleteInput::UNKNOWN }, |
239 { L"\u6d4b\u8bd5", AutocompleteInput::UNKNOWN }, | 239 { L"\u6d4b\u8bd5", AutocompleteInput::UNKNOWN }, |
240 { L"[2001:]", AutocompleteInput::QUERY }, // Not a valid IP | 240 { L"[2001:]", AutocompleteInput::QUERY }, // Not a valid IP |
241 { L"[2001:dB8::1]", AutocompleteInput::URL }, | 241 { L"[2001:dB8::1]", AutocompleteInput::URL }, |
| 242 { L"192.168.0.256", AutocompleteInput::QUERY }, // Invalid IPv4 literal. |
| 243 { L"[foo.com]", AutocompleteInput::QUERY }, // Invalid IPv6 literal. |
242 }; | 244 }; |
243 | 245 |
244 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(input_cases); ++i) { | 246 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(input_cases); ++i) { |
245 AutocompleteInput input(input_cases[i].input, std::wstring(), true, false, | 247 AutocompleteInput input(input_cases[i].input, std::wstring(), true, false, |
246 false); | 248 false); |
247 EXPECT_EQ(input_cases[i].type, input.type()) << "Input: " << | 249 EXPECT_EQ(input_cases[i].type, input.type()) << "Input: " << |
248 input_cases[i].input; | 250 input_cases[i].input; |
249 } | 251 } |
250 } | 252 } |
251 | 253 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 EXPECT_EQ(input_cases[i].scheme.len, scheme.len) << "Input: " << | 323 EXPECT_EQ(input_cases[i].scheme.len, scheme.len) << "Input: " << |
322 input_cases[i].input; | 324 input_cases[i].input; |
323 EXPECT_EQ(input_cases[i].host.begin, host.begin) << "Input: " << | 325 EXPECT_EQ(input_cases[i].host.begin, host.begin) << "Input: " << |
324 input_cases[i].input; | 326 input_cases[i].input; |
325 EXPECT_EQ(input_cases[i].host.len, host.len) << "Input: " << | 327 EXPECT_EQ(input_cases[i].host.len, host.len) << "Input: " << |
326 input_cases[i].input; | 328 input_cases[i].input; |
327 } | 329 } |
328 } | 330 } |
329 | 331 |
330 } // namespace | 332 } // namespace |
OLD | NEW |