| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "extension_prefs_unittest.h" | 5 #include "extension_prefs_unittest.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/prefs/public/pref_change_registrar.h" | 9 #include "base/prefs/public/pref_change_registrar.h" |
| 10 #include "base/scoped_temp_dir.h" | 10 #include "base/scoped_temp_dir.h" |
| (...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1122 Mock::VerifyAndClearExpectations(&observer); | 1122 Mock::VerifyAndClearExpectations(&observer); |
| 1123 Mock::VerifyAndClearExpectations(&incognito_observer); | 1123 Mock::VerifyAndClearExpectations(&incognito_observer); |
| 1124 | 1124 |
| 1125 // Uninstall. | 1125 // Uninstall. |
| 1126 EXPECT_CALL(observer, OnPreferenceChanged(_, _)); | 1126 EXPECT_CALL(observer, OnPreferenceChanged(_, _)); |
| 1127 EXPECT_CALL(incognito_observer, OnPreferenceChanged(_, _)); | 1127 EXPECT_CALL(incognito_observer, OnPreferenceChanged(_, _)); |
| 1128 UninstallExtension(ext1_->id()); | 1128 UninstallExtension(ext1_->id()); |
| 1129 Mock::VerifyAndClearExpectations(&observer); | 1129 Mock::VerifyAndClearExpectations(&observer); |
| 1130 Mock::VerifyAndClearExpectations(&incognito_observer); | 1130 Mock::VerifyAndClearExpectations(&incognito_observer); |
| 1131 | 1131 |
| 1132 registrar.Remove(kPref1, &observer); | 1132 registrar.Remove(kPref1); |
| 1133 incognito_registrar.Remove(kPref1, &incognito_observer); | 1133 incognito_registrar.Remove(kPref1); |
| 1134 } | 1134 } |
| 1135 virtual void Verify() { | 1135 virtual void Verify() { |
| 1136 std::string actual = prefs()->pref_service()->GetString(kPref1); | 1136 std::string actual = prefs()->pref_service()->GetString(kPref1); |
| 1137 EXPECT_EQ(kDefaultPref1, actual); | 1137 EXPECT_EQ(kDefaultPref1, actual); |
| 1138 } | 1138 } |
| 1139 }; | 1139 }; |
| 1140 TEST_F(ExtensionPrefsNotifyWhenNeeded, | 1140 TEST_F(ExtensionPrefsNotifyWhenNeeded, |
| 1141 ExtensionPrefsNotifyWhenNeeded) {} | 1141 ExtensionPrefsNotifyWhenNeeded) {} |
| 1142 | 1142 |
| 1143 // Tests disabling an extension. | 1143 // Tests disabling an extension. |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1304 EXPECT_EQ(string16(), error16); | 1304 EXPECT_EQ(string16(), error16); |
| 1305 EXPECT_TRUE(prefs()->UserMayModifySettings(extension_.get(), &error16)); | 1305 EXPECT_TRUE(prefs()->UserMayModifySettings(extension_.get(), &error16)); |
| 1306 EXPECT_EQ(string16(), error16); | 1306 EXPECT_EQ(string16(), error16); |
| 1307 EXPECT_FALSE(prefs()->MustRemainEnabled(extension_.get(), &error16)); | 1307 EXPECT_FALSE(prefs()->MustRemainEnabled(extension_.get(), &error16)); |
| 1308 EXPECT_EQ(string16(), error16); | 1308 EXPECT_EQ(string16(), error16); |
| 1309 } | 1309 } |
| 1310 }; | 1310 }; |
| 1311 TEST_F(ExtensionPrefsNotRequiredExtension, NotRequiredExtension) {} | 1311 TEST_F(ExtensionPrefsNotRequiredExtension, NotRequiredExtension) {} |
| 1312 | 1312 |
| 1313 } // namespace extensions | 1313 } // namespace extensions |
| OLD | NEW |