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/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.h" | 8 #include "chrome/browser/autocomplete/autocomplete_edit.h" |
9 #include "chrome/browser/content_settings/host_content_settings_map.h" | 9 #include "chrome/browser/content_settings/host_content_settings_map.h" |
10 #include "chrome/browser/instant/instant_controller.h" | 10 #include "chrome/browser/instant/instant_controller.h" |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
332 | 332 |
333 ASSERT_EQ(ASCIIToUTF16("defghi"), location_bar_->location_entry()->GetText()); | 333 ASSERT_EQ(ASCIIToUTF16("defghi"), location_bar_->location_entry()->GetText()); |
334 | 334 |
335 // Make sure the url that will get committed when we press enter matches that | 335 // Make sure the url that will get committed when we press enter matches that |
336 // of the default search provider. | 336 // of the default search provider. |
337 const TemplateURL* default_turl = | 337 const TemplateURL* default_turl = |
338 TemplateURLServiceFactory::GetForProfile(browser()->profile())-> | 338 TemplateURLServiceFactory::GetForProfile(browser()->profile())-> |
339 GetDefaultSearchProvider(); | 339 GetDefaultSearchProvider(); |
340 ASSERT_TRUE(default_turl); | 340 ASSERT_TRUE(default_turl); |
341 ASSERT_TRUE(default_turl->url()); | 341 ASSERT_TRUE(default_turl->url()); |
342 EXPECT_EQ(default_turl->url()->ReplaceSearchTerms( | 342 EXPECT_EQ(default_turl->url()->ReplaceSearchTerms(browser()->profile(), |
Peter Kasting
2011/08/11 00:35:17
I tried to trace through the call chain (for GetCu
| |
343 *default_turl, ASCIIToUTF16("defghi"), 0, string16()), | 343 *default_turl, ASCIIToUTF16("defghi"), 0, string16()), |
344 browser()->instant()->GetCurrentURL().spec()); | 344 browser()->instant()->GetCurrentURL().spec()); |
345 | 345 |
346 // Check that the value is reflected and onchange is called. | 346 // Check that the value is reflected and onchange is called. |
347 EXPECT_EQ("true 0 0 1 1 d false def false 3 3", | 347 EXPECT_EQ("true 0 0 1 1 d false def false 3 3", |
348 GetSearchStateAsString(preview_, true)); | 348 GetSearchStateAsString(preview_, true)); |
349 } | 349 } |
350 | 350 |
351 // DISABLED http://crbug.com/80118 | 351 // DISABLED http://crbug.com/80118 |
352 #if defined(OS_LINUX) | 352 #if defined(OS_LINUX) |
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
947 ui_test_utils::NavigateToURL( | 947 ui_test_utils::NavigateToURL( |
948 browser(), | 948 browser(), |
949 GURL(test_server()->GetURL("files/instant/empty.html"))); | 949 GURL(test_server()->GetURL("files/instant/empty.html"))); |
950 bool result; | 950 bool result; |
951 ASSERT_TRUE(GetBoolFromJavascript( | 951 ASSERT_TRUE(GetBoolFromJavascript( |
952 browser()->GetSelectedTabContents(), | 952 browser()->GetSelectedTabContents(), |
953 "window.chrome.searchBox.value.length == 0", | 953 "window.chrome.searchBox.value.length == 0", |
954 &result)); | 954 &result)); |
955 EXPECT_TRUE(result); | 955 EXPECT_TRUE(result); |
956 } | 956 } |
OLD | NEW |