| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/autocomplete/builtin_provider.h" | 5 #include "chrome/browser/autocomplete/builtin_provider.h" |
| 6 | 6 |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/autocomplete/autocomplete_input.h" | 9 #include "chrome/browser/autocomplete/autocomplete_input.h" |
| 10 #include "chrome/browser/autocomplete/autocomplete_match.h" | 10 #include "chrome/browser/autocomplete/autocomplete_match.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 | 137 |
| 138 TEST_F(BuiltinProviderTest, ChromeURLs) { | 138 TEST_F(BuiltinProviderTest, ChromeURLs) { |
| 139 const string16 kAbout = ASCIIToUTF16(chrome::kAboutScheme); | 139 const string16 kAbout = ASCIIToUTF16(chrome::kAboutScheme); |
| 140 const string16 kChrome = ASCIIToUTF16(chrome::kChromeUIScheme); | 140 const string16 kChrome = ASCIIToUTF16(chrome::kChromeUIScheme); |
| 141 const string16 kSeparator1 = ASCIIToUTF16(":"); | 141 const string16 kSeparator1 = ASCIIToUTF16(":"); |
| 142 const string16 kSeparator2 = ASCIIToUTF16(":/"); | 142 const string16 kSeparator2 = ASCIIToUTF16(":/"); |
| 143 const string16 kSeparator3 = ASCIIToUTF16(content::kStandardSchemeSeparator); | 143 const string16 kSeparator3 = ASCIIToUTF16(content::kStandardSchemeSeparator); |
| 144 | 144 |
| 145 // This makes assumptions about the chrome URLs listed by the BuiltinProvider. | 145 // This makes assumptions about the chrome URLs listed by the BuiltinProvider. |
| 146 // Currently they are derived from ChromePaths() in browser_about_handler.cc. | 146 // Currently they are derived from ChromePaths() in browser_about_handler.cc. |
| 147 const string16 kHostM1 = ASCIIToUTF16(chrome::kChromeUIMediaInternalsHost); | 147 const string16 kHostM1 = ASCIIToUTF16(content::kChromeUIMediaInternalsHost); |
| 148 const string16 kHostM2 = ASCIIToUTF16(chrome::kChromeUIMemoryHost); | 148 const string16 kHostM2 = ASCIIToUTF16(chrome::kChromeUIMemoryHost); |
| 149 const GURL kURLM1 = GURL(kChrome + kSeparator3 + kHostM1); | 149 const GURL kURLM1 = GURL(kChrome + kSeparator3 + kHostM1); |
| 150 const GURL kURLM2 = GURL(kChrome + kSeparator3 + kHostM2); | 150 const GURL kURLM2 = GURL(kChrome + kSeparator3 + kHostM2); |
| 151 | 151 |
| 152 test_data<GURL> chrome_url_cases[] = { | 152 test_data<GURL> chrome_url_cases[] = { |
| 153 // Typing an about URL with an unknown host should give nothing. | 153 // Typing an about URL with an unknown host should give nothing. |
| 154 {kAbout + kSeparator1 + ASCIIToUTF16("host"), 0, {}}, | 154 {kAbout + kSeparator1 + ASCIIToUTF16("host"), 0, {}}, |
| 155 {kAbout + kSeparator2 + ASCIIToUTF16("host"), 0, {}}, | 155 {kAbout + kSeparator2 + ASCIIToUTF16("host"), 0, {}}, |
| 156 {kAbout + kSeparator3 + ASCIIToUTF16("host"), 0, {}}, | 156 {kAbout + kSeparator3 + ASCIIToUTF16("host"), 0, {}}, |
| 157 | 157 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 {kSettings + kPage1.substr(0, 2), 1, {kURL1}}, | 205 {kSettings + kPage1.substr(0, 2), 1, {kURL1}}, |
| 206 {kSettings + kPage1.substr(0, kPage1.length() - 1), 1, {kURL1}}, | 206 {kSettings + kPage1.substr(0, kPage1.length() - 1), 1, {kURL1}}, |
| 207 {kSettings + kPage1, 1, {kURL1}}, | 207 {kSettings + kPage1, 1, {kURL1}}, |
| 208 {kSettings + kPage2, 1, {kURL2}}, | 208 {kSettings + kPage2, 1, {kURL2}}, |
| 209 }; | 209 }; |
| 210 | 210 |
| 211 RunTest<GURL>(settings_subpage_cases, arraysize(settings_subpage_cases), | 211 RunTest<GURL>(settings_subpage_cases, arraysize(settings_subpage_cases), |
| 212 &AutocompleteMatch::destination_url); | 212 &AutocompleteMatch::destination_url); |
| 213 } | 213 } |
| 214 #endif | 214 #endif |
| OLD | NEW |