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

Unified Diff: chrome/browser/protector/protected_prefs_watcher_unittest.cc

Issue 9748016: [protector] Added UI for invalid Preferences backup case. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix unit-test. Created 8 years, 9 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/protector/protected_prefs_watcher_unittest.cc
diff --git a/chrome/browser/protector/protected_prefs_watcher_unittest.cc b/chrome/browser/protector/protected_prefs_watcher_unittest.cc
index b1ec3aeadc2011a632ed358dc9d9ea3b35fe06d8..ef8c48e61df83d9da2f9af87fd0ceb0194c0076b 100644
--- a/chrome/browser/protector/protected_prefs_watcher_unittest.cc
+++ b/chrome/browser/protector/protected_prefs_watcher_unittest.cc
@@ -53,7 +53,6 @@ class ProtectedPrefsWatcherTest : public testing::Test {
TEST_F(ProtectedPrefsWatcherTest, ValidOnCleanProfile) {
EXPECT_TRUE(HasBackup());
- EXPECT_TRUE(IsSignatureValid());
EXPECT_TRUE(prefs_watcher_->is_backup_valid());
}
@@ -67,7 +66,6 @@ TEST_F(ProtectedPrefsWatcherTest, ValidAfterPrefChange) {
prefs_->SetString(prefs::kHomePage, kNewHomePage);
EXPECT_TRUE(HasBackup());
- EXPECT_TRUE(IsSignatureValid());
EXPECT_TRUE(prefs_watcher_->is_backup_valid());
EXPECT_EQ(prefs_->GetString(prefs::kHomePage), kNewHomePage);
// Backup is updated accordingly.
@@ -80,7 +78,6 @@ TEST_F(ProtectedPrefsWatcherTest, InvalidSignature) {
prefs_->SetString("backup.homepage", kNewHomePage);
RevalidateBackup();
EXPECT_TRUE(HasBackup());
- EXPECT_FALSE(IsSignatureValid());
EXPECT_FALSE(prefs_watcher_->is_backup_valid());
// No backup values available.
EXPECT_FALSE(prefs_watcher_->GetBackupForPref(prefs::kHomePage));
@@ -115,12 +112,10 @@ TEST_F(ProtectedPrefsWatcherTest, ExtensionPrefChange) {
sample_id, !extension_prefs->IsAppNotificationDisabled(sample_id));
// Backup is still valid.
- EXPECT_TRUE(IsSignatureValid());
EXPECT_TRUE(prefs_watcher_->is_backup_valid());
- // Make backup invalid by changing one of its members directly.
- prefs_->SetString("backup.homepage", kNewHomePage);
- RevalidateBackup();
+ // Make signature invalid by changing it directly.
+ prefs_->SetString("backup._signature", "INVALID");
EXPECT_FALSE(IsSignatureValid());
// Flip another pref value of that extension.
« no previous file with comments | « chrome/browser/protector/protected_prefs_watcher.cc ('k') | chrome/browser/protector/session_startup_change.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698