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

Issue 329723005: Battery Status API: blink promise implementation and layout tests. (Closed)

Created:
6 years, 6 months ago by timvolodine
Modified:
6 years, 5 months ago
Reviewers:
jamesr, abarth-chromium
CC:
blink-reviews, dominicc (has gone to gerrit)
Visibility:
Public.

Description

Battery Status API: blink promise implementation and layout tests. Implement Battery Status API using promises in blink as according to the (modified) spec: https://dvcs.w3.org/hg/dap/raw-file/tip/battery/Overview.html. Using this patch the Battery Status API is accessible using: navigator.getBattery().then(...) syntax. Also added layout tests for the various use-cases. BUG=122593, 360068 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=176222

Patch Set 1 #

Patch Set 2 : fix fast/dom/Window/property-access-on-cached* tests. #

Total comments: 8

Patch Set 3 : Adam's comments + owners file #

Total comments: 2

Patch Set 4 : added vector of resolvers, added one more test for the "resolved" case #

Patch Set 5 : add TestExpectations #

Patch Set 6 : rebase #

Patch Set 7 : revert to a single resolver at a time #

Unified diffs Side-by-side diffs Delta from patch set Stats (+814 lines, -88 lines) Patch
M LayoutTests/TestExpectations View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
A LayoutTests/battery-status/api-defined.html View 1 chunk +74 lines, -0 lines 0 comments Download
A LayoutTests/battery-status/api-defined-expected.txt View 1 chunk +34 lines, -0 lines 0 comments Download
A LayoutTests/battery-status/multiple-promises.html View 1 chunk +75 lines, -0 lines 0 comments Download
A LayoutTests/battery-status/multiple-promises-after-resolve.html View 1 2 3 1 chunk +61 lines, -0 lines 0 comments Download
A LayoutTests/battery-status/multiple-promises-after-resolve-expected.txt View 1 2 3 1 chunk +23 lines, -0 lines 0 comments Download
A LayoutTests/battery-status/multiple-promises-expected.txt View 1 chunk +24 lines, -0 lines 0 comments Download
A LayoutTests/battery-status/multiple-windows.html View 1 chunk +67 lines, -0 lines 0 comments Download
A LayoutTests/battery-status/multiple-windows-expected.txt View 1 chunk +23 lines, -0 lines 0 comments Download
A LayoutTests/battery-status/multiple-windows-page-visibility.html View 1 chunk +92 lines, -0 lines 0 comments Download
A LayoutTests/battery-status/multiple-windows-page-visibility-expected.txt View 1 chunk +32 lines, -0 lines 0 comments Download
A LayoutTests/battery-status/page-visibility.html View 1 chunk +77 lines, -0 lines 0 comments Download
A LayoutTests/battery-status/page-visibility-expected.txt View 1 chunk +24 lines, -0 lines 0 comments Download
A LayoutTests/battery-status/promise-with-eventlisteners.html View 1 2 3 1 chunk +110 lines, -0 lines 0 comments Download
A LayoutTests/battery-status/promise-with-eventlisteners-expected.txt View 1 2 3 1 chunk +44 lines, -0 lines 0 comments Download
D LayoutTests/battery-status/test-battery-status-basic.html View 1 chunk +0 lines, -20 lines 0 comments Download
D LayoutTests/battery-status/test-battery-status-basic-expected.txt View 1 chunk +0 lines, -9 lines 0 comments Download
M LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-navigated-expected.txt View 1 1 chunk +0 lines, -8 lines 0 comments Download
M LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-and-gced-expected.txt View 1 1 chunk +0 lines, -8 lines 0 comments Download
M LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-expected.txt View 1 1 chunk +0 lines, -8 lines 0 comments Download
M LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-navigated-expected.txt View 1 1 chunk +0 lines, -8 lines 0 comments Download
M LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-and-gced-expected.txt View 1 1 chunk +0 lines, -8 lines 0 comments Download
M LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt View 1 1 chunk +0 lines, -8 lines 0 comments Download
M Source/modules/battery/BatteryManager.h View 1 2 4 5 6 4 chunks +13 lines, -1 line 0 comments Download
M Source/modules/battery/BatteryManager.cpp View 1 2 3 4 5 6 3 chunks +29 lines, -2 lines 0 comments Download
M Source/modules/battery/NavigatorBattery.h View 2 chunks +3 lines, -2 lines 0 comments Download
M Source/modules/battery/NavigatorBattery.cpp View 1 2 1 chunk +7 lines, -6 lines 0 comments Download
M Source/modules/battery/NavigatorBattery.idl View 1 chunk +1 line, -1 line 0 comments Download
A + Source/modules/battery/OWNERS View 1 2 0 chunks +-1 lines, --1 lines 0 comments Download

Messages

Total messages: 20 (0 generated)
timvolodine
6 years, 6 months ago (2014-06-11 14:42:30 UTC) #1
abarth-chromium
https://codereview.chromium.org/329723005/diff/20001/Source/modules/battery/BatteryManager.cpp File Source/modules/battery/BatteryManager.cpp (right): https://codereview.chromium.org/329723005/diff/20001/Source/modules/battery/BatteryManager.cpp#newcode68 Source/modules/battery/BatteryManager.cpp:68: } Why not just return m_resolver->promise(); at this point? ...
6 years, 6 months ago (2014-06-11 19:44:35 UTC) #2
timvolodine
thanks for the comments, please take another look. https://codereview.chromium.org/329723005/diff/20001/Source/modules/battery/BatteryManager.cpp File Source/modules/battery/BatteryManager.cpp (right): https://codereview.chromium.org/329723005/diff/20001/Source/modules/battery/BatteryManager.cpp#newcode68 Source/modules/battery/BatteryManager.cpp:68: } ...
6 years, 6 months ago (2014-06-12 16:38:46 UTC) #3
abarth-chromium
LGTM w/ comment below https://codereview.chromium.org/329723005/diff/40001/Source/modules/battery/BatteryManager.cpp File Source/modules/battery/BatteryManager.cpp (right): https://codereview.chromium.org/329723005/diff/40001/Source/modules/battery/BatteryManager.cpp#newcode43 Source/modules/battery/BatteryManager.cpp:43: m_resolver->resolve(this); It's strange that we ...
6 years, 6 months ago (2014-06-13 04:36:30 UTC) #4
timvolodine
https://codereview.chromium.org/329723005/diff/40001/Source/modules/battery/BatteryManager.cpp File Source/modules/battery/BatteryManager.cpp (right): https://codereview.chromium.org/329723005/diff/40001/Source/modules/battery/BatteryManager.cpp#newcode43 Source/modules/battery/BatteryManager.cpp:43: m_resolver->resolve(this); On 2014/06/13 04:36:30, abarth wrote: > It's strange ...
6 years, 6 months ago (2014-06-13 14:42:20 UTC) #5
abarth-chromium
On 2014/06/13 at 14:42:20, timvolodine wrote: > I've tried this code + > if (m_state ...
6 years, 6 months ago (2014-06-13 17:44:36 UTC) #6
timvolodine
On 2014/06/13 17:44:36, abarth wrote: > On 2014/06/13 at 14:42:20, timvolodine wrote: > > I've ...
6 years, 6 months ago (2014-06-13 17:56:38 UTC) #7
timvolodine
On 2014/06/13 17:56:38, timvolodine wrote: > On 2014/06/13 17:44:36, abarth wrote: > > On 2014/06/13 ...
6 years, 6 months ago (2014-06-13 18:54:50 UTC) #8
abarth-chromium
On 2014/06/13 at 18:54:50, timvolodine wrote: > > when I tried that, the test in ...
6 years, 6 months ago (2014-06-13 22:01:51 UTC) #9
abarth-chromium
+dominicc, because he was mentioning a similar problem with ScriptPromiseResolverWithContext he was having for service ...
6 years, 6 months ago (2014-06-13 22:03:09 UTC) #10
abarth-chromium
In summary, can we go back to the earlier version where you have one promise ...
6 years, 6 months ago (2014-06-13 22:04:00 UTC) #11
timvolodine
On 2014/06/13 22:01:51, abarth wrote: > On 2014/06/13 at 18:54:50, timvolodine wrote: > > > ...
6 years, 6 months ago (2014-06-13 23:35:43 UTC) #12
timvolodine
On 2014/06/13 22:04:00, abarth wrote: > In summary, can we go back to the earlier ...
6 years, 6 months ago (2014-06-13 23:37:48 UTC) #13
dominicc (has gone to gerrit)
Don't want to hijack your code review, but I was aware of ScriptPromiseResolver clearing the ...
6 years, 6 months ago (2014-06-14 21:51:04 UTC) #14
timvolodine
On 2014/06/14 21:51:04, dominicc wrote: > Don't want to hijack your code review, but I ...
6 years, 6 months ago (2014-06-16 16:53:09 UTC) #15
timvolodine
The CQ bit was checked by timvolodine@chromium.org
6 years, 6 months ago (2014-06-16 16:55:28 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/timvolodine@chromium.org/329723005/120001
6 years, 6 months ago (2014-06-16 16:56:08 UTC) #17
commit-bot: I haz the power
Change committed as 176222
6 years, 6 months ago (2014-06-16 17:00:20 UTC) #18
jamesr
The multiple-windows.html test is incredibly flaky: http://test-results.appspot.com/dashboards/flakiness_dashboard.html#group=%40ToT%20Blink&showExpectations=true&tests=battery-status%2Fmultiple-windows.html I'm going to disable it, please fix and ...
6 years, 6 months ago (2014-06-18 19:58:45 UTC) #19
timvolodine
6 years, 5 months ago (2014-07-03 12:07:48 UTC) #20
Message was sent while issue was closed.
On 2014/06/18 19:58:45, jamesr wrote:
> The multiple-windows.html test is incredibly flaky:
> 
>
http://test-results.appspot.com/dashboards/flakiness_dashboard.html#group=%40...
> 
> I'm going to disable it, please fix and re-enable.

FYI, fixed and re-enabled:
http://test-results.appspot.com/dashboards/flakiness_dashboard.html#group=%40...

Powered by Google App Engine
This is Rietveld 408576698