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

Unified Diff: chrome/browser/ui/toolbar/toolbar_model_unittest.cc

Issue 731423002: Remove OriginChip code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix gyp file and bad merge Created 5 years, 10 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/toolbar/toolbar_model_impl.cc ('k') | chrome/browser/ui/views/frame/browser_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/toolbar/toolbar_model_unittest.cc
diff --git a/chrome/browser/ui/toolbar/toolbar_model_unittest.cc b/chrome/browser/ui/toolbar/toolbar_model_unittest.cc
index 1dc0ac2a5c9b148ea53b46e3dfe68ab72290069a..a303ca374069e786c04b233c38fec6db59afcf43 100644
--- a/chrome/browser/ui/toolbar/toolbar_model_unittest.cc
+++ b/chrome/browser/ui/toolbar/toolbar_model_unittest.cc
@@ -148,7 +148,6 @@ class ToolbarModelTest : public BrowserWithTestWindowTest {
void SetUp() override;
protected:
- void EnableOriginChipFieldTrial();
void NavigateAndCheckText(const GURL& url,
const base::string16& expected_text,
bool would_perform_search_term_replacement,
@@ -184,13 +183,6 @@ void ToolbarModelTest::SetUp() {
UIThreadSearchTermsData::SetGoogleBaseURL("http://google.com/");
}
-void ToolbarModelTest::EnableOriginChipFieldTrial() {
- field_trial_list_.reset(new base::FieldTrialList(
- new metrics::SHA1EntropyProvider("platypus")));
- base::FieldTrialList::CreateFieldTrial("EmbeddedSearch",
- "Group1 espv:2 origin_chip:1");
-}
-
void ToolbarModelTest::NavigateAndCheckText(
const GURL& url,
const base::string16& expected_text,
@@ -286,42 +278,6 @@ TEST_F(ToolbarModelTest, ShouldDisplayURL_QueryExtraction) {
}
}
-// Test that we remove or replace URLs appropriately when the origin chip is
-// enabled.
-TEST_F(ToolbarModelTest, ShouldDisplayURL_OriginChip) {
- EnableOriginChipFieldTrial();
- AddTab(browser(), GURL(url::kAboutBlankURL));
-
- // Check each case with the origin chip enabled but query extraction disabled.
- EXPECT_TRUE(chrome::ShouldDisplayOriginChip());
- EXPECT_FALSE(chrome::IsQueryExtractionEnabled());
- for (size_t i = 0; i < arraysize(test_items); ++i) {
- const TestItem& test_item = test_items[i];
- NavigateAndCheckText(test_item.url, base::string16(), false,
- test_item.should_display_url);
- }
-
- // Check with both enabled.
- chrome::EnableQueryExtractionForTesting();
- EXPECT_TRUE(chrome::IsQueryExtractionEnabled());
- EXPECT_TRUE(browser()->toolbar_model()->url_replacement_enabled());
- for (size_t i = 0; i < arraysize(test_items); ++i) {
- const TestItem& test_item = test_items[i];
- NavigateAndCheckText(test_item.url, test_item.expected_text_both,
- test_item.would_perform_search_term_replacement,
- test_item.should_display_url);
- }
-
- // Disabling URL replacement should reset to only showing URLs.
- browser()->toolbar_model()->set_url_replacement_enabled(false);
- for (size_t i = 0; i < arraysize(test_items); ++i) {
- const TestItem& test_item = test_items[i];
- NavigateAndCheckText(test_item.url,
- test_item.expected_text_url_replacement_inactive,
- false, test_item.should_display_url);
- }
-}
-
// Verify that search terms are extracted while the page is loading.
TEST_F(ToolbarModelTest, SearchTermsWhileLoading) {
chrome::EnableQueryExtractionForTesting();
@@ -371,25 +327,11 @@ TEST_F(ToolbarModelTest, GoogleBaseURL) {
base::ASCIIToUTF16("tractor supply"), true, true);
}
-// Popup windows don't have an origin chip, so test that URL display in a popup
-// ignores whether the origin chip is enabled and only respects the query
-// extraction flag.
+// Test that URL display in a popup respects the query extraction flag.
TEST_F(PopupToolbarModelTest, ShouldDisplayURL) {
AddTab(browser(), GURL(url::kAboutBlankURL));
- // Check with neither query extraction nor the origin chip enabled.
- EXPECT_FALSE(chrome::ShouldDisplayOriginChip());
- EXPECT_FALSE(chrome::IsQueryExtractionEnabled());
- for (size_t i = 0; i < arraysize(test_items); ++i) {
- const TestItem& test_item = test_items[i];
- NavigateAndCheckText(test_item.url,
- test_item.expected_text_url_replacement_inactive,
- false, test_item.should_display_url);
- }
-
- // Check with the origin chip enabled.
- EnableOriginChipFieldTrial();
- EXPECT_TRUE(chrome::ShouldDisplayOriginChip());
+ // Check with query extraction disabled.
EXPECT_FALSE(chrome::IsQueryExtractionEnabled());
for (size_t i = 0; i < arraysize(test_items); ++i) {
const TestItem& test_item = test_items[i];
@@ -398,8 +340,7 @@ TEST_F(PopupToolbarModelTest, ShouldDisplayURL) {
false, test_item.should_display_url);
}
- // With both origin chip and query extraction enabled, only search term
- // replacement should be performed.
+ // With query extraction enabled, search term replacement should be performed.
chrome::EnableQueryExtractionForTesting();
EXPECT_TRUE(chrome::IsQueryExtractionEnabled());
EXPECT_TRUE(browser()->toolbar_model()->url_replacement_enabled());
« no previous file with comments | « chrome/browser/ui/toolbar/toolbar_model_impl.cc ('k') | chrome/browser/ui/views/frame/browser_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698