@Test
	public void testSetSelectionWithMouse() throws Exception {

		loadViews("Ascii", "Octal");

		ByteViewerComponent c = panel.getCurrentComponent();
		GoToService goToService = tool.getService(GoToService.class);
		goToService.goTo(addr(0x01001004));

		Point startPoint = c.getCursorPoint();

		goToByte("0x010010bc");
		Point endPoint = c.getCursorPoint();

		dragMouse(c, 1, startPoint.x, startPoint.y, endPoint.x, endPoint.y, 0);
		waitForSwing();

		ByteBlockSelection sel = c.getViewerSelection();
		ByteViewerComponent octal = findComponent(panel, "Octal");
		assertTrue(byteBlockSelectionEquals(sel, octal.getViewerSelection()));

		ProgramSelection psel = cbPlugin.getCurrentSelection();
		ByteBlockSelection bsel = panel.getViewerSelection();

		// convert bsel to an address set
		AddressSet set =
			((ProgramByteBlockSet) plugin.getProvider().getByteBlockSet()).getAddressSet(bsel);
		assertTrue(psel.hasSameAddresses(set));
	}
Basic tests for the byte view plugin
Ghidra/Features/ByteViewer/src/test.slow/java/ghidra/app/plugin/core/byteviewer/ByteViewerPlugin1Test.java