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/autocomplete_provider.h" | 5 #include "components/omnibox/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 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 TEST_F(AutocompleteProviderTest, AllowExactKeywordMatch) { | 538 TEST_F(AutocompleteProviderTest, AllowExactKeywordMatch) { |
539 ResetControllerWithKeywordAndSearchProviders(); | 539 ResetControllerWithKeywordAndSearchProviders(); |
540 RunExactKeymatchTest(true); | 540 RunExactKeymatchTest(true); |
541 RunExactKeymatchTest(false); | 541 RunExactKeymatchTest(false); |
542 } | 542 } |
543 | 543 |
544 // Ensures matches from (only) the default search provider respect any extra | 544 // Ensures matches from (only) the default search provider respect any extra |
545 // query params set on the command line. | 545 // query params set on the command line. |
546 TEST_F(AutocompleteProviderTest, ExtraQueryParams) { | 546 TEST_F(AutocompleteProviderTest, ExtraQueryParams) { |
547 ResetControllerWithKeywordAndSearchProviders(); | 547 ResetControllerWithKeywordAndSearchProviders(); |
548 CommandLine::ForCurrentProcess()->AppendSwitchASCII( | 548 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( |
549 switches::kExtraSearchQueryParams, "a=b"); | 549 switches::kExtraSearchQueryParams, "a=b"); |
550 RunExactKeymatchTest(true); | 550 RunExactKeymatchTest(true); |
551 CopyResults(); | 551 CopyResults(); |
552 ASSERT_EQ(2U, result_.size()); | 552 ASSERT_EQ(2U, result_.size()); |
553 EXPECT_EQ("http://keyword/test", | 553 EXPECT_EQ("http://keyword/test", |
554 result_.match_at(0)->destination_url.possibly_invalid_spec()); | 554 result_.match_at(0)->destination_url.possibly_invalid_spec()); |
555 EXPECT_EQ("http://defaultturl/k%20test?a=b", | 555 EXPECT_EQ("http://defaultturl/k%20test?a=b", |
556 result_.match_at(1)->destination_url.possibly_invalid_spec()); | 556 result_.match_at(1)->destination_url.possibly_invalid_spec()); |
557 } | 557 } |
558 | 558 |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
727 url = GetDestinationURL(match, base::TimeDelta::FromMilliseconds(2456)); | 727 url = GetDestinationURL(match, base::TimeDelta::FromMilliseconds(2456)); |
728 EXPECT_EQ("//aqs=chrome.0.69i57j69i58j5l2j0l3j69i59.2456j0j4&", url.path()); | 728 EXPECT_EQ("//aqs=chrome.0.69i57j69i58j5l2j0l3j69i59.2456j0j4&", url.path()); |
729 | 729 |
730 // Test page classification and field trial triggered set. | 730 // Test page classification and field trial triggered set. |
731 controller_->search_provider_->field_trial_triggered_in_session_ = true; | 731 controller_->search_provider_->field_trial_triggered_in_session_ = true; |
732 EXPECT_TRUE( | 732 EXPECT_TRUE( |
733 controller_->search_provider_->field_trial_triggered_in_session()); | 733 controller_->search_provider_->field_trial_triggered_in_session()); |
734 url = GetDestinationURL(match, base::TimeDelta::FromMilliseconds(2456)); | 734 url = GetDestinationURL(match, base::TimeDelta::FromMilliseconds(2456)); |
735 EXPECT_EQ("//aqs=chrome.0.69i57j69i58j5l2j0l3j69i59.2456j1j4&", url.path()); | 735 EXPECT_EQ("//aqs=chrome.0.69i57j69i58j5l2j0l3j69i59.2456j1j4&", url.path()); |
736 } | 736 } |
OLD | NEW |