[Webkit-unassigned] [Bug 72010] Add new API for Vibration API spec.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Jan 28 05:49:09 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=72010





--- Comment #34 from Kentaro Hara <haraken at chromium.org>  2012-01-28 05:49:06 PST ---
(From update of attachment 124419)
View in context: https://bugs.webkit.org/attachment.cgi?id=124419&action=review

> LayoutTests/fast/dom/navigator-vibration.html:15
> +shouldBe("navigator.webkitVibrate(1000); navigator.webkitVibrate([1000, 300, 500]);", "undefined");
> +shouldBe("navigator.webkitVibrate(0); navigator.webkitVibrate([]);", "undefined");

Sorry for my previous bad comments! These tests can be written better as follows, right?

shouldBe("navigator.webkitVibrate(0)", "undefined");
shouldBe("navigator.webkitVibrate(1000)", "undefined");
shouldBe("navigator.webkitVibrate([])", "undefined");
shouldBe("navigator.webkitVibrate([1000, 300, 500])", "undefined");

In addition, it is a good idea to add the following test cases:

navigator.webkitVibrate()  // This should be equivalent to navigator.webkitVibrate(0)
navigator.webkitVibrate(-1)
navigator.webkitVibrate(4294967295)
navigator.webkitVibrate(4294967296)
navigator.webkitVibrate(1.23)

>> Source/WebCore/bindings/js/JSNavigatorCustom.cpp:90
>> +            if (value.isUndefinedOrNull() || !value.isNumber()) {
> 
> This might be "if (value.isUndefinedOrNull() || !value.isUInt32())".

Maybe this should be just "if (!value.isUInt32())"?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list