Chrome Version: trunk (refs/heads/master@#459418)
OS: All
What steps will reproduce the problem?
(1) Run following layout tests
inspector-protocol/emulation/device-emulation-320-2x.html
inspector-protocol/emulation/device-emulation-320-only-viewport.html
inspector-protocol/emulation/device-emulation-320.html
inspector-protocol/emulation/device-emulation-980-2x.html
inspector-protocol/emulation/device-emulation-980-only-viewport.html
inspector-protocol/emulation/device-emulation-980.html
inspector-protocol/emulation/device-emulation-controls.html
inspector-protocol/emulation/device-emulation-dw-2x.html
inspector-protocol/emulation/device-emulation-dw.html
inspector-protocol/emulation/device-emulation-initial-scale.html
inspector-protocol/emulation/device-emulation-insets.html
inspector-protocol/emulation/device-emulation-none-2x.html
inspector-protocol/emulation/device-emulation-none.html
inspector-protocol/emulation/device-emulation-restore.html
inspector-protocol/emulation/device-emulation-small-dw.html
inspector-protocol/emulation/device-emulation-small.html
What is the expected result?
Those tests should expect "window.orientation = 0" and pass
What happens instead?
They expect "window.orientation" and pass.
It means they expect "orientation" property is undefined on window.
The problem here is that DevToolsEmulator::enableMobileEmulation()
sets a runtime-enabled flag orientationEvent true, but it happens
after Blink instantiates function templates of Window interfaces in
bindings layer (V8DOMConfiguration::domClassTemplate()), so the flag
does not have effects in Javascript world.
This runtime-enabled flag should enable a new API window.orientation
but it is not installed in the template, and as a result, it is not
defined on "window" instance in Javascript.
Comment 1 by peria@chromium.org
, Mar 27 2017