private void checkFixes(String name, String caretLocation) throws Exception {
    IProject project = getProject();
    IFile file = getTestDataFile(project, name, FD_RES + "/" + FD_RES_LAYOUT + "/" + name);

    // Determine the offset
    String fileContent = AdtPlugin.readFile(file);
    int caretDelta = caretLocation.indexOf("^");
    assertTrue(caretLocation, caretDelta != -1);
    String caretContext =
        caretLocation.substring(0, caretDelta) + caretLocation.substring(caretDelta + "^".length());
    int caretContextIndex = fileContent.indexOf(caretContext);
    assertTrue("Caret content " + caretContext + " not found in file", caretContextIndex != -1);
    final int offset = caretContextIndex + caretDelta;

    RefactoringAssistant refactoringAssistant = new RefactoringAssistant();

    // Open file
    IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
    assertNotNull(page);
    IEditorPart editor = IDE.openEditor(page, file);
    assertTrue(editor instanceof AndroidXmlEditor);
    AndroidXmlEditor layoutEditor = (AndroidXmlEditor) editor;
    final ISourceViewer viewer = layoutEditor.getStructuredSourceViewer();

    IQuickAssistInvocationContext invocationContext =
        new IQuickAssistInvocationContext() {
          @Override
          public int getLength() {
            return 0;
          }

          @Override
          public int getOffset() {
            return offset;
          }

          @Override
          public ISourceViewer getSourceViewer() {
            return viewer;
          }
        };
    ICompletionProposal[] proposals =
        refactoringAssistant.computeQuickAssistProposals(invocationContext);

    if (proposals != null) {
      for (ICompletionProposal proposal : proposals) {
        assertNotNull(proposal.getAdditionalProposalInfo());
        assertNotNull(proposal.getImage());
      }
    }

    StringBuilder sb = new StringBuilder(1000);
    sb.append("Quick assistant in " + name + " for " + caretLocation + ":\n");
    if (proposals != null) {
      for (ICompletionProposal proposal : proposals) {
        sb.append(proposal.getDisplayString());
        String help = proposal.getAdditionalProposalInfo();
        if (help != null && help.trim().length() > 0) {
          sb.append(" : ");
          sb.append(help.replace('\n', ' '));
        }
        sb.append('\n');
      }
    } else {
      sb.append("None found.\n");
    }
    assertEqualsGolden(name, sb.toString(), "txt");

    // No "apply" test on these assists since they are interactive. Refactoring
    // is tested elsewhere.
  }