RESOLVED FIXED 90665
Check returned value in BatteryStatus APIs test cases
https://bugs.webkit.org/show_bug.cgi?id=90665
Summary Check returned value in BatteryStatus APIs test cases
Gyuyoung Kim
Reported 2012-07-06 01:33:04 PDT
Test cases of battery status have checked if properties of battery status are existed. In my opinion, to check return type is better than to check properties.
Attachments
Patch (10.56 KB, patch)
2012-07-06 01:36 PDT, Gyuyoung Kim
no flags
Patch (12.77 KB, patch)
2012-07-07 06:24 PDT, Gyuyoung Kim
no flags
Patch (12.62 KB, patch)
2012-07-08 21:32 PDT, Gyuyoung Kim
no flags
Gyuyoung Kim
Comment 1 2012-07-06 01:36:32 PDT
Gyuyoung Kim
Comment 2 2012-07-06 01:38:06 PDT
CC'ing Adam and Kihong.
Kihong Kwon
Comment 3 2012-07-06 01:55:15 PDT
If there is a problem what you said, how about checking both value and type. IMHO, we need to check values which is returned. :)
Gyuyoung Kim
Comment 4 2012-07-06 05:09:10 PDT
(In reply to comment #3) > If there is a problem what you said, how about checking both value and type. > IMHO, we need to check values which is returned. :) Can we estimate what is return values ? In network information APIs case, I just checked return type because returned value can be different on each port.
Kihong Kwon
Comment 5 2012-07-06 05:48:26 PDT
(In reply to comment #4) > (In reply to comment #3) > > If there is a problem what you said, how about checking both value and type. > > IMHO, we need to check values which is returned. :) > > Can we estimate what is return values ? In network information APIs case, I just checked return type because returned value can be different on each port. That's why we use internals.setBatteryStatus. Every test cases set values for checking return values by internals.setBatteryStatus. ------------------------------------------------------------------------------- var charging = false; var chargingTime = Number.POSITIVE_INFINITY; var dischargingTime = 6000; var level = 0.7; ... internals.setBatteryStatus(document, 'chargingchange', charging, chargingTime, dischargingTime, level); ------------------------------------------------------------------------------- When internals.setBatteryStatus called, DRT emulates event-dispatching with preset values.
Gyuyoung Kim
Comment 6 2012-07-07 06:24:16 PDT
Gyuyoung Kim
Comment 7 2012-07-07 06:26:35 PDT
I'm not sure whether each port can support this test cases in future. If possible, I also think to compare returned value is more correct. Patch is updated.
Kihong Kwon
Comment 8 2012-07-08 19:42:18 PDT
(In reply to comment #7) > I'm not sure whether each port can support this test cases in future. If possible, I also think to compare returned value is more correct. Patch is updated. I think new patch is not different from original test cases. It just changed from variables to values. I looked into shouldBe function again, IMHO we don't need to fix these test cases. How do you think about this?
Adam Barth
Comment 9 2012-07-08 20:46:59 PDT
IMHO, this approach is better because the expected.txt file lists the actual values we expect. That means we don't need to refer to the test to understand what is different about failing values.
Gyuyoung Kim
Comment 10 2012-07-08 21:24:55 PDT
(In reply to comment #9) > IMHO, this approach is better because the expected.txt file lists the actual values we expect. That means we don't need to refer to the test to understand what is different about failing values. I also agree with your thought. It is better to compare concrete values to recognize what is differences.
Gyuyoung Kim
Comment 11 2012-07-08 21:32:52 PDT
WebKit Review Bot
Comment 12 2012-07-08 22:10:36 PDT
Comment on attachment 151180 [details] Patch Clearing flags on attachment: 151180 Committed r122088: <http://trac.webkit.org/changeset/122088>
WebKit Review Bot
Comment 13 2012-07-08 22:10:41 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.