| 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 "components/omnibox/browser/autocomplete_provider.h" | 5 #include "components/omnibox/browser/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/location.h" | 9 #include "base/location.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 query_formulation_time, &match); | 500 query_formulation_time, &match); |
| 501 return match.destination_url; | 501 return match.destination_url; |
| 502 } | 502 } |
| 503 | 503 |
| 504 void AutocompleteProviderTest::Observe( | 504 void AutocompleteProviderTest::Observe( |
| 505 int type, | 505 int type, |
| 506 const content::NotificationSource& source, | 506 const content::NotificationSource& source, |
| 507 const content::NotificationDetails& details) { | 507 const content::NotificationDetails& details) { |
| 508 if (controller_->done()) { | 508 if (controller_->done()) { |
| 509 CopyResults(); | 509 CopyResults(); |
| 510 base::MessageLoop::current()->Quit(); | 510 base::MessageLoop::current()->QuitWhenIdle(); |
| 511 } | 511 } |
| 512 } | 512 } |
| 513 | 513 |
| 514 // Tests that the default selection is set properly when updating results. | 514 // Tests that the default selection is set properly when updating results. |
| 515 TEST_F(AutocompleteProviderTest, Query) { | 515 TEST_F(AutocompleteProviderTest, Query) { |
| 516 TestProvider* provider1 = NULL; | 516 TestProvider* provider1 = NULL; |
| 517 TestProvider* provider2 = NULL; | 517 TestProvider* provider2 = NULL; |
| 518 ResetControllerWithTestProviders(false, &provider1, &provider2); | 518 ResetControllerWithTestProviders(false, &provider1, &provider2); |
| 519 RunTest(); | 519 RunTest(); |
| 520 | 520 |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 747 EXPECT_FALSE(search_provider_field_trial_triggered_in_session()); | 747 EXPECT_FALSE(search_provider_field_trial_triggered_in_session()); |
| 748 url = GetDestinationURL(match, base::TimeDelta::FromMilliseconds(2456)); | 748 url = GetDestinationURL(match, base::TimeDelta::FromMilliseconds(2456)); |
| 749 EXPECT_EQ("//aqs=chrome.0.69i57j69i58j5l2j0l3j69i59.2456j0j4&", url.path()); | 749 EXPECT_EQ("//aqs=chrome.0.69i57j69i58j5l2j0l3j69i59.2456j0j4&", url.path()); |
| 750 | 750 |
| 751 // Test page classification and field trial triggered set. | 751 // Test page classification and field trial triggered set. |
| 752 set_search_provider_field_trial_triggered_in_session(true); | 752 set_search_provider_field_trial_triggered_in_session(true); |
| 753 EXPECT_TRUE(search_provider_field_trial_triggered_in_session()); | 753 EXPECT_TRUE(search_provider_field_trial_triggered_in_session()); |
| 754 url = GetDestinationURL(match, base::TimeDelta::FromMilliseconds(2456)); | 754 url = GetDestinationURL(match, base::TimeDelta::FromMilliseconds(2456)); |
| 755 EXPECT_EQ("//aqs=chrome.0.69i57j69i58j5l2j0l3j69i59.2456j1j4&", url.path()); | 755 EXPECT_EQ("//aqs=chrome.0.69i57j69i58j5l2j0l3j69i59.2456j1j4&", url.path()); |
| 756 } | 756 } |
| OLD | NEW |