OLD | NEW |
1 <script> | 1 <script> |
2 | 2 |
3 chrome.extension.onRequest.addListener(function(msg, sender, responseFunc) { | 3 chrome.extension.onRequest.addListener(function(msg, sender, responseFunc) { |
4 if (msg == "getApi") { | 4 if (msg == "getApi") { |
5 responseFunc(JSON.parse(chrome.test.getApiDefinitions())); | 5 responseFunc(chrome.test.getApiDefinitions()); |
6 } else if (msg == "pass") { | 6 } else if (msg == "pass") { |
7 chrome.test.notifyPass(); | 7 chrome.test.notifyPass(); |
8 } else if (msg.substr(0, 3) == "log") { | 8 } else if (msg.substr(0, 3) == "log") { |
9 chrome.test.log(msg); | 9 chrome.test.log(msg); |
10 } else { | 10 } else { |
11 chrome.test.notifyFail("failed"); | 11 chrome.test.notifyFail("failed"); |
12 } | 12 } |
13 }); | 13 }); |
14 | 14 |
15 // On first install, send a success message so the test can continue. | 15 // On first install, send a success message so the test can continue. |
16 chrome.test.notifyPass(); | 16 chrome.test.notifyPass(); |
17 | 17 |
18 </script> | 18 </script> |
OLD | NEW |