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

Side by Side Diff: chrome/test/data/extensions/api_test/socket/api/background.js

Issue 10440097: Move socket API from experimental to dev channel and remove some dead code (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Update Created 8 years, 4 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // net/tools/testserver/testserver.py is picky about the format of what it 5 // net/tools/testserver/testserver.py is picky about the format of what it
6 // calls its "echo" messages. One might go so far as to mutter to oneself that 6 // calls its "echo" messages. One might go so far as to mutter to oneself that
7 // it isn't an echo server at all. 7 // it isn't an echo server at all.
8 // 8 //
9 // The response is based on the request but obfuscated using a random key. 9 // The response is based on the request but obfuscated using a random key.
10 const request = "0100000005320000005hello"; 10 const request = "0100000005320000005hello";
11 var expectedResponsePattern = /0100000005320000005.{11}/; 11 var expectedResponsePattern = /0100000005320000005.{11}/;
12 12
13 const socket = chrome.experimental.socket; 13 const socket = chrome.socket;
14 var address; 14 var address;
15 var bytesWritten = 0; 15 var bytesWritten = 0;
16 var dataAsString; 16 var dataAsString;
17 var dataRead = []; 17 var dataRead = [];
18 var port = -1; 18 var port = -1;
19 var protocol = "none"; 19 var protocol = "none";
20 var socketId = 0; 20 var socketId = 0;
21 var succeeded = false; 21 var succeeded = false;
22 var waitCount = 0; 22 var waitCount = 0;
23 23
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 address = parts[1]; 145 address = parts[1];
146 port = parseInt(parts[2]); 146 port = parseInt(parts[2]);
147 console.log("Running tests, protocol " + protocol + ", echo server " + 147 console.log("Running tests, protocol " + protocol + ", echo server " +
148 address + ":" + port); 148 address + ":" + port);
149 chrome.test.runTests([ testSocketCreation, testSending ]); 149 chrome.test.runTests([ testSocketCreation, testSending ]);
150 }; 150 };
151 151
152 // Find out which protocol we're supposed to test, and which echo server we 152 // Find out which protocol we're supposed to test, and which echo server we
153 // should be using, then kick off the tests. 153 // should be using, then kick off the tests.
154 chrome.test.sendMessage("info_please", onMessageReply); 154 chrome.test.sendMessage("info_please", onMessageReply);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698