| OLD | NEW |
| (Empty) |
| 1 <script> | |
| 2 var pass = chrome.test.callbackPass; | |
| 3 | |
| 4 chrome.test.runTests([ | |
| 5 function testShowsAndCanGetParent() { | |
| 6 chrome.tabs.getSelected(null, function(tab) { | |
| 7 chrome.experimental.infobars.show( | |
| 8 {tabId: tab.id, path:'in-infobar.html'}); | |
| 9 }); | |
| 10 // Flow continues in infobarCallback | |
| 11 } | |
| 12 ]); | |
| 13 | |
| 14 function infobarCallback(showPopupFunc) { | |
| 15 showPopupFunc(); | |
| 16 // Flow continues in popupCallback | |
| 17 } | |
| 18 | |
| 19 function popupCallback(popupWindow, getFromParentFunc) { | |
| 20 getFromParentFunc(); | |
| 21 var result = popupWindow.document.getElementById('target').innerText; | |
| 22 if (!result) { | |
| 23 chrome.test.fail('no result'); | |
| 24 } | |
| 25 chrome.test.assertEq(result, '42'); | |
| 26 chrome.test.notifyPass(); | |
| 27 } | |
| 28 | |
| 29 </script> | |
| OLD | NEW |