android: downloads on Wi-Fi only
One switch the desktop never needed, off by default: on mobile data every Save the phone can start — a record, a track, a folder, a file, a playlist's bulk, the now-playing Save — waits, with the reason on the bar; streaming is never held back. The walk flips the switch, makes the connection cellular and sees a download refused.
This commit is contained in:
1 parent
3c8989dfa6
commit
694a29eb0d
10 files changed
+55
-5
No files matched your search
@@ -117,6 +117,7 @@ const PROBE = `(function () {
|
||||
jump: document.querySelectorAll('.screen .rail .release').length,
|
||||
countline: (document.querySelector('.countline .t-sub') || {}).textContent || '',
|
||||
navBadges: [].map.call(document.querySelectorAll('.nav .nb'), function (b) { return b.textContent.trim(); }).join('|'),
|
||||
wifiOnly: (function () { var r = [].slice.call(document.querySelectorAll('.screen .row')).find(function (x) { return /Wi-Fi only/.test(x.textContent); }); return r ? (r.querySelector('.sw.on') ? 'on' : 'off') : ''; })(),
|
||||
firstBadge: (document.querySelector('.grid2 .release .ed-badge') || {}).textContent || '',
|
||||
plthumbs: document.querySelectorAll('.pl-rows .thumb img').length,
|
||||
imp: document.querySelectorAll('.imp-rows .trk').length,
|
||||
@@ -383,6 +384,11 @@ const MOCK_STEPS = [
|
||||
{ do: `__click('.screen .row', 'Word-by-word')`, wait: 400 },
|
||||
{ do: `__click('.prefs[data-mode="albumart"] .chip', '1000 px')`, name: "you-artedge", wait: 500 },
|
||||
{ do: `__click('.prefs[data-mode="albumart"] .chip', '1500 px')`, wait: 400 },
|
||||
/* downloads on Wi-Fi only: the switch on, the connection made cellular, a download refused; then off */
|
||||
{ do: `__click('.screen .row', 'Wi-Fi only')`, name: "wifi-on", wait: 400 },
|
||||
{ do: `(function () { try { Object.defineProperty(navigator, 'connection', { value: { type: 'cellular' }, configurable: true }); } catch (e) {} return __ss.wifi.downloadsAllowed(); })()`, name: "wifi-refused", wait: 400 },
|
||||
{ do: `__click('.toast:not(.notice)', null)`, wait: 300 },
|
||||
{ do: `__click('.screen .row', 'Wi-Fi only')`, name: "wifi-off", wait: 400 },
|
||||
{ do: `__click('.screen .row', 'Clear play history')`, name: "history-confirm", wait: 600 },
|
||||
{ do: `__click('.halfsheet .prompt-acts .btn-fill', 'Clear')`, name: "history-cleared", wait: 800 },
|
||||
/* recent searches on the empty page: the ones this walk used */
|
||||
@@ -413,6 +419,9 @@ const MOCK_EXPECT = {
|
||||
"you-slots": (i) => i.slots === "3",
|
||||
"you-words": (i) => i.wordfill === "on",
|
||||
"you-artedge": (i) => i.artEdge === "1000 px",
|
||||
"wifi-on": (i) => i.wifiOnly === "on",
|
||||
"wifi-refused": (i) => /Wi-Fi/.test(i.toast),
|
||||
"wifi-off": (i) => i.wifiOnly === "off" && !i.toast,
|
||||
"history-confirm": (i) => i.half.includes("up") && /Clear the play history/.test(i.halfText),
|
||||
"history-cleared": (i) => !i.half.includes("up") && /history cleared/i.test(i.notice),
|
||||
"search-recent": (i) => i.title.startsWith("Search") && i.recents >= 1 && i.jump >= 1,
|
||||
|
||||
Reference in new issue
Block a user