OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/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_edit_view.h" | 8 #include "chrome/browser/autocomplete/autocomplete_edit_view.h" |
9 #include "chrome/browser/browser_list.h" | 9 #include "chrome/browser/browser_list.h" |
10 #include "chrome/browser/browser_window.h" | 10 #include "chrome/browser/browser_window.h" |
11 #include "chrome/browser/instant/instant_controller.h" | 11 #include "chrome/browser/instant/instant_controller.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 // TemplateURLModel takes ownership of this. | 51 // TemplateURLModel takes ownership of this. |
52 TemplateURL* template_url = new TemplateURL(); | 52 TemplateURL* template_url = new TemplateURL(); |
53 | 53 |
54 std::string url = StringPrintf( | 54 std::string url = StringPrintf( |
55 "http://%s:%d/files/instant/%s?q={searchTerms}", | 55 "http://%s:%d/files/instant/%s?q={searchTerms}", |
56 test_server()->host_port_pair().host().c_str(), | 56 test_server()->host_port_pair().host().c_str(), |
57 test_server()->host_port_pair().port(), | 57 test_server()->host_port_pair().port(), |
58 page.c_str()); | 58 page.c_str()); |
59 template_url->SetURL(url, 0, 0); | 59 template_url->SetURL(url, 0, 0); |
60 template_url->SetInstantURL(url, 0, 0); | 60 template_url->SetInstantURL(url, 0, 0); |
61 template_url->set_keyword(ASCIIToUTF16("foo")); | 61 template_url->set_keyword(UTF8ToWide("foo")); |
62 template_url->set_short_name(ASCIIToUTF16("foo")); | 62 template_url->set_short_name(UTF8ToWide("foo")); |
63 | 63 |
64 model->Add(template_url); | 64 model->Add(template_url); |
65 model->SetDefaultSearchProvider(template_url); | 65 model->SetDefaultSearchProvider(template_url); |
66 } | 66 } |
67 | 67 |
68 void FindLocationBar() { | 68 void FindLocationBar() { |
69 if (location_bar_) | 69 if (location_bar_) |
70 return; | 70 return; |
71 location_bar_ = browser()->window()->GetLocationBar(); | 71 location_bar_ = browser()->window()->GetLocationBar(); |
72 ASSERT_TRUE(location_bar_); | 72 ASSERT_TRUE(location_bar_); |
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 // Check that the preview contents have been committed. | 647 // Check that the preview contents have been committed. |
648 ASSERT_FALSE(browser()->instant()->GetPreviewContents()); | 648 ASSERT_FALSE(browser()->instant()->GetPreviewContents()); |
649 ASSERT_FALSE(browser()->instant()->is_active()); | 649 ASSERT_FALSE(browser()->instant()->is_active()); |
650 TabContents* contents = browser()->GetSelectedTabContents(); | 650 TabContents* contents = browser()->GetSelectedTabContents(); |
651 ASSERT_TRUE(contents); | 651 ASSERT_TRUE(contents); |
652 | 652 |
653 // Check that the value is reflected and onsubmit is called. | 653 // Check that the value is reflected and onsubmit is called. |
654 EXPECT_EQ("true 1 0 2 2 a false abcdef true", | 654 EXPECT_EQ("true 1 0 2 2 a false abcdef true", |
655 GetSearchStateAsString(preview_)); | 655 GetSearchStateAsString(preview_)); |
656 } | 656 } |
OLD | NEW |