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

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

Issue 943783003: Pad HID output reports on Windows to the maximum output report size. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added "size" to comment. Created 5 years, 10 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
« no previous file with comments | « extensions/browser/api/hid/hid_apitest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/test/data/api_test/hid/api/background.js
diff --git a/extensions/test/data/api_test/hid/api/background.js b/extensions/test/data/api_test/hid/api/background.js
index eef7e2dd0e705eb98fabb98724d5fd8b9e07ce13..9d8dbb7ad91a76927565d6762124b5021031329e 100644
--- a/extensions/test/data/api_test/hid/api/background.js
+++ b/extensions/test/data/api_test/hid/api/background.js
@@ -234,9 +234,20 @@ function testSendWithInvalidConnectionId() {
});
}
+function testSendOversizeReport() {
+ openDeviceWithReportId(function (connection) {
+ var buffer = stringToArrayBuffer("oversize report");
+ chrome.hid.send(connection, 1, buffer, function () {
+ chrome.test.assertLastError("Transfer failed.");
+ chrome.hid.disconnect(connection);
+ chrome.test.succeed("Caught oversize report.");
+ });
+ });
+}
+
function testSendWithReportId() {
openDeviceWithReportId(function (connection) {
- var buffer = stringToArrayBuffer("This is a HID output report.");
+ var buffer = stringToArrayBuffer("o-report");
chrome.hid.send(connection, 1, buffer, function () {
chrome.test.assertNoLastError();
chrome.hid.disconnect(connection);
@@ -247,7 +258,7 @@ function testSendWithReportId() {
function testSendWithoutReportId() {
openDeviceWithoutReportId(function (connection) {
- var buffer = stringToArrayBuffer("This is a HID output report.");
+ var buffer = stringToArrayBuffer("o-report");
chrome.hid.send(connection, 0, buffer, function () {
chrome.test.assertNoLastError();
chrome.hid.disconnect(connection);
@@ -258,7 +269,7 @@ function testSendWithoutReportId() {
function testSendWithInvalidReportId() {
openDeviceWithReportId(function (connection) {
- var buffer = stringToArrayBuffer("This is a HID output report.");
+ var buffer = stringToArrayBuffer("o-report");
chrome.hid.send(connection, 0, buffer, function () {
chrome.test.assertLastError("Transfer failed.");
chrome.hid.disconnect(connection);
@@ -269,7 +280,7 @@ function testSendWithInvalidReportId() {
function testSendWithUnexpectedReportId() {
openDeviceWithoutReportId(function (connection) {
- var buffer = stringToArrayBuffer("This is a HID output report.");
+ var buffer = stringToArrayBuffer("o-report");
chrome.hid.send(connection, 1, buffer, function () {
chrome.test.assertLastError("Transfer failed.");
chrome.hid.disconnect(connection);
@@ -396,6 +407,7 @@ chrome.test.runTests([
testReceiveWithReportId,
testReceiveWithoutReportId,
testSendWithInvalidConnectionId,
+ testSendOversizeReport,
testSendWithReportId,
testSendWithoutReportId,
testSendWithInvalidReportId,
« no previous file with comments | « extensions/browser/api/hid/hid_apitest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698