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

Unified Diff: LayoutTests/battery-status/multiple-promises.html

Issue 976373002: Return same promise consistently when using navigator.getBattery() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase, make compile, fix comment 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 | LayoutTests/battery-status/multiple-promises-after-resolve.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/battery-status/multiple-promises.html
diff --git a/LayoutTests/battery-status/multiple-promises.html b/LayoutTests/battery-status/multiple-promises.html
index a8eb5fdcedd5d87c27429a7b0461621ee510b2e3..5b3c8500b67fa7f8ed5b6eee4116b2d99ce48135 100644
--- a/LayoutTests/battery-status/multiple-promises.html
+++ b/LayoutTests/battery-status/multiple-promises.html
@@ -48,7 +48,8 @@ function finishIfReady() {
setTimeout(finishJSTest, 0);
}
-promise1 = navigator.getBattery().then(
+promise1 = navigator.getBattery();
+promise1.then(
function(battery) {
debug('first resolution');
checkBatteryInfo(battery);
@@ -56,7 +57,8 @@ promise1 = navigator.getBattery().then(
finishIfReady();
}, batteryStatusFailure);
-promise2 = navigator.getBattery().then(
+promise2 = navigator.getBattery();
+promise2.then(
function(battery) {
debug('second resolution');
checkBatteryInfo(battery);
@@ -64,7 +66,7 @@ promise2 = navigator.getBattery().then(
finishIfReady();
}, batteryStatusFailure);
-shouldBeFalse('promise1 === promise2');
+shouldBeTrue('promise1 === promise2');
setAndFireMockBatteryInfo(false, 10, 20, 0.5);
</script>
</body>
« no previous file with comments | « no previous file | LayoutTests/battery-status/multiple-promises-after-resolve.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698