StudioProfilersView extends AspectObserver implements Disposable { @VisibleForTesting @NotNull JToggleButton getGoLiveButton() { return myGoLive; } StudioProfilersView(@NotNull StudioProfilers profiler, @NotNull IdeProfilerComponents ideProfilerComponents); @Override void dispose(); @VisibleForTesting void bind(@NotNull Class<S> clazz,
                                                          @NotNull BiFunction<StudioProfilersView, S, T> constructor); @VisibleForTesting @NotNull CommonButton getZoomToSelectionButton(); @VisibleForTesting HoverHyperlinkLabel getDeselectAllLabel(); @VisibleForTesting JPanel getDeselectAllToolbar(); @VisibleForTesting StageView getStageView(); @NotNull StudioProfilers getStudioProfilers(); @NotNull JLayeredPane getComponent(); void installCommonMenuItems(@NotNull JComponent component); @NotNull IdeProfilerComponents getIdeProfilerComponents(); @NotNull static final String ATTACH_LIVE; @NotNull static final String DETACH_LIVE; @NotNull static final String ZOOM_IN; @NotNull static final String ZOOM_OUT; }
@Test public void testGoLiveButtonWhenToggleStreaming() { JToggleButton liveButton = myView.getGoLiveButton(); assertThat(liveButton.isEnabled()).isTrue(); myProfilers.getTimeline().setStreaming(false); assertThat(liveButton.isSelected()).isFalse(); assertThat(liveButton.getIcon()).isEqualTo(StudioIcons.Profiler.Toolbar.GOTO_LIVE); assertThat(liveButton.getToolTipText()).startsWith(StudioProfilersView.ATTACH_LIVE); myProfilers.getTimeline().setStreaming(true); assertThat(liveButton.isSelected()).isTrue(); assertThat(liveButton.getIcon()).isEqualTo(StudioIcons.Profiler.Toolbar.PAUSE_LIVE); assertThat(liveButton.getToolTipText()).startsWith(StudioProfilersView.DETACH_LIVE); }