Skip to content

Commit

Permalink
test: Disable offline for Xbox One (#4232)
Browse files Browse the repository at this point in the history
Xbox One tests have been failing often for some time now, so it went
unnoticed that offline was not working.  It seems that IndexedDB is
not working properly on Xbox, and the platform throws `UnknownError`.

This restricts offline so that it is not triggered on Xbox One, and
this also fixes the filtering of our offline tests to respect the
offline storage muxer's support method.
  • Loading branch information
joeyparrish committed May 17, 2022
1 parent 0482aec commit de0a5b6
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 4 deletions.
6 changes: 4 additions & 2 deletions lib/offline/indexeddb/storage_mechanism.js
Expand Up @@ -368,8 +368,10 @@ shaka.offline.indexeddb.StorageMechanism.SESSION_ID_STORE = 'session-ids';
shaka.offline.StorageMuxer.register(
'idb',
() => {
// Offline storage is not supported on the Chromecast platform.
if (shaka.util.Platform.isChromecast()) {
// Offline storage is not supported on the Chromecast or Xbox One
// platforms.
if (shaka.util.Platform.isChromecast() ||
shaka.util.Platform.isXboxOne()) {
return null;
}
// Offline storage requires the IndexedDB API.
Expand Down
2 changes: 1 addition & 1 deletion test/offline/indexeddb_storage_unit.js
Expand Up @@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

filterDescribe('IndexeddbStorageCell', () => window.indexedDB, () => {
filterDescribe('IndexeddbStorageCell', offlineSupported, () => {
const IndexedDBUtils = shaka.test.IndexedDBUtils;
const OfflineUtils = shaka.test.OfflineUtils;
const Util = shaka.test.Util;
Expand Down
2 changes: 1 addition & 1 deletion test/offline/storage_compatibility_unit.js
Expand Up @@ -91,7 +91,7 @@ const compatibilityTestsMetadata = [
},
];

filterDescribe('Storage Compatibility', () => window.indexedDB, () => {
filterDescribe('Storage Compatibility', offlineSupported, () => {
for (const metadata of compatibilityTestsMetadata) {
describe(metadata.name, () => {
makeTests(metadata);
Expand Down
9 changes: 9 additions & 0 deletions test/test/boot.js
Expand Up @@ -242,6 +242,15 @@ window.xfilterDescribe = (describeName, cond, describeBody) => {
window['describe'] = oldDescribe;
};

/**
* A very short alias for filtering offline integration tests.
*
* @return {boolean}
*/
window.offlineSupported = () => {
return shaka.offline.StorageMuxer.support();
};

/**
* Load node modules used in testing and install them into window.
* @return {!Promise}
Expand Down
4 changes: 4 additions & 0 deletions test/test/externs/filters.js
Expand Up @@ -38,3 +38,7 @@ var filterDescribe = function(name, cond, callback) {};
* @param {function()} callback
*/
var xfilterDescribe = function(name, cond, callback) {};


/** @return {boolean} */
var offlineSupported = function() {};

0 comments on commit de0a5b6

Please sign in to comment.