OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 // This script is opened inside a <extensionoptions> guest view. To confirm that | |
6 // it has been successfully created, it adds {pass: true} to every extension | |
7 // Window and broadcasts a message to the extension using runtime.sendMessage(). | |
8 chrome.extension.getViews().forEach(function(view) { | |
9 view.pass = true; | |
10 }); | |
11 chrome.runtime.sendMessage('hi'); | |
not at google - send to devlin
2014/07/18 22:59:34
it's a bit odd to see these 2 tests intermingled h
ericzeng
2014/07/19 00:43:44
Done.
| |
12 | |
13 // To test access to privileged APIs, the guest attempts to write to local | |
14 // storage, and both the embedder and guest check if the write succeeded. | |
15 var passed = chrome.test.callbackPass; | |
16 | |
17 chrome.test.listenOnce(chrome.storage.onChanged, function(change) { | |
18 chrome.test.assertEq(42, change.test.newValue); | |
19 }); | |
20 | |
21 chrome.storage.local.set({'test': 42}, passed(function() { | |
not at google - send to devlin
2014/07/18 22:59:34
be careful here actually - this options page runs
ericzeng
2014/07/19 00:43:44
What about using chrome.test.callback instead?
not at google - send to devlin
2014/07/19 01:34:10
I think that has the same problem:
https://code.g
| |
22 chrome.storage.local.get('test', passed(function(storage) { | |
23 chrome.test.assertEq(42, storage.test); | |
24 })); | |
25 })); | |
OLD | NEW |