Check returned value in BatteryStatus APIs test cases

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

Reviewed by Adam Barth.

It is good to compare with actual values to recognize what is difference.

* batterystatus/add-listener-from-callback-expected.txt:
* batterystatus/basic-all-types-of-events-expected.txt:
* batterystatus/basic-operation-expected.txt:
* batterystatus/script-tests/add-listener-from-callback.js:
(checkBatteryStatus):
* batterystatus/script-tests/basic-all-types-of-events.js:
(checkBatteryStatus):
* batterystatus/script-tests/basic-operation.js:
* batterystatus/script-tests/updates.js:
(checkBatteryStatus):
* batterystatus/updates-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122088 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent bf377317
2012-07-08 Gyuyoung Kim <gyuyoung.kim@samsung.com>
Check returned value in BatteryStatus APIs test cases
https://bugs.webkit.org/show_bug.cgi?id=90665
Reviewed by Adam Barth.
It is good to compare with actual values to recognize what is difference.
* batterystatus/add-listener-from-callback-expected.txt:
* batterystatus/basic-all-types-of-events-expected.txt:
* batterystatus/basic-operation-expected.txt:
* batterystatus/script-tests/add-listener-from-callback.js:
(checkBatteryStatus):
* batterystatus/script-tests/basic-all-types-of-events.js:
(checkBatteryStatus):
* batterystatus/script-tests/basic-operation.js:
* batterystatus/script-tests/updates.js:
(checkBatteryStatus):
* batterystatus/updates-expected.txt:
2012-07-08 Zan Dobersek <zandobersek@gmail.com>
Unreviewed GTK gardening, remove a redundant baseline for the
......@@ -3,18 +3,18 @@ Tests that adding a new event listener from a callback works as expected.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS battery.charging is charging
PASS battery.chargingTime is chargingTime
PASS battery.dischargingTime is dischargingTime
PASS battery.level is level
PASS battery.charging is charging
PASS battery.chargingTime is chargingTime
PASS battery.dischargingTime is dischargingTime
PASS battery.level is level
PASS battery.charging is charging
PASS battery.chargingTime is chargingTime
PASS battery.dischargingTime is dischargingTime
PASS battery.level is level
PASS battery.charging is false
PASS battery.chargingTime is Infinity
PASS battery.dischargingTime is 6000
PASS battery.level is 0.7
PASS battery.charging is false
PASS battery.chargingTime is Infinity
PASS battery.dischargingTime is 6000
PASS battery.level is 0.7
PASS battery.charging is false
PASS battery.chargingTime is Infinity
PASS battery.dischargingTime is 6000
PASS battery.level is 0.7
PASS successfullyParsed is true
TEST COMPLETE
......
......@@ -4,25 +4,25 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
chargingchange event is raised
PASS battery.charging is charging
PASS battery.chargingTime is chargingTime
PASS battery.dischargingTime is dischargingTime
PASS battery.level is level
PASS battery.charging is false
PASS battery.chargingTime is Infinity
PASS battery.dischargingTime is 6000
PASS battery.level is 0.7
chargingtimechange event is raised
PASS battery.charging is charging
PASS battery.chargingTime is chargingTime
PASS battery.dischargingTime is dischargingTime
PASS battery.level is level
PASS battery.charging is false
PASS battery.chargingTime is Infinity
PASS battery.dischargingTime is 6000
PASS battery.level is 0.7
dischargingtimechange event is raised
PASS battery.charging is charging
PASS battery.chargingTime is chargingTime
PASS battery.dischargingTime is dischargingTime
PASS battery.level is level
PASS battery.charging is false
PASS battery.chargingTime is Infinity
PASS battery.dischargingTime is 6000
PASS battery.level is 0.7
levelchange event is raised
PASS battery.charging is charging
PASS battery.chargingTime is chargingTime
PASS battery.dischargingTime is dischargingTime
PASS battery.level is level
PASS battery.charging is false
PASS battery.chargingTime is Infinity
PASS battery.dischargingTime is 6000
PASS battery.level is 0.7
PASS successfullyParsed is true
TEST COMPLETE
......
......@@ -3,10 +3,10 @@ Tests the basic operation of BatteryStatus.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS battery.charging is charging
PASS battery.chargingTime is chargingTime
PASS battery.dischargingTime is dischargingTime
PASS battery.level is level
PASS battery.charging is false
PASS battery.chargingTime is Infinity
PASS battery.dischargingTime is 6000
PASS battery.level is 0.7
PASS successfullyParsed is true
TEST COMPLETE
......
......@@ -3,14 +3,14 @@ Tests using BatteryStatus from multiple frames.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS battery.charging is charging
PASS battery.chargingTime is chargingTime
PASS battery.dischargingTime is dischargingTime
PASS battery.level is level
PASS battery.charging is charging
PASS battery.chargingTime is chargingTime
PASS battery.dischargingTime is dischargingTime
PASS battery.level is level
PASS battery.charging is false
PASS battery.chargingTime is Infinity
PASS battery.dischargingTime is 6000
PASS battery.level is 0.7
PASS battery.charging is false
PASS battery.chargingTime is Infinity
PASS battery.dischargingTime is 6000
PASS battery.level is 0.7
PASS successfullyParsed is true
TEST COMPLETE
......
......@@ -8,10 +8,10 @@ var level = 0.7;
var battery = navigator.webkitBattery;
function checkBatteryStatus() {
shouldBe('battery.charging', 'charging');
shouldBe('battery.chargingTime', 'chargingTime');
shouldBe('battery.dischargingTime', 'dischargingTime');
shouldBe('battery.level', 'level');
shouldBe("battery.charging", "false");
shouldBe("battery.chargingTime", "Infinity");
shouldBe("battery.dischargingTime", "6000");
shouldBe("battery.level", "0.7");
}
var firstListenerEvents = 0;
......
......@@ -8,10 +8,10 @@ var level = 0.7;
var battery = navigator.webkitBattery;
function checkBatteryStatus() {
shouldBe('battery.charging', 'charging');
shouldBe('battery.chargingTime', 'chargingTime');
shouldBe('battery.dischargingTime', 'dischargingTime');
shouldBe('battery.level', 'level');
shouldBe("battery.charging", "false");
shouldBe("battery.chargingTime", "Infinity");
shouldBe("battery.dischargingTime", "6000");
shouldBe("battery.level", "0.7");
}
battery.addEventListener('chargingchange', function() {
......
......@@ -8,10 +8,10 @@ var level = 0.7;
var battery = navigator.webkitBattery;
battery.addEventListener('chargingchange', function() {
shouldBe('battery.charging', 'charging');
shouldBe('battery.chargingTime', 'chargingTime');
shouldBe('battery.dischargingTime', 'dischargingTime');
shouldBe('battery.level', 'level');
shouldBe("battery.charging", "false");
shouldBe("battery.chargingTime", "Infinity");
shouldBe("battery.dischargingTime", "6000");
shouldBe("battery.level", "0.7");
finishJSTest();
});
......
......@@ -8,17 +8,17 @@ var level = 0.7;
var battery = navigator.webkitBattery;
function checkBatteryStatus() {
shouldBe('battery.charging', 'charging');
shouldBe('battery.chargingTime', 'chargingTime');
shouldBe('battery.dischargingTime', 'dischargingTime');
shouldBe('battery.level', 'level');
shouldBe("battery.charging", "false");
shouldBe("battery.chargingTime", "Infinity");
shouldBe("battery.dischargingTime", "6000");
shouldBe("battery.level", "0.7");
}
function checkChildBatteryStatus() {
shouldBe('battery.charging', 'charging');
shouldBe('battery.chargingTime', 'chargingTime');
shouldBe('battery.dischargingTime', 'dischargingTime');
shouldBe('battery.level', 'level');
shouldBe("battery.charging", "false");
shouldBe("battery.chargingTime", "Infinity");
shouldBe("battery.dischargingTime", "6000");
shouldBe("battery.level", "0.7");
}
var hasMainFrameEventFired = false;
......
......@@ -8,10 +8,10 @@ var level = 0.7;
var battery = navigator.webkitBattery;
function checkBatteryStatus() {
shouldBe('battery.charging', 'charging');
shouldBe('battery.chargingTime', 'chargingTime');
shouldBe('battery.dischargingTime', 'dischargingTime');
shouldBe('battery.level', 'level');
shouldBe("battery.charging", "false");
shouldBe("battery.chargingTime", "Infinity");
shouldBe("battery.dischargingTime", "6000");
shouldBe("battery.level", "0.7");
}
function setBatteryStatus() {
......@@ -30,7 +30,10 @@ function firstListener() {
}
function updateListener(event) {
checkBatteryStatus(event);
shouldBe("battery.charging", "true");
shouldBe("battery.chargingTime", "7000");
shouldBe("battery.dischargingTime", "Infinity");
shouldBe("battery.level", "0.3");
finishJSTest();
}
......
......@@ -3,14 +3,14 @@ Tests that updates to the battery event causes new events to fire.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS battery.charging is charging
PASS battery.chargingTime is chargingTime
PASS battery.dischargingTime is dischargingTime
PASS battery.level is level
PASS battery.charging is charging
PASS battery.chargingTime is chargingTime
PASS battery.dischargingTime is dischargingTime
PASS battery.level is level
PASS battery.charging is false
PASS battery.chargingTime is Infinity
PASS battery.dischargingTime is 6000
PASS battery.level is 0.7
PASS battery.charging is true
PASS battery.chargingTime is 7000
PASS battery.dischargingTime is Infinity
PASS battery.level is 0.3
PASS successfullyParsed is true
TEST COMPLETE
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment