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

Unified Diff: chrome/test/data/extensions/api_test/settings_private/test.js

Issue 1061613002: chrome.settingsPrivate: Implement onPrefsChanged event handling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a direct memory leak Created 5 years, 8 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
« no previous file with comments | « chrome/common/extensions/api/settings_private.idl ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/api_test/settings_private/test.js
diff --git a/chrome/test/data/extensions/api_test/settings_private/test.js b/chrome/test/data/extensions/api_test/settings_private/test.js
index 86104b15a50feeeaf2a78336feffc61e3ab4f8ac..28ac7f644ab45427c87e58512b6766ee265e1206 100644
--- a/chrome/test/data/extensions/api_test/settings_private/test.js
+++ b/chrome/test/data/extensions/api_test/settings_private/test.js
@@ -6,7 +6,8 @@
// that callbacks are correctly invoked, expected parameters are correct,
// and failures are detected.
-var kTestPrefName = 'test.foo_bar';
+var kTestPrefName = 'download.default_directory';
+var kTestPrefValue = '/Downloads';
var kTestPageId = 'pageId';
function callbackResult(result) {
@@ -20,7 +21,7 @@ var availableTests = [
function setPref() {
chrome.settingsPrivate.setPref(
kTestPrefName,
- true,
+ kTestPrefValue,
kTestPageId,
function(success) {
callbackResult(success);
@@ -44,6 +45,21 @@ var availableTests = [
chrome.test.succeed();
});
},
+ function onPrefsChanged() {
+ chrome.settingsPrivate.onPrefsChanged.addListener(function(prefs) {
+ chrome.test.assertTrue(prefs.length > 0);
+ chrome.test.assertEq(kTestPrefName, prefs[0].key);
+ chrome.test.assertEq(kTestPrefValue, prefs[0].value);
+ callbackResult(true);
+ chrome.test.succeed();
+ });
+
+ chrome.settingsPrivate.setPref(
+ kTestPrefName,
+ kTestPrefValue,
+ kTestPageId,
+ function() {});
+ },
];
var testToRun = window.location.search.substring(1);
« no previous file with comments | « chrome/common/extensions/api/settings_private.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698