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

Unified Diff: components/search_engines/desktop_search_win_unittest.cc

Issue 1477783004: Add a preference to control Windows desktop search redirection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Declare feature in header file. Created 5 years, 1 month 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
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""},

Powered by Google App Engine
This is Rietveld 408576698