OLD | NEW |
1 // Copyright (c) 2011 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 var api = chrome.experimental.storage; | 5 var api = chrome.storage; |
6 var assertEq = chrome.test.assertEq; | 6 var assertEq = chrome.test.assertEq; |
7 var inIncognitoContext = chrome.extension.inIncognitoContext; | 7 var inIncognitoContext = chrome.extension.inIncognitoContext; |
8 | 8 |
9 ['sync', 'local'].forEach(function(namespace) { | 9 ['sync', 'local'].forEach(function(namespace) { |
10 api[namespace].notifications = {}; | 10 api[namespace].notifications = {}; |
11 api.onChanged.addListener(function(changes, event_namespace) { | 11 api.onChanged.addListener(function(changes, event_namespace) { |
12 if (event_namespace == namespace) { | 12 if (event_namespace == namespace) { |
13 var notifications = api[namespace].notifications; | 13 var notifications = api[namespace].notifications; |
14 Object.keys(changes).forEach(function(key) { | 14 Object.keys(changes).forEach(function(key) { |
15 notifications[key] = changes[key]; | 15 notifications[key] = changes[key]; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 return; | 79 return; |
80 } | 80 } |
81 action.bind(api[message.namespace])( | 81 action.bind(api[message.namespace])( |
82 message.isFinalAction ? chrome.test.succeed : next); | 82 message.isFinalAction ? chrome.test.succeed : next); |
83 }); | 83 }); |
84 } | 84 } |
85 next(); | 85 next(); |
86 } | 86 } |
87 | 87 |
88 chrome.test.runTests([testEverything]); | 88 chrome.test.runTests([testEverything]); |
OLD | NEW |