OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |