forked from Pissandshittium/pissandshittium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trigger chrome.storage.onChanged events for policy updates on the 'ma…
…naged' namespace. BUG=108992 TEST=ExtensionSettingsApiTest.ManagedStorageEvents Review URL: https://chromiumcodereview.appspot.com/10807086 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148350 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
joaodasilva@chromium.org
committed
Jul 25, 2012
1 parent
71d504f
commit 9a30138
Showing
13 changed files
with
176 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
chrome/test/data/extensions/api_test/settings/managed_storage_events/background.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright (c) 2012 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
chrome.test.runTests([ | ||
function managedChangeEvents() { | ||
// Verify initial values. | ||
chrome.storage.managed.get( | ||
chrome.test.callbackPass(function(results) { | ||
chrome.test.assertEq({ | ||
'constant-policy': 'aaa', | ||
'changes-policy': 'bbb', | ||
'deleted-policy': 'ccc' | ||
}, results); | ||
|
||
// Now start listening for changes. | ||
// chrome.test.listenOnce() adds and removes the listener to the | ||
// given event, and only lets the test complete after receiving the | ||
// event. | ||
chrome.test.listenOnce( | ||
chrome.storage.onChanged, | ||
function(changes, namespace) { | ||
chrome.test.assertEq('managed', namespace); | ||
chrome.test.assertEq({ | ||
'changes-policy': { | ||
'oldValue': 'bbb', | ||
'newValue': 'ddd' | ||
}, | ||
'deleted-policy': { | ||
'oldValue': 'ccc' | ||
}, | ||
'new-policy': { | ||
'newValue': 'eee' | ||
} | ||
}, changes); | ||
}); | ||
|
||
// Signal to the browser that we're listening. | ||
chrome.test.sendMessage('ready'); | ||
})); | ||
} | ||
]); |
11 changes: 11 additions & 0 deletions
11
chrome/test/data/extensions/api_test/settings/managed_storage_events/manifest.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "managed storage event tests", | ||
"key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDkprt3BRSqoikAhSygI6VUzDLt18cKODYmkaa/dwPp4dboyz93RSB+v76grbqsNWrJjkrEwRD3QFeBYBq7h27XAMV4X5XvWjmWQBkRTBQyQI8cZd7M9dgfKrI3EqX9OJvd/wTJkC0dgF47nwWRa/Tvwl7Y66GwEEUjpn2MTv4klwIDAQAB", | ||
"version": "1.0", | ||
"manifest_version": 2, | ||
"description": "Tests events on the 'managed' namespace of the Storage API.", | ||
"permissions": ["storage"], | ||
"background": { | ||
"scripts": ["background.js"] | ||
} | ||
} |