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 |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b5812eaae071ceac90b722a64d14b82396926ab0 |
--- /dev/null |
+++ b/chrome/test/data/extensions/api_test/serial/api/background.js |
@@ -0,0 +1,20 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+var testSerial = function() { |
+ var onClose = function(result) { |
+ chrome.test.assertTrue(result); |
+ chrome.test.succeed(); |
+ } |
+ |
+ var onOpen = function(connectionInfo) { |
+ var connectionId = connectionInfo.connectionId; |
+ chrome.test.assertTrue(connectionId > 0); |
+ chrome.experimental.serial.close(connectionId, onClose); |
+ } |
+ |
+ chrome.experimental.serial.open("/dev/null", onOpen); |
+}; |
+ |
+chrome.test.runTests([testSerial]); |