OLD | NEW |
1 <script> | |
2 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 3 // found in the LICENSE file. |
5 | 4 |
6 chrome.extension.onRequest.addListener(function(msg, sender, responseFunc) { | 5 chrome.extension.onRequest.addListener(function(msg, sender, responseFunc) { |
7 if (msg == "getApi") { | 6 if (msg == "getApi") { |
8 responseFunc(chrome.test.getApiDefinitions()); | 7 responseFunc(chrome.test.getApiDefinitions()); |
9 } else if (msg == "pass") { | 8 } else if (msg == "pass") { |
10 chrome.test.notifyPass(); | 9 chrome.test.notifyPass(); |
11 } else if (msg.substr(0, 3) == "log") { | 10 } else if (msg.substr(0, 3) == "log") { |
12 chrome.test.log(msg); | 11 chrome.test.log(msg); |
13 } else { | 12 } else { |
14 chrome.test.notifyFail("failed"); | 13 chrome.test.notifyFail("failed"); |
15 } | 14 } |
16 }); | 15 }); |
17 | 16 |
18 // On first install, send a success message so the test can continue. | 17 // On first install, send a success message so the test can continue. |
19 chrome.test.notifyPass(); | 18 chrome.test.notifyPass(); |
20 </script> | |
OLD | NEW |