diff options
author | Arnaud Berry <arnaudberry@google.com> | 2019-05-16 16:52:30 -0700 |
---|---|---|
committer | Arnaud Berry <arnaudberry@google.com> | 2019-05-21 18:56:32 -0700 |
commit | b6d873275f754b1dbd72f02ff2295219adf5373a (patch) | |
tree | 1bb51843a2f9c6f01e9568d658d404f392368a21 /TestMediaApp/assets | |
parent | d003b9e3fc81bb6fbf2ab320c0c9351cc2347075 (diff) | |
download | tests-b6d873275f754b1dbd72f02ff2295219adf5373a.tar.gz |
Create Test Media App
This application is intended to help test the Car/Media app by making it
easy to send it media items and playback states. Those media items are
bundled within the assets of the TestMediaApp, as very readable json files.
Quick overview:
- loader package interprets the json files
- prefs package implements the app's preferences
(account type, root node, reply delay)
- TmaBrowser implements the MediaBrowserService. It send replies
based on the content of the prefs and the json files
- TmaLibrary caches the interpreted files
- TmaPlayer simulates all media interactions (without playing any sound)
- TmaMediaItem represents the media items of the test app
- TmaMediaEvent represents playback events to send to the media session
Test: manual
Change-Id: I5f4e6c537d8d0e49d4f5a1dc958e73722b78534e
Diffstat (limited to 'TestMediaApp/assets')
-rw-r--r-- | TestMediaApp/assets/media_items/empty.json | 6 | ||||
-rw-r--r-- | TestMediaApp/assets/media_items/mixed.json | 54 | ||||
-rw-r--r-- | TestMediaApp/assets/media_items/only_nodes.json | 38 | ||||
-rw-r--r-- | TestMediaApp/assets/media_items/simple_leaves.json | 94 |
4 files changed, 192 insertions, 0 deletions
diff --git a/TestMediaApp/assets/media_items/empty.json b/TestMediaApp/assets/media_items/empty.json new file mode 100644 index 0000000..ba35267 --- /dev/null +++ b/TestMediaApp/assets/media_items/empty.json @@ -0,0 +1,6 @@ +{ + "FLAGS": "", + "METADATA": { + "MEDIA_ID": "empty" + } +}
\ No newline at end of file diff --git a/TestMediaApp/assets/media_items/mixed.json b/TestMediaApp/assets/media_items/mixed.json new file mode 100644 index 0000000..872fa4f --- /dev/null +++ b/TestMediaApp/assets/media_items/mixed.json @@ -0,0 +1,54 @@ +{ + "FLAGS": "browsable", + "PLAYABLE_HINT": "GRID", + "BROWSABLE_HINT": "LIST", + + "METADATA": { + "MEDIA_ID": "mixed", + "DISPLAY_TITLE": "Only nodes" + }, + + "CHILDREN": [ + { + "FLAGS": "playable", + "METADATA": { + "MEDIA_ID": "mixed normal 15s song", + "DISPLAY_TITLE": "A normal 15s song", + "DURATION": 15000 + } + }, + { + "FLAGS": "playable", + "METADATA": { + "MEDIA_ID": "mixed normal 20s song", + "DISPLAY_TITLE": "A normal 20s song", + "DURATION": 20000 + } + }, + { + "FLAGS": "browsable", + "METADATA": { + "MEDIA_ID": "mixed simple_leaves", + "DISPLAY_TITLE": "Basic songs" + }, + "INCLUDE":"media_items/simple_leaves.json" + }, + { + "FLAGS": "browsable", + "PLAYABLE_HINT": "LIST", + "BROWSABLE_HINT": "GRID", + "METADATA": { + "MEDIA_ID": "mixed rabbit hole", + "DISPLAY_TITLE": "Rabbit hole" + }, + "INCLUDE":"media_items/only_nodes.json" + }, + { + "FLAGS": "browsable", + "METADATA": { + "MEDIA_ID": "mixed empty mix", + "DISPLAY_TITLE": "Empty mix" + } + } + ] +}
\ No newline at end of file diff --git a/TestMediaApp/assets/media_items/only_nodes.json b/TestMediaApp/assets/media_items/only_nodes.json new file mode 100644 index 0000000..c9884f5 --- /dev/null +++ b/TestMediaApp/assets/media_items/only_nodes.json @@ -0,0 +1,38 @@ +{ + "FLAGS": "browsable", + "PLAYABLE_HINT": "LIST", + "BROWSABLE_HINT": "GRID", + + "METADATA": { + "MEDIA_ID": "only_nodes", + "DISPLAY_TITLE": "Only nodes" + }, + + "CHILDREN": [ + { + "FLAGS": "browsable", + "METADATA": { + "MEDIA_ID": "only_nodes simple_leaves", + "DISPLAY_TITLE": "Basic songs" + }, + "INCLUDE":"media_items/simple_leaves.json" + }, + { + "FLAGS": "browsable", + "PLAYABLE_HINT": "GRID", + "BROWSABLE_HINT": "LIST", + "METADATA": { + "MEDIA_ID": "only_nodes rabbit hole", + "DISPLAY_TITLE": "Rabbit hole 2" + }, + "INCLUDE":"media_items/mixed.json" + }, + { + "FLAGS": "browsable", + "METADATA": { + "MEDIA_ID": "only_nodes empty node 1", + "DISPLAY_TITLE": "Empty node 1" + } + } + ] +}
\ No newline at end of file diff --git a/TestMediaApp/assets/media_items/simple_leaves.json b/TestMediaApp/assets/media_items/simple_leaves.json new file mode 100644 index 0000000..40758c5 --- /dev/null +++ b/TestMediaApp/assets/media_items/simple_leaves.json @@ -0,0 +1,94 @@ +{ + "FLAGS": "browsable", + + "METADATA": { + "MEDIA_ID": "simple_leaves", + "DISPLAY_TITLE": "Simple leaves" + }, + + "CHILDREN": [ + { + "FLAGS": "playable", + "METADATA": { + "MEDIA_ID": "simple_leaves normal 10s song", + "DISPLAY_TITLE": "A normal 10s song", + "DURATION": 10000 + } + }, + { + "FLAGS": "playable", + "METADATA": { + "MEDIA_ID": "simple_leaves normal 1H song", + "DISPLAY_TITLE": "A normal 1H song", + "DURATION": 3600000 + } + }, + { + "FLAGS": "playable", + "METADATA": { + "MEDIA_ID": "simple_leaves slow connection", + "DISPLAY_TITLE": "Connects and buffers for 4s each", + "DURATION": 30000 + }, + "EVENTS": [ + { "STATE": "CONNECTING", "POST_DELAY_MS": 50 }, + { "STATE": "BUFFERING", "POST_DELAY_MS": 4000 }, + { "STATE": "PLAYING", "POST_DELAY_MS": 4000 } + ] + }, + { + "FLAGS": "playable", + "METADATA": { + "MEDIA_ID": "simple_leaves poor internet", + "DISPLAY_TITLE": "Poor internet quality at 2s", + "DURATION": 30000 + }, + "EVENTS": [ + { "STATE": "PLAYING", "POST_DELAY_MS": 0 }, + { + "STATE": "PLAYING", + "ERROR_CODE": "APP_ERROR", + "ERROR_MESSAGE": "Bad connection, sorry for the low quality", + "POST_DELAY_MS": 2000 + } + ] + }, + { + "FLAGS": "playable", + "METADATA": { + "MEDIA_ID": "simple_leaves cache failure", + "DISPLAY_TITLE": "Caching failure at 2s", + "DURATION": 30000 + }, + "EVENTS": [ + { "STATE": "PLAYING", "POST_DELAY_MS": 0 }, + { + "STATE": "PAUSED", + "ERROR_CODE": "APP_ERROR", + "ERROR_MESSAGE": "End of cache reached. Please check your data connection.", + "POST_DELAY_MS": 2000 + } + ] + }, + + { + "FLAGS": "playable", + "METADATA": { + "MEDIA_ID": "simple_leaves premium required", + "DISPLAY_TITLE": "Paid account required at 2s", + "DURATION": 50000 + }, + "EVENTS": [ + { "STATE": "PLAYING", "POST_DELAY_MS": 0 }, + { + "STATE": "ERROR", + "ERROR_CODE": "PREMIUM_ACCOUNT_REQUIRED", + "ERROR_MESSAGE": "A premium account is needed to play this track completely...", + "ACTION_LABEL": "Upgrade now", + "INTENT": "PREFS", + "POST_DELAY_MS": 2000 + } + ] + } + ] +}
\ No newline at end of file |