CpuCapture implements ConfigurableDurationData { public boolean isDualClock() { return myCaptureSupportsDualClock; } CpuCapture(@NotNull TraceParser parser, long traceId, Cpu.CpuTraceType type); int getMainThreadId(); @NotNull Timeline getTimeline(); @NotNull Range getRange(); @Nullable CaptureNode getCaptureNode(int threadId); @NotNull Collection<CaptureNode> getCaptureNodes(); boolean containsThread(int threadId); @Override long getDurationUs(); @Override boolean getSelectableWhenMaxDuration(); long getTraceId(); @Override boolean canSelectPartialRange(); void updateClockType(@NotNull ClockType clockType); boolean isDualClock(); Cpu.CpuTraceType getType();  }
@Test public void dualClockPassedInConstructor() { CpuThreadInfo info = new CpuThreadInfo(10, "main"); Range range = new Range(0, 30); Map<CpuThreadInfo, CaptureNode> captureTrees = new ImmutableMap.Builder<CpuThreadInfo, CaptureNode>().put(info, new CaptureNode(new StubCaptureNodeModel())).build(); CpuCapture capture = new CpuCapture(new FakeTraceParser(range, captureTrees, true), 20, Cpu.CpuTraceType.UNSPECIFIED_TYPE); assertThat(capture.isDualClock()).isTrue(); capture = new CpuCapture(new FakeTraceParser(range, captureTrees, false), 20, Cpu.CpuTraceType.UNSPECIFIED_TYPE); assertThat(capture.isDualClock()).isFalse(); }