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

Unified Diff: chrome/test/data/extensions/api_test/braille_display_private/write_dots/test.js

Issue 13355002: Implement chrome.brailleDisplayPrivate API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix stylistic issues from last review round. Created 7 years, 3 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 | « chrome/test/data/extensions/api_test/braille_display_private/write_dots/manifest.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/api_test/braille_display_private/write_dots/test.js
diff --git a/chrome/test/data/extensions/api_test/braille_display_private/write_dots/test.js b/chrome/test/data/extensions/api_test/braille_display_private/write_dots/test.js
new file mode 100644
index 0000000000000000000000000000000000000000..ba4fc6d844d76250048aa57c0e50de9adf1f0cf0
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/braille_display_private/write_dots/test.js
@@ -0,0 +1,41 @@
+// Copyright (c) 2013 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.
+
+// Test for brailleDisplayPrivate.writeDots.
+// browser_tests.exe --gtest_filter="BrailleDisplayPrivateApiTest.*"
+
+var pass = chrome.test.callbackPass;
+
+function createBuffer(size, element) {
+ var buf = new Uint8Array(size);
+ for (var i = 0; i < size; ++i) {
+ buf[i] = element;
+ }
+ return buf.buffer;
+}
+
+chrome.test.runTests([
+ function testWriteEmptyCells() {
+ chrome.brailleDisplayPrivate.getDisplayState(pass(
+ function(state) {
+ chrome.test.assertTrue(state.available, "Display not available");
+ chrome.test.assertEq(11, state.textCellCount);
+ chrome.brailleDisplayPrivate.writeDots(new ArrayBuffer(0));
+ chrome.brailleDisplayPrivate.getDisplayState(pass());
+ }));
+ },
+
+ function testWriteOversizedCells() {
+ chrome.brailleDisplayPrivate.getDisplayState(pass(
+ function(state) {
+ chrome.test.assertTrue(state.available, "Display not available");
+ chrome.test.assertEq(11, state.textCellCount);
+ chrome.brailleDisplayPrivate.writeDots(
+ createBuffer(state.textCellCount + 1, 1));
+ chrome.brailleDisplayPrivate.writeDots(
+ createBuffer(1000000, 2));
+ chrome.brailleDisplayPrivate.getDisplayState(pass());
+ }));
+ }
+]);
« no previous file with comments | « chrome/test/data/extensions/api_test/braille_display_private/write_dots/manifest.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698