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

Side by Side Diff: chrome/browser/ui/toolbar/toolbar_model_unittest.cc

Issue 816403003: 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
« no previous file with comments | « chrome/browser/ui/tab_helpers.cc ('k') | chrome/browser/ui/toolbar/wrench_menu_model.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/ui/toolbar/toolbar_model.h" 5 #include "chrome/browser/ui/toolbar/toolbar_model.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/field_trial.h" 8 #include "base/metrics/field_trial.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h" 10 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h"
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 // HTTP, we should not extract search terms. 357 // HTTP, we should not extract search terms.
358 UIThreadSearchTermsData::SetGoogleBaseURL("http://www.foo.com/"); 358 UIThreadSearchTermsData::SetGoogleBaseURL("http://www.foo.com/");
359 NavigateAndCheckText( 359 NavigateAndCheckText(
360 GURL("http://www.foo.com/search?q=tractor+supply&espv=1"), 360 GURL("http://www.foo.com/search?q=tractor+supply&espv=1"),
361 base::ASCIIToUTF16("www.foo.com/search?q=tractor+supply&espv=1"), false, 361 base::ASCIIToUTF16("www.foo.com/search?q=tractor+supply&espv=1"), false,
362 true); 362 true);
363 363
364 // The same URL, when specified on the command line, should allow search term 364 // The same URL, when specified on the command line, should allow search term
365 // extraction. 365 // extraction.
366 UIThreadSearchTermsData::SetGoogleBaseURL(std::string()); 366 UIThreadSearchTermsData::SetGoogleBaseURL(std::string());
367 CommandLine::ForCurrentProcess()->AppendSwitchASCII(switches::kGoogleBaseURL, 367 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
368 "http://www.foo.com/"); 368 switches::kGoogleBaseURL, "http://www.foo.com/");
369 NavigateAndCheckText( 369 NavigateAndCheckText(
370 GURL("http://www.foo.com/search?q=tractor+supply&espv=1"), 370 GURL("http://www.foo.com/search?q=tractor+supply&espv=1"),
371 base::ASCIIToUTF16("tractor supply"), true, true); 371 base::ASCIIToUTF16("tractor supply"), true, true);
372 } 372 }
373 373
374 // Popup windows don't have an origin chip, so test that URL display in a popup 374 // Popup windows don't have an origin chip, so test that URL display in a popup
375 // ignores whether the origin chip is enabled and only respects the query 375 // ignores whether the origin chip is enabled and only respects the query
376 // extraction flag. 376 // extraction flag.
377 TEST_F(PopupToolbarModelTest, ShouldDisplayURL) { 377 TEST_F(PopupToolbarModelTest, ShouldDisplayURL) {
378 AddTab(browser(), GURL(url::kAboutBlankURL)); 378 AddTab(browser(), GURL(url::kAboutBlankURL));
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 413
414 // Disabling URL replacement should reset to only showing URLs. 414 // Disabling URL replacement should reset to only showing URLs.
415 browser()->toolbar_model()->set_url_replacement_enabled(false); 415 browser()->toolbar_model()->set_url_replacement_enabled(false);
416 for (size_t i = 0; i < arraysize(test_items); ++i) { 416 for (size_t i = 0; i < arraysize(test_items); ++i) {
417 const TestItem& test_item = test_items[i]; 417 const TestItem& test_item = test_items[i];
418 NavigateAndCheckText(test_item.url, 418 NavigateAndCheckText(test_item.url,
419 test_item.expected_text_url_replacement_inactive, 419 test_item.expected_text_url_replacement_inactive,
420 false, test_item.should_display_url); 420 false, test_item.should_display_url);
421 } 421 }
422 } 422 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/tab_helpers.cc ('k') | chrome/browser/ui/toolbar/wrench_menu_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698