mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-19 21:06:09 +00:00
fix: droiddeckctl reaches builds shipped under a variant package The provider authority and the start Activity's component were fixed to com.droiddeck.launcher, so droiddeckctl could not talk to the antutu, ludashi or pubg builds from tools/release/variants.txt. DROIDDECK_PACKAGE now picks the package; the Activity's class name stays the same in every variant. Co-authored-by: angelrenefm <17342133+angelrenefm@users.noreply.github.com>
This commit is contained in:
1 parent
eb22557702
commit
d2bab8970d
3 files changed
+16
-3
No files matched your search
@@ -12,6 +12,7 @@ import sys
|
||||
import tempfile
|
||||
import textwrap
|
||||
import unittest
|
||||
import unittest.mock
|
||||
|
||||
TOOLS = Path(__file__).resolve().parents[1]
|
||||
sys.path.insert(0, str(TOOLS))
|
||||
@@ -122,6 +123,15 @@ class DroiddeckctlTest(FakeAdbTest):
|
||||
self.assertEqual("INVALID_REQUEST", caught.exception.code)
|
||||
self.assertFalse(self.calls())
|
||||
|
||||
def test_a_variant_package_is_reached_through_its_own_provider_and_activity(self):
|
||||
with unittest.mock.patch.dict(os.environ, {"DROIDDECK_PACKAGE": "com.antutu.benchmark.full"}):
|
||||
variant = load("droiddeckctl")
|
||||
self.assertEqual("content://com.antutu.benchmark.full.agent", variant.AUTHORITY)
|
||||
with self.assertRaises(variant.ControlError): # the fake adb does not answer `am start`
|
||||
variant.start_agent_activity(str(self.adb), "fake-1", {"mode": "steam"})
|
||||
started = [e["args"] for e in self.calls() if e["args"][:3] == ["shell", "am", "start"]]
|
||||
self.assertIn("com.antutu.benchmark.full/com.droiddeck.launcher.agent.AgentStartActivity", started[0])
|
||||
|
||||
def test_state_passes_through_with_the_serial(self):
|
||||
self.configure({"state": state()})
|
||||
code, out = self.run_ctl("state")
|
||||
|
||||
Reference in new issue
Block a user