mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-20 13:26:02 +00:00
fix: droiddeckctl pacing reads timestats dumps with Windows line ends (#2186)
This commit is contained in:
1 parent
aba55031c3
commit
7c429f3a26
2 files changed
+6
No files matched your search
@@ -295,6 +295,7 @@ def record(adb: str, serial: str, path: str, seconds: float, display: int | None
|
||||
|
||||
|
||||
def pacing_summary(text: str, package: str = PACKAGE) -> dict:
|
||||
text = text.replace("\r\n", "\n")
|
||||
records = {"game": [], "surface": []}
|
||||
for part in re.split(r"^displayRefreshRate = ", text, flags=re.M)[1:]:
|
||||
rate = re.match(r"(\d+)", part)
|
||||
|
||||
@@ -344,6 +344,11 @@ class DroiddeckctlTest(FakeAdbTest):
|
||||
self.assertEqual(248, summary["offCadence"])
|
||||
self.assertEqual(13.8, summary["offCadencePercent"])
|
||||
|
||||
def test_pacing_reads_a_dump_with_windows_line_ends(self):
|
||||
summary = ctl.pacing_summary(TIMESTATS_SPLIT.replace("\n", "\r\n"), "com.droiddeck.launcher")
|
||||
self.assertEqual(ctl.pacing_summary(TIMESTATS_SPLIT, "com.droiddeck.launcher"), summary)
|
||||
self.assertEqual(1800, summary["frames"])
|
||||
|
||||
def test_pacing_falls_back_to_the_sessions_surfaceview(self):
|
||||
summary = ctl.pacing_summary(TIMESTATS_SURFACEVIEW, "com.droiddeck.launcher")
|
||||
self.assertEqual(1, len(summary["layers"]))
|
||||
|
||||
Reference in new issue
Block a user