OLD | NEW |
| 1 // Copyright (c) 2013 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 |
1 function output(msg) { | 5 function output(msg) { |
2 chrome.devtools.inspectedWindow.eval("console.log(unescape('" + | 6 chrome.devtools.inspectedWindow.eval("console.log(unescape('" + |
3 escape(msg) + "'));") | 7 escape(msg) + "'));") |
4 } | 8 } |
5 | 9 |
6 var hadErrors = false; | 10 var hadErrors = false; |
7 | 11 |
8 function assertEquals(expected, actual) { | 12 function assertEquals(expected, actual) { |
9 if (expected === actual) | 13 if (expected === actual) |
10 return; | 14 return; |
(...skipping 20 matching lines...) Expand all Loading... |
31 assertEquals('onRequest callback: ' + JSON.stringify(object), response); | 35 assertEquals('onRequest callback: ' + JSON.stringify(object), response); |
32 step3(); | 36 step3(); |
33 }); | 37 }); |
34 } | 38 } |
35 | 39 |
36 function step3() { | 40 function step3() { |
37 function onMessage(message) { | 41 function onMessage(message) { |
38 assertEquals("port.onMessage: foo", message); | 42 assertEquals("port.onMessage: foo", message); |
39 completeTest(); | 43 completeTest(); |
40 } | 44 } |
41 var port = chrome.extension.connect(); | 45 var port = chrome.runtime.connect(); |
42 port.onMessage.addListener(onMessage); | 46 port.onMessage.addListener(onMessage); |
43 port.postMessage("foo"); | 47 port.postMessage("foo"); |
44 } | 48 } |
45 | 49 |
46 step1(); | 50 step1(); |
OLD | NEW |