OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/metrics/field_trial.h" | 6 #include "base/metrics/field_trial.h" |
7 #include "base/metrics/histogram_base.h" | 7 #include "base/metrics/histogram_base.h" |
8 #include "base/metrics/histogram_samples.h" | 8 #include "base/metrics/histogram_samples.h" |
9 #include "base/metrics/statistics_recorder.h" | 9 #include "base/metrics/statistics_recorder.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 {"https://foo.com/url#strk", true, "Valid search URL"}, | 413 {"https://foo.com/url#strk", true, "Valid search URL"}, |
414 {"https://foo.com/alt?strk", true, "Valid alternative URL"}, | 414 {"https://foo.com/alt?strk", true, "Valid alternative URL"}, |
415 {"https://foo.com/alt#strk", true, "Valid alternative URL"}, | 415 {"https://foo.com/alt#strk", true, "Valid alternative URL"}, |
416 {"https://foo.com/url?strk&bar=", true, "No query terms"}, | 416 {"https://foo.com/url?strk&bar=", true, "No query terms"}, |
417 {"https://foo.com/url?strk&q=abc", true, "No query terms key"}, | 417 {"https://foo.com/url?strk&q=abc", true, "No query terms key"}, |
418 {"https://foo.com/url?strk#bar=abc", true, "Query terms key in ref"}, | 418 {"https://foo.com/url?strk#bar=abc", true, "Query terms key in ref"}, |
419 {"https://foo.com/url?strk&bar=abc", false, "Has query terms"}, | 419 {"https://foo.com/url?strk&bar=abc", false, "Has query terms"}, |
420 {"http://foo.com/instant?strk=1", false, "Insecure URL"}, | 420 {"http://foo.com/instant?strk=1", false, "Insecure URL"}, |
421 {"https://foo.com/instant", false, "No search term replacement"}, | 421 {"https://foo.com/instant", false, "No search term replacement"}, |
422 {"chrome://blank/", false, "Chrome scheme"}, | 422 {"chrome://blank/", false, "Chrome scheme"}, |
423 {"chrome-search://foo", false, "Chrome-search scheme"}, | 423 {"chrome-search://foo", false, "Chrome-search scheme"}, |
424 {chrome::kChromeSearchLocalNtpUrl, true, "Local new tab page"}, | 424 {chrome::kChromeSearchLocalNtpUrl, true, "Local new tab page"}, |
425 {chrome::kChromeSearchLocalGoogleNtpUrl, true, "Local new tab page"}, | 425 {chrome::kChromeSearchLocalGoogleNtpUrl, true, "Local new tab page"}, |
426 {"https://bar.com/instant?strk=1", false, "Random non-search page"}, | 426 {"https://bar.com/instant?strk=1", false, "Random non-search page"}, |
427 }; | 427 }; |
428 | 428 |
429 TEST_F(SearchTest, InstantNTPExtendedEnabled) { | 429 TEST_F(SearchTest, InstantNTPExtendedEnabled) { |
430 EnableInstantExtendedAPIForTesting(); | 430 EnableInstantExtendedAPIForTesting(); |
431 AddTab(browser(), GURL("chrome://blank")); | 431 AddTab(browser(), GURL("chrome://blank")); |
432 for (size_t i = 0; i < arraysize(kInstantNTPTestCases); ++i) { | 432 for (size_t i = 0; i < arraysize(kInstantNTPTestCases); ++i) { |
433 const SearchTestCase& test = kInstantNTPTestCases[i]; | 433 const SearchTestCase& test = kInstantNTPTestCases[i]; |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 | 673 |
674 // Now that suggest is back on and the instant url is good, the checkbox | 674 // Now that suggest is back on and the instant url is good, the checkbox |
675 // should be enabled and checked again, but still invisible. | 675 // should be enabled and checked again, but still invisible. |
676 EXPECT_FALSE(IsInstantCheckboxVisible()); | 676 EXPECT_FALSE(IsInstantCheckboxVisible()); |
677 EXPECT_TRUE(IsInstantCheckboxEnabled(profile())); | 677 EXPECT_TRUE(IsInstantCheckboxEnabled(profile())); |
678 EXPECT_FALSE(IsInstantCheckboxChecked(profile())); | 678 EXPECT_FALSE(IsInstantCheckboxChecked(profile())); |
679 } | 679 } |
680 | 680 |
681 | 681 |
682 } // namespace chrome | 682 } // namespace chrome |
OLD | NEW |