| 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/autocomplete_provider.h" | 5 #include "chrome/browser/autocomplete/autocomplete_provider.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 controller_->result().default_match()->type); | 445 controller_->result().default_match()->type); |
| 446 } | 446 } |
| 447 | 447 |
| 448 void AutocompleteProviderTest::CopyResults() { | 448 void AutocompleteProviderTest::CopyResults() { |
| 449 result_.CopyFrom(controller_->result()); | 449 result_.CopyFrom(controller_->result()); |
| 450 } | 450 } |
| 451 | 451 |
| 452 GURL AutocompleteProviderTest::GetDestinationURL( | 452 GURL AutocompleteProviderTest::GetDestinationURL( |
| 453 AutocompleteMatch match, | 453 AutocompleteMatch match, |
| 454 base::TimeDelta query_formulation_time) const { | 454 base::TimeDelta query_formulation_time) const { |
| 455 controller_->UpdateMatchDestinationURL(query_formulation_time, &match); | 455 controller_->UpdateMatchDestinationURLWithQueryFormulationTime( |
| 456 query_formulation_time, &match); |
| 456 return match.destination_url; | 457 return match.destination_url; |
| 457 } | 458 } |
| 458 | 459 |
| 459 void AutocompleteProviderTest::Observe( | 460 void AutocompleteProviderTest::Observe( |
| 460 int type, | 461 int type, |
| 461 const content::NotificationSource& source, | 462 const content::NotificationSource& source, |
| 462 const content::NotificationDetails& details) { | 463 const content::NotificationDetails& details) { |
| 463 if (controller_->done()) { | 464 if (controller_->done()) { |
| 464 CopyResults(); | 465 CopyResults(); |
| 465 base::MessageLoop::current()->Quit(); | 466 base::MessageLoop::current()->Quit(); |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 url = GetDestinationURL(match, base::TimeDelta::FromMilliseconds(2456)); | 669 url = GetDestinationURL(match, base::TimeDelta::FromMilliseconds(2456)); |
| 669 EXPECT_EQ("//aqs=chrome.0.69i57j69i58j5l2j0l3j69i59.2456j0j4&", url.path()); | 670 EXPECT_EQ("//aqs=chrome.0.69i57j69i58j5l2j0l3j69i59.2456j0j4&", url.path()); |
| 670 | 671 |
| 671 // Test page classification and field trial triggered set. | 672 // Test page classification and field trial triggered set. |
| 672 controller_->search_provider_->field_trial_triggered_in_session_ = true; | 673 controller_->search_provider_->field_trial_triggered_in_session_ = true; |
| 673 EXPECT_TRUE( | 674 EXPECT_TRUE( |
| 674 controller_->search_provider_->field_trial_triggered_in_session()); | 675 controller_->search_provider_->field_trial_triggered_in_session()); |
| 675 url = GetDestinationURL(match, base::TimeDelta::FromMilliseconds(2456)); | 676 url = GetDestinationURL(match, base::TimeDelta::FromMilliseconds(2456)); |
| 676 EXPECT_EQ("//aqs=chrome.0.69i57j69i58j5l2j0l3j69i59.2456j1j4&", url.path()); | 677 EXPECT_EQ("//aqs=chrome.0.69i57j69i58j5l2j0l3j69i59.2456j1j4&", url.path()); |
| 677 } | 678 } |
| OLD | NEW |