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

Unified Diff: LayoutTests/bluetooth/idl-BluetoothUUID.html

Issue 1210173011: Enforce that BluetoothUUID.canonicalUUID() takes approximately an in-range integer. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@pinned
Patch Set: Created 5 years, 6 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 | « no previous file | Source/modules/bluetooth/BluetoothUUID.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/bluetooth/idl-BluetoothUUID.html
diff --git a/LayoutTests/bluetooth/idl-BluetoothUUID.html b/LayoutTests/bluetooth/idl-BluetoothUUID.html
index 3f1234bfdabdf6e95edff5a3b63223cf12600dd7..9ed091dbf636569632cd7bf1daa87dbbf75ffa9d 100644
--- a/LayoutTests/bluetooth/idl-BluetoothUUID.html
+++ b/LayoutTests/bluetooth/idl-BluetoothUUID.html
@@ -150,13 +150,15 @@ test(function() {
var func = function() {};
// cannonicalUUID
- assert_equals(BluetoothUUID.canonicalUUID(object), base_uuid);
+ assert_throws(new TypeError, function() {BluetoothUUID.canonicalUUID(object)});
+ // [] converts to "", which converts to 0 before the range check.
assert_equals(BluetoothUUID.canonicalUUID(array), base_uuid);
- assert_equals(BluetoothUUID.canonicalUUID(func), base_uuid);
- assert_equals(BluetoothUUID.canonicalUUID(undefined), base_uuid);
+ assert_throws(new TypeError, function() {BluetoothUUID.canonicalUUID(func)});
+ assert_throws(new TypeError, function() {BluetoothUUID.canonicalUUID(undefined)});
assert_equals(BluetoothUUID.canonicalUUID(null), base_uuid);
assert_equals(BluetoothUUID.canonicalUUID(false), base_uuid);
- assert_equals(BluetoothUUID.canonicalUUID(NaN), base_uuid);
+ assert_equals(BluetoothUUID.canonicalUUID(true), BluetoothUUID.canonicalUUID(1));
+ assert_throws(new TypeError, function() {BluetoothUUID.canonicalUUID(NaN)});
// getService
assert_throws("SyntaxError", function() {
« no previous file with comments | « no previous file | Source/modules/bluetooth/BluetoothUUID.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698