summaryrefslogtreecommitdiffstats
path: root/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/DisplayTest.kt
blob: 86c8e9cac6e6e02dcbe1aa4fb8e906b4b4cfb997 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package org.mozilla.geckoview.test

import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.MediumTest
import org.hamcrest.Matchers.* // ktlint-disable no-wildcard-imports
import org.junit.Test
import org.junit.runner.RunWith

@RunWith(AndroidJUnit4::class)
@MediumTest
class DisplayTest : BaseSessionTest() {

    @Test(expected = IllegalStateException::class)
    fun doubleAcquire() {
        val display = mainSession.acquireDisplay()
        assertThat("Display should not be null", display, notNullValue())
        try {
            mainSession.acquireDisplay()
        } finally {
            mainSession.releaseDisplay(display)
        }
    }
}