| 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/string_util.h" | 5 #include "base/string_util.h" |
| 6 #include "base/stringprintf.h" | 6 #include "base/stringprintf.h" |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/autocomplete/autocomplete.h" | 8 #include "chrome/browser/autocomplete/autocomplete.h" |
| 9 #include "chrome/browser/autocomplete/autocomplete_edit.h" | 9 #include "chrome/browser/autocomplete/autocomplete_edit.h" |
| 10 #include "chrome/browser/autocomplete/autocomplete_edit_view.h" | 10 #include "chrome/browser/autocomplete/autocomplete_edit_view.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // http://crbug.com/52929 | 25 // http://crbug.com/52929 |
| 26 #if defined(OS_CHROMEOS) | 26 #if defined(OS_CHROMEOS) |
| 27 #define MAYBE_Basic FLAKY_Basic | 27 #define MAYBE_Basic FLAKY_Basic |
| 28 #else | 28 #else |
| 29 #define MAYBE_Basic Basic | 29 #define MAYBE_Basic Basic |
| 30 #endif | 30 #endif |
| 31 | 31 |
| 32 namespace { | 32 namespace { |
| 33 | 33 |
| 34 string16 AutocompleteResultAsString(const AutocompleteResult& result) { | 34 string16 AutocompleteResultAsString(const AutocompleteResult& result) { |
| 35 std::string output(base::StringPrintf("{%z} ", result.size())); | 35 std::string output(base::StringPrintf("{%lu} ", result.size())); |
| 36 for (size_t i = 0; i < result.size(); ++i) { | 36 for (size_t i = 0; i < result.size(); ++i) { |
| 37 AutocompleteMatch match = result.match_at(i); | 37 AutocompleteMatch match = result.match_at(i); |
| 38 std::string provider_name = match.provider->name(); | 38 std::string provider_name = match.provider->name(); |
| 39 output.append(base::StringPrintf("[\"%s\" by \"%s\"] ", | 39 output.append(base::StringPrintf("[\"%s\" by \"%s\"] ", |
| 40 UTF16ToUTF8(match.contents).c_str(), | 40 UTF16ToUTF8(match.contents).c_str(), |
| 41 provider_name.c_str())); | 41 provider_name.c_str())); |
| 42 } | 42 } |
| 43 return UTF8ToUTF16(output); | 43 return UTF8ToUTF16(output); |
| 44 } | 44 } |
| 45 | 45 |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 } | 176 } |
| 177 | 177 |
| 178 { | 178 { |
| 179 ResultCatcher catcher; | 179 ResultCatcher catcher; |
| 180 autocomplete_controller->Start(ASCIIToUTF16("keyword command"), string16(), | 180 autocomplete_controller->Start(ASCIIToUTF16("keyword command"), string16(), |
| 181 true, false, true, false); | 181 true, false, true, false); |
| 182 location_bar->AcceptInput(); | 182 location_bar->AcceptInput(); |
| 183 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); | 183 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
| 184 } | 184 } |
| 185 } | 185 } |
| OLD | NEW |