Chromium Code Reviews| Index: components/search_engines/desktop_search_win_unittest.cc |
| diff --git a/components/search_engines/detect_desktop_search_win_unittest.cc b/components/search_engines/desktop_search_win_unittest.cc |
| similarity index 65% |
| copy from components/search_engines/detect_desktop_search_win_unittest.cc |
| copy to components/search_engines/desktop_search_win_unittest.cc |
| index e3477a6ef0ef1e888621e59ff8dd492dae8c9025..5d873c5ab4623a08bdb055ef439dd8afda755636 100644 |
| --- a/components/search_engines/detect_desktop_search_win_unittest.cc |
| +++ b/components/search_engines/desktop_search_win_unittest.cc |
| @@ -2,11 +2,12 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#include "components/search_engines/detect_desktop_search_win.h" |
| +#include "components/search_engines/desktop_search_win.h" |
| #include "base/macros.h" |
| #include "base/strings/string16.h" |
| #include "components/search_engines/testing_search_terms_data.h" |
| +#include "components/syncable_prefs/testing_pref_service_syncable.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| #include "url/gurl.h" |
| @@ -17,7 +18,24 @@ struct DetectWindowsDesktopSearchTestData { |
| }; |
| } // namespace |
| -TEST(DetectWindowsDesktopSearch, DetectWindowsDesktopSearch) { |
| +TEST(WindowsDesktopSearch, Prefs) { |
|
Peter Kasting
2015/12/01 02:23:05
This test seems pretty useless. You're basically
fdoray
2015/12/02 17:28:27
I've replaced GetWindowsDesktopSearchRedirectionPr
|
| + const char kWindowsDesktopSearchRedirectionPref[] = |
| + "windows_desktop_search_redirection"; |
| + |
| + syncable_prefs::TestingPrefServiceSyncable prefs; |
| + RegisterWindowsDesktopSearchRedirectionPref(prefs.registry()); |
| + |
| + EXPECT_EQ(WindowsDesktopSearchRedirectionPref::UNSET, |
| + GetWindowsDesktopSearchRedirectionPref(&prefs)); |
| + prefs.SetBoolean(kWindowsDesktopSearchRedirectionPref, true); |
| + EXPECT_EQ(WindowsDesktopSearchRedirectionPref::ENABLED, |
| + GetWindowsDesktopSearchRedirectionPref(&prefs)); |
| + prefs.SetBoolean(kWindowsDesktopSearchRedirectionPref, false); |
| + EXPECT_EQ(WindowsDesktopSearchRedirectionPref::DISABLED, |
| + GetWindowsDesktopSearchRedirectionPref(&prefs)); |
| +} |
| + |
| +TEST(WindowsDesktopSearch, DetectWindowsDesktopSearch) { |
| const DetectWindowsDesktopSearchTestData test_data[] = { |
| {"https://www.google.com", L""}, |
| {"https://www.bing.com/search", L""}, |