Skip to content

Commit

Permalink
Fix and re-enable AswbGotoDeclarationTest
Browse files Browse the repository at this point in the history
AswbGotoDeclarationTest#gotoDeclaration_withExternalResources
has been disabled by itself since it's the only remaining test
that fails.

PiperOrigin-RevId: 357775638
  • Loading branch information
Googler authored and copybara-github committed Feb 16, 2021
1 parent b827ee3 commit 3da61a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
3 changes: 0 additions & 3 deletions aswb/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ intellij_integration_test_suite(
"android-studio-4.1": glob(
["tests/integrationtests/**/*.java"],
exclude = [
"tests/integrationtests/com/google/idea/blaze/android/AswbGotoDeclarationTest.java",
"tests/integrationtests/com/google/idea/blaze/android/cppimpl/debug/BlazeAndroidNativeDebuggingTest.java",
"tests/integrationtests/com/google/idea/blaze/android/functional/BlazeModuleSystemDependentLibrariesIntegrationTest.java",
"tests/integrationtests/com/google/idea/blaze/android/plugin/NdkDependenciesTest.java", # Extracted to separate target
Expand All @@ -150,14 +149,12 @@ intellij_integration_test_suite(
"android-studio-4.2": glob(
["tests/integrationtests/**/*.java"],
exclude = [
"tests/integrationtests/com/google/idea/blaze/android/AswbGotoDeclarationTest.java",
"tests/integrationtests/com/google/idea/blaze/android/plugin/NdkDependenciesTest.java", # Extracted to separate target
],
),
"android-studio-2020.3": glob(
["tests/integrationtests/**/*.java"],
exclude = [
"tests/integrationtests/com/google/idea/blaze/android/AswbGotoDeclarationTest.java",
"tests/integrationtests/com/google/idea/blaze/android/plugin/NdkDependenciesTest.java", # Extracted to separate target
# b/177371104
"tests/integrationtests/com/google/idea/blaze/android/functional/AswbRenderTaskTest.java",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
import com.intellij.psi.PsiElement;
import com.intellij.util.io.URLUtil;
import java.io.File;
import org.jetbrains.android.dom.wrappers.LazyValueResourceElementWrapper;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
Expand All @@ -57,6 +57,7 @@ public void clearAarCache() {
AarResourceRepositoryCache.getInstance().clear();
}

@Ignore("b/180144913")
@Test
public void gotoDeclaration_withExternalResources() {
VirtualFile mainActivity =
Expand Down Expand Up @@ -268,9 +269,8 @@ public void gotoDeclaration_fromAarResourceToAarResources() {
private void assertGotoDeclarationOpensFile(String highLightElement, VirtualFile expectedFile) {
int referenceIndex = testFixture.getEditor().getDocument().getText().indexOf(highLightElement);
PsiElement foundElement =
LazyValueResourceElementWrapper.computeLazyElement(
GotoDeclarationAction.findTargetElement(
getProject(), testFixture.getEditor(), referenceIndex));
GotoDeclarationAction.findTargetElement(
getProject(), testFixture.getEditor(), referenceIndex);

assertThat(foundElement).isNotNull();
assertThat(foundElement.getContainingFile()).isNotNull();
Expand Down

0 comments on commit 3da61a1

Please sign in to comment.