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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/string_util.h" | 6 #include "base/string_util.h" |
7 #include "base/stringprintf.h" | 7 #include "base/stringprintf.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/autocomplete/autocomplete_edit.h" | 9 #include "chrome/browser/autocomplete/autocomplete_edit.h" |
10 #include "chrome/browser/content_settings/host_content_settings_map.h" | 10 #include "chrome/browser/content_settings/host_content_settings_map.h" |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 EXPECT_TRUE(instant()->is_displayable()); | 282 EXPECT_TRUE(instant()->is_displayable()); |
283 EXPECT_TRUE(instant()->IsCurrent()); | 283 EXPECT_TRUE(instant()->IsCurrent()); |
284 EXPECT_EQ("defghi", UTF16ToUTF8(omnibox()->GetText())); | 284 EXPECT_EQ("defghi", UTF16ToUTF8(omnibox()->GetText())); |
285 | 285 |
286 // Make sure the URL that will get committed when we press <Enter> matches | 286 // Make sure the URL that will get committed when we press <Enter> matches |
287 // that of the default search provider. | 287 // that of the default search provider. |
288 const TemplateURL* default_turl = | 288 const TemplateURL* default_turl = |
289 TemplateURLServiceFactory::GetForProfile(browser()->profile())-> | 289 TemplateURLServiceFactory::GetForProfile(browser()->profile())-> |
290 GetDefaultSearchProvider(); | 290 GetDefaultSearchProvider(); |
291 EXPECT_TRUE(default_turl); | 291 EXPECT_TRUE(default_turl); |
292 EXPECT_EQ(default_turl->url_ref().ReplaceSearchTerms(ASCIIToUTF16("defghi"), | 292 EXPECT_EQ(default_turl->url_ref().ReplaceSearchTerms( |
293 TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, string16()), | 293 TemplateURLRef::SearchTermsArgs(ASCIIToUTF16("defghi"))), |
294 loader()->url().spec()); | 294 loader()->url().spec()); |
295 | 295 |
296 // Check that the value is reflected and onchange is called. | 296 // Check that the value is reflected and onchange is called. |
297 EXPECT_EQ("true 0 0 1 true d false def false 3 3", | 297 EXPECT_EQ("true 0 0 1 true d false def false 3 3", |
298 GetSearchStateAsString(preview()->web_contents(), false)); | 298 GetSearchStateAsString(preview()->web_contents(), false)); |
299 } | 299 } |
300 | 300 |
301 // Verify that the onsubmit event is dispatched upon pressing <Enter>. | 301 // Verify that the onsubmit event is dispatched upon pressing <Enter>. |
302 IN_PROC_BROWSER_TEST_F(InstantTest, MAYBE(OnSubmitEvent)) { | 302 IN_PROC_BROWSER_TEST_F(InstantTest, MAYBE(OnSubmitEvent)) { |
303 ASSERT_TRUE(test_server()->Start()); | 303 ASSERT_TRUE(test_server()->Start()); |
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
835 DetermineInstantSupport(); | 835 DetermineInstantSupport(); |
836 SearchAndWaitForPreviewToShow(); | 836 SearchAndWaitForPreviewToShow(); |
837 | 837 |
838 // Now there should be three rows, the third being the instant preview. | 838 // Now there should be three rows, the third being the instant preview. |
839 TaskManagerBrowserTestUtil::WaitForResourceChange(3); | 839 TaskManagerBrowserTestUtil::WaitForResourceChange(3); |
840 string16 prefix = l10n_util::GetStringFUTF16( | 840 string16 prefix = l10n_util::GetStringFUTF16( |
841 IDS_TASK_MANAGER_INSTANT_PREVIEW_PREFIX, string16()); | 841 IDS_TASK_MANAGER_INSTANT_PREVIEW_PREFIX, string16()); |
842 string16 title = task_manager->GetResourceTitle(2); | 842 string16 title = task_manager->GetResourceTitle(2); |
843 EXPECT_TRUE(StartsWith(title, prefix, true)) << title << " vs " << prefix; | 843 EXPECT_TRUE(StartsWith(title, prefix, true)) << title << " vs " << prefix; |
844 } | 844 } |
OLD | NEW |