зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1819494 - Add functional test for GeckoSessionSettings.setDisplayMode. r=geckoview-reviewers,owlish
There is no tests for display mode with web content. So we should add it. Differential Revision: https://phabricator.services.mozilla.com/D171298
This commit is contained in:
Родитель
8f4015c3ee
Коммит
8eaf133428
|
@ -555,4 +555,24 @@ class ContentDelegateTest : BaseSessionTest() {
|
|||
mainSession.loadTestPath(HUNG_SCRIPT)
|
||||
sessionRule.waitForPageStop(mainSession)
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that the display mode is applied to CSS media query
|
||||
*/
|
||||
@Test fun displayMode() {
|
||||
val pwaSession = sessionRule.createOpenSession(
|
||||
GeckoSessionSettings.Builder(mainSession.settings)
|
||||
.displayMode(GeckoSessionSettings.DISPLAY_MODE_FULLSCREEN)
|
||||
.build()
|
||||
)
|
||||
pwaSession.loadTestPath(HELLO_HTML_PATH)
|
||||
pwaSession.waitForPageStop()
|
||||
|
||||
val matches = pwaSession.evaluateJS("window.matchMedia('(display-mode: fullscreen)').matches") as Boolean
|
||||
assertThat(
|
||||
"display-mode should be fullscreen",
|
||||
matches,
|
||||
equalTo(true)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче