mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[remote-driver] fix JCefUI
GitOrigin-RevId: 78f642297735a0625bee4341698d0340524b6247
This commit is contained in:
committed by
intellij-monorepo-bot
parent
5f44d48b99
commit
5b394dc5ef
@@ -44,6 +44,7 @@ fun Finder.jcef(@Language("xpath") xpath: String? = null, action: JCefUI.() -> U
|
||||
class JCefUI(data: ComponentData) : UiComponent(data) {
|
||||
private val jcefWorker by lazy {
|
||||
driver.new(JcefComponentWrapper::class, component).apply {
|
||||
waitFor("Document exists") { hasDocument() }
|
||||
runJs(initScript)
|
||||
}
|
||||
}
|
||||
@@ -94,7 +95,6 @@ class JCefUI(data: ComponentData) : UiComponent(data) {
|
||||
fun getUrl(): String = jcefWorker.getUrl()
|
||||
|
||||
fun getHtml(): String {
|
||||
waitFor("Document exists") { hasDocument() }
|
||||
return callJs("""document.documentElement.outerHTML""")
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -49,10 +49,10 @@ internal class JcefComponentWrapper(private val component: Component) {
|
||||
jbCefBrowser = currentComponent.getClientProperty(JB_BROWSER_KEY)
|
||||
currentComponent = currentComponent.parent as JComponent
|
||||
}
|
||||
require(jbCefBrowser != null) {
|
||||
check(jbCefBrowser != null) {
|
||||
"Failed to retrieve jbCefBrowser from $component"
|
||||
}
|
||||
require(jbCefBrowser is JBCefBrowserBase) {
|
||||
check(jbCefBrowser is JBCefBrowserBase) {
|
||||
"$jbCefBrowser is not JBCefBrowser"
|
||||
}
|
||||
return jbCefBrowser
|
||||
|
||||
Reference in New Issue
Block a user