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

Unified Diff: chrome/test/data/extensions/api_test/serial/api/background.js

Issue 10702138: Instrument serial API code to make testing easier. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/api_test/serial/api/background.js
diff --git a/chrome/test/data/extensions/api_test/serial/api/background.js b/chrome/test/data/extensions/api_test/serial/api/background.js
index 76e9239582e4d60acf24160e912f7409be480233..95db14bf146ae571a4006496b4463d31f1969565 100644
--- a/chrome/test/data/extensions/api_test/serial/api/background.js
+++ b/chrome/test/data/extensions/api_test/serial/api/background.js
@@ -137,7 +137,7 @@ var testSerial = function() {
if (portNumber < ports.length) {
serialPort = ports[portNumber];
var bitrate = 57600;
- console.log('Connecting to serial device ' + serialPort + ' at ' +
+ console.log('Opening serial device ' + serialPort + ' at ' +
bitrate + ' bps.');
chrome.experimental.serial.open(serialPort, {bitrate: bitrate},
onOpen);
@@ -155,19 +155,5 @@ var testSerial = function() {
chrome.experimental.serial.getPorts(onGetPorts);
};
-var onMessageReply = function(message) {
- var tests = [testGetPorts, testMaybeOpenPort];
-
- // Another way to force the test to run.
- var runTest = false;
-
- if (runTest || message == 'echo_device_attached') {
- // We have a specific serial port set up to respond to test traffic. This
- // is a rare situation. TODO(miket): mock to make it testable under any
- // hardware conditions.
- tests.push(testSerial);
- }
- chrome.test.runTests(tests);
-};
-
-chrome.test.sendMessage('serial_port', onMessageReply);
+var tests = [testGetPorts, testMaybeOpenPort, testSerial];
+chrome.test.runTests(tests);

Powered by Google App Engine
This is Rietveld 408576698