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

Side by Side Diff: chrome/test/data/devtools/extensions/devtools_messaging/devtools.js

Issue 16226004: Replace JSON (de)serialization of extension messages with direct Value pickling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 6 months 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
« no previous file with comments | « chrome/renderer/resources/extensions/miscellaneous_bindings.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 function output(msg) { 5 function output(msg) {
6 chrome.devtools.inspectedWindow.eval("console.log(unescape('" + 6 chrome.devtools.inspectedWindow.eval("console.log(unescape('" +
7 escape(msg) + "'));") 7 escape(msg) + "'));")
8 } 8 }
9 9
10 var hadErrors = false; 10 var hadErrors = false;
(...skipping 12 matching lines...) Expand all
23 } 23 }
24 24
25 function step1() { 25 function step1() {
26 chrome.extension.sendRequest("foo", function(response) { 26 chrome.extension.sendRequest("foo", function(response) {
27 assertEquals('onRequest callback: "foo"', response); 27 assertEquals('onRequest callback: "foo"', response);
28 step2(); 28 step2();
29 }); 29 });
30 } 30 }
31 31
32 function step2() { 32 function step2() {
33 var object = { "string": "foo", "number": 42 }; 33 var object = [{"string": "foo"}, {"number": 42}];
34 chrome.extension.sendRequest(object, function(response) { 34 chrome.extension.sendRequest(object, function(response) {
35 assertEquals('onRequest callback: ' + JSON.stringify(object), response); 35 assertEquals('onRequest callback: ' + JSON.stringify(object), response);
36 step3(); 36 step3();
37 }); 37 });
38 } 38 }
39 39
40 function step3() { 40 function step3() {
41 function onMessage(message) { 41 function onMessage(message) {
42 assertEquals("port.onMessage: foo", message); 42 assertEquals("port.onMessage: foo", message);
43 completeTest(); 43 completeTest();
44 } 44 }
45 var port = chrome.runtime.connect(); 45 var port = chrome.runtime.connect();
46 port.onMessage.addListener(onMessage); 46 port.onMessage.addListener(onMessage);
47 port.postMessage("foo"); 47 port.postMessage("foo");
48 } 48 }
49 49
50 step1(); 50 step1();
OLDNEW
« no previous file with comments | « chrome/renderer/resources/extensions/miscellaneous_bindings.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698