mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
testing autopopup concurrency
This commit is contained in:
+30
-20
@@ -17,8 +17,6 @@ package com.intellij.codeInsight.completion
|
||||
|
||||
import com.intellij.codeInsight.lookup.Lookup
|
||||
import com.intellij.openapi.actionSystem.IdeActions
|
||||
import com.intellij.openapi.application.ApplicationManager
|
||||
import com.intellij.openapi.application.ModalityState
|
||||
import com.intellij.openapi.command.CommandProcessor
|
||||
|
||||
/**
|
||||
@@ -252,13 +250,13 @@ class JavaAutoPopupTest extends CompletionAutoPopupTestCase {
|
||||
}
|
||||
""")
|
||||
type 'ite'
|
||||
ApplicationManager.application.invokeAndWait({
|
||||
myFixture.type 'r'
|
||||
lookup.markReused()
|
||||
lookup.currentItem = lookup.items[0]
|
||||
CommandProcessor.instance.executeCommand project, ({lookup.finishLookup Lookup.NORMAL_SELECT_CHAR} as Runnable), null, null
|
||||
edt {
|
||||
myFixture.type 'r'
|
||||
lookup.markReused()
|
||||
lookup.currentItem = lookup.items[0]
|
||||
CommandProcessor.instance.executeCommand project, ({lookup.finishLookup Lookup.NORMAL_SELECT_CHAR} as Runnable), null, null
|
||||
|
||||
} as Runnable, ModalityState.NON_MODAL)
|
||||
}
|
||||
myFixture.checkResult """
|
||||
class A { Iterable iterable;
|
||||
{ iterable<caret> }
|
||||
@@ -273,14 +271,13 @@ class JavaAutoPopupTest extends CompletionAutoPopupTestCase {
|
||||
}
|
||||
""")
|
||||
type 'ite'
|
||||
ApplicationManager.application.invokeAndWait({
|
||||
myFixture.type 'r'
|
||||
lookup.markReused()
|
||||
myFixture.type '\b\b'
|
||||
lookup.currentItem = lookup.items[0]
|
||||
CommandProcessor.instance.executeCommand project, ({lookup.finishLookup Lookup.NORMAL_SELECT_CHAR} as Runnable), null, null
|
||||
|
||||
} as Runnable, ModalityState.NON_MODAL)
|
||||
edt {
|
||||
myFixture.type 'r'
|
||||
lookup.markReused()
|
||||
myFixture.type '\b\b'
|
||||
lookup.currentItem = lookup.items[0]
|
||||
CommandProcessor.instance.executeCommand project, ({lookup.finishLookup Lookup.NORMAL_SELECT_CHAR} as Runnable), null, null
|
||||
}
|
||||
myFixture.checkResult """
|
||||
class A { Iterable iterable;
|
||||
{ iterable<caret> }
|
||||
@@ -295,10 +292,7 @@ class JavaAutoPopupTest extends CompletionAutoPopupTestCase {
|
||||
}
|
||||
""")
|
||||
type 'th'
|
||||
ApplicationManager.application.invokeAndWait({
|
||||
myFixture.type 'r'
|
||||
myFixture.type '\t'
|
||||
} as Runnable, ModalityState.NON_MODAL)
|
||||
edt { myFixture.type 'r\t'}
|
||||
myFixture.checkResult """
|
||||
class A {
|
||||
{ throw new <caret> }
|
||||
@@ -306,4 +300,20 @@ class JavaAutoPopupTest extends CompletionAutoPopupTestCase {
|
||||
"""
|
||||
}
|
||||
|
||||
public void testTwoQuickRestartsAfterHiding() {
|
||||
myFixture.configureByText("a.java", """
|
||||
class A {
|
||||
{ <caret> }
|
||||
}
|
||||
""")
|
||||
edt { myFixture.type 'A' }
|
||||
joinAlarm() // completion started
|
||||
edt { assert lookup; myFixture.type 'IO' }
|
||||
joinAlarm()
|
||||
joinAlarm()
|
||||
joinCompletion()
|
||||
assert lookup
|
||||
assert 'ArrayIndexOutOfBoundsException' in myFixture.lookupElementStrings
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user