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

Unified Diff: chrome/browser/supervised_user/supervised_user_service_unittest.cc

Issue 480513004: Stopping the history recording for a supervised user (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Wrapped RecordHistory in a pref. Created 6 years, 4 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
Index: chrome/browser/supervised_user/supervised_user_service_unittest.cc
diff --git a/chrome/browser/supervised_user/supervised_user_service_unittest.cc b/chrome/browser/supervised_user/supervised_user_service_unittest.cc
index bc68d836c399d1ecf61b0b6d6cd4b9a048587eb8..b53e283c724eb6379b76d5b19259c6d7acea1373 100644
--- a/chrome/browser/supervised_user/supervised_user_service_unittest.cc
+++ b/chrome/browser/supervised_user/supervised_user_service_unittest.cc
@@ -16,6 +16,7 @@
#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
#include "chrome/browser/supervised_user/custodian_profile_downloader_service.h"
#include "chrome/browser/supervised_user/custodian_profile_downloader_service_factory.h"
+#include "chrome/browser/supervised_user/supervised_user_constants.h"
Marc Treib 2014/08/20 14:14:26 I don't think this is necessary anymore.
fhorschig 2014/08/20 14:48:04 Done.
#include "chrome/browser/supervised_user/supervised_user_service.h"
#include "chrome/browser/supervised_user/supervised_user_service_factory.h"
#include "chrome/browser/ui/browser_list.h"
@@ -154,6 +155,25 @@ TEST_F(SupervisedUserServiceTest, GetManualExceptionsForHost) {
supervised_user_service_->GetManualBehaviorForURL(kMooseURL));
}
+TEST_F(SupervisedUserServiceTest, ChangesIncludedSessionOnChangedSettings) {
+ EXPECT_TRUE(supervised_user_service_->IncludesSyncSessions());
+ profile_->GetPrefs()->SetBoolean(prefs::kRecordHistory, false);
+
+ supervised_user_service_->OnHistoryRecordingStateChanged();
Marc Treib 2014/08/20 14:14:26 You shouldn't need to call this explicitly, since
fhorschig 2014/08/20 14:48:04 Done.
+
+ EXPECT_FALSE(supervised_user_service_->IncludesSyncSessions());
+}
+
+TEST_F(SupervisedUserServiceTest, ChangesSyncSessionStateOnChangedSettings) {
+ profile_->GetPrefs()->SetBoolean(prefs::kRecordHistory, false);
+ supervised_user_service_->OnHistoryRecordingStateChanged();
Marc Treib 2014/08/20 14:14:26 ^^
fhorschig 2014/08/20 14:48:04 Done.
+ profile_->GetPrefs()->SetBoolean(prefs::kRecordHistory, true);
+
+ bool changed_state = supervised_user_service_->FetchNewSessionSyncState();
+
+ EXPECT_TRUE(changed_state);
+}
+
// Ensure that the CustodianProfileDownloaderService shuts down cleanly. If no
// DCHECK is hit when the service is destroyed, this test passed.
TEST_F(SupervisedUserServiceTest, ShutDownCustodianProfileDownloader) {

Powered by Google App Engine
This is Rietveld 408576698