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 chrome.test.runTests([ | |
6 // Tests if the <extensionoptions> guest view is successfully created. This | |
7 // test expects that the guest options page will add a {'pass': true} property | |
8 // to every Window and fire the runtime.onMessage event with a short message. | |
9 function createExtensionOptionsGuest() { | |
10 chrome.runtime.onMessage.addListener( | |
not at google - send to devlin
2014/07/18 17:07:26
nice to do this like
chrome.test.listenOnce(chrom
ericzeng
2014/07/18 19:37:06
Done.
| |
11 function(message, sender, sendResponse) { | |
not at google - send to devlin
2014/07/18 17:07:26
assert message is 'hi'?
assert sender is the optio
ericzeng
2014/07/18 19:37:06
I can't see if the sender is the options page spec
not at google - send to devlin
2014/07/18 20:31:35
ah.
| |
12 var windows = chrome.extension.getViews(); | |
not at google - send to devlin
2014/07/18 17:07:26
likewise with the forEach.
and please also assert
ericzeng
2014/07/18 19:37:06
I can check how many there are, but I can't seem t
not at google - send to devlin
2014/07/18 20:31:35
yeah just check how many there are. there should b
| |
13 for (var i = 0; i < windows.length; ++i) | |
14 chrome.test.assertTrue(windows[i].pass); | |
15 chrome.test.assertTrue('hi' == message); | |
not at google - send to devlin
2014/07/18 17:07:26
assertEq('hi', message);
ericzeng
2014/07/18 19:37:06
Done.
| |
16 chrome.test.succeed(); | |
17 }); | |
18 | |
19 var extensionoptions = document.createElement('extensionoptions'); | |
20 extensionoptions.setAttribute('extension', chrome.runtime.id); | |
21 document.body.appendChild(extensionoptions); | |
22 } | |
23 ]); | |
OLD | NEW |