@Test
public void callStackNavigationChangesProfilerMode() {

  HttpData data = new HttpData.Builder(DEFAULT_DATA).build();
  myView.setHttpData(data);
  StackTrace stackTrace = new StackTrace(data);
  assertThat(stackTrace.getTrace()).isEqualTo(data.getTrace());
  assertThat(stackTrace.getCodeLocations()).hasSize(1);
  // Expands Profiler Mode
  myStage.getTimeline().getSelectionRange().set(0, 10);
  boolean[] modeChanged = {false};
  AspectObserver observer = new AspectObserver();
  myStage.getStudioProfilers().addDependency(observer).onChange(ProfilerAspect.MODE, () -> modeChanged[0] = true);
  assertThat(modeChanged[0]).isFalse();
  assertThat(myStage.getProfilerMode()).isEqualTo(ProfilerMode.EXPANDED);
  StackTraceView stackTraceView = findTab(myView, CallStackTabContent.class).getStackTraceView();
  stackTraceView.getModel().setSelectedIndex(0);
  assertThat(modeChanged[0]).isTrue();
  assertThat(myStage.getProfilerMode()).isEqualTo(ProfilerMode.NORMAL);
}