Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(442)

Side by Side Diff: chrome/browser/autocomplete/autocomplete_provider_unittest.cc

Issue 819133004: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/autocomplete_browsertest.cc ('k') | chrome/browser/autocomplete/search_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698