Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: chrome/browser/autocomplete/autocomplete_unittest.cc

Issue 66010: Merge 13388 - Properly handle empty components when converting url_parse::Par... (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/branches/172/src/
Patch Set: Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/net/url_fixer_upper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 // { L"mailto:abuse@foo.com", AutocompleteInput::URL }, 227 // { L"mailto:abuse@foo.com", AutocompleteInput::URL },
228 { L"view-source:http://www.foo.com/", AutocompleteInput::URL }, 228 { L"view-source:http://www.foo.com/", AutocompleteInput::URL },
229 { L"javascript:alert(\"Hey there!\");", AutocompleteInput::URL }, 229 { L"javascript:alert(\"Hey there!\");", AutocompleteInput::URL },
230 #if defined(OS_WIN) 230 #if defined(OS_WIN)
231 { L"C:\\Program Files", AutocompleteInput::URL }, 231 { L"C:\\Program Files", AutocompleteInput::URL },
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"browser.tabs.closeButtons", AutocompleteInput::UNKNOWN }, 236 { L"browser.tabs.closeButtons", AutocompleteInput::UNKNOWN },
237 { L"\u6d4b\u8bd5", AutocompleteInput::UNKNOWN },
237 }; 238 };
238 239
239 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(input_cases); ++i) { 240 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(input_cases); ++i) {
240 AutocompleteInput input(input_cases[i].input, std::wstring(), true, false, 241 AutocompleteInput input(input_cases[i].input, std::wstring(), true, false,
241 false); 242 false);
242 EXPECT_EQ(input_cases[i].type, input.type()) << "Input: " << 243 EXPECT_EQ(input_cases[i].type, input.type()) << "Input: " <<
243 input_cases[i].input; 244 input_cases[i].input;
244 } 245 }
245 } 246 }
246 247
(...skipping 24 matching lines...) Expand all
271 272
272 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(cases); ++i) { 273 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(cases); ++i) {
273 m1.relevance = cases[i].r1; 274 m1.relevance = cases[i].r1;
274 m2.relevance = cases[i].r2; 275 m2.relevance = cases[i].r2;
275 EXPECT_EQ(cases[i].expected_result, 276 EXPECT_EQ(cases[i].expected_result,
276 AutocompleteMatch::MoreRelevant(m1, m2)); 277 AutocompleteMatch::MoreRelevant(m1, m2));
277 } 278 }
278 } 279 }
279 280
280 } // namespace 281 } // namespace
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/net/url_fixer_upper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698