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

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

Issue 7822009: Fix crash in CanFindIntranetURL() due to FixupUserInput() changing the AutocompleteInput's text_ ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/autocomplete/history_url_provider.cc ('k') | no next file » | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/file_util.h" 5 #include "base/file_util.h"
6 #include "base/message_loop.h" 6 #include "base/message_loop.h"
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/autocomplete/autocomplete_match.h" 10 #include "chrome/browser/autocomplete/autocomplete_match.h"
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 }; 533 };
534 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) { 534 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) {
535 const std::string output[1] = { 535 const std::string output[1] = {
536 URLFixerUpper::FixupURL(test_cases[i].input, std::string()).spec() 536 URLFixerUpper::FixupURL(test_cases[i].input, std::string()).spec()
537 }; 537 };
538 RunTest(ASCIIToUTF16(test_cases[i].input), string16(), false, 538 RunTest(ASCIIToUTF16(test_cases[i].input), string16(), false,
539 test_cases[i].has_output ? output : NULL, 539 test_cases[i].has_output ? output : NULL,
540 test_cases[i].has_output ? 1 : 0); 540 test_cases[i].has_output ? 1 : 0);
541 } 541 }
542 } 542 }
543
544 TEST_F(HistoryURLProviderTest, CrashDueToFixup) {
545 // This test passes if we don't crash. The results don't matter.
546 const char* const test_cases[] = {
547 "//c",
548 "\\@st"
549 };
550 for (size_t i = 0; i < arraysize(test_cases); ++i) {
551 AutocompleteInput input(ASCIIToUTF16(test_cases[i]), string16(), false,
552 false, true, AutocompleteInput::ALL_MATCHES);
553 autocomplete_->Start(input, false);
554 if (!autocomplete_->done())
555 MessageLoop::current()->Run();
556 }
557 }
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/history_url_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698