Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Side by Side Diff: chrome/test/data/extensions/api_test/stubs/background.html

Issue 8540012: Enable extension APIs for content scripts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698