-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: Flatten test environment for Chromecast #6640
test: Flatten test environment for Chromecast #6640
Conversation
A preview of shaka-project/shaka-lab#52 is already deployed in the lab to enable support for this in the lab infra. |
@shaka-bot please test |
@joeyparrish: Lab tests started with arguments:
|
Incremental code coverage: No instrumented code was changed. |
@shaka-bot test |
@avelad: Lab tests started with arguments:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that this PR breaks the tests in Tizen and is not working on ChromecastHub either due to play restrictions.
@joeyparrish can we close it with ec4bc1d ? |
No, because we now have WV DRM tests skipped IIRC, and |
Note MSS PlayReady test is working on Cast now |
I'm rebasing and simplifying this, then I'll run tests, then I'll upload. After this lands, I still have to go back and try to fix and re-enable Fuchsia. |
13983ee
to
5f5f5d9
Compare
@shaka-bot please test |
5f5f5d9
to
aee3a06
Compare
@joeyparrish: Lab tests started with arguments:
|
Still having an issue with this with disconnects on Tizen, which I did not see when I tested locally. |
Chromecast WebDriver Server and Karma both used iframes, which caused complications when testing on Chromecast. The test environment couldn't directly access `cast.__platform__` APIs, and more recently stopped being able to access EME due to presumed mistakes in the platform's implementation of iframe permission policies. This resolves the issue by removing iframes at both levels. - Flatten Karma's environment using "useIframe: false" and "runInParent: true" - Remove test flag --single-run; not supported in combination with Karma's "useIframe: false" option - Add a test boot file to force closure to use dynamic script tags instead of document.write; required with Karma's "useIframe: false" option - Adjust screenshot tests not to assume an iframe host - Fix compatibilty between Tizen and Karma's useIframe:false - joeyparrish/karma@32e8735 - joeyparrish/karma@f2132cc
aee3a06
to
c30f1be
Compare
I found and fixed some incompatibilities between Karma's flat mode and Tizen, and between Karma's flat mode and Tizen WebDriver Server. |
@shaka-bot please test |
@joeyparrish: Lab tests started with arguments:
|
Chromecast WebDriver Server and Karma both used iframes, which caused complications when testing on Chromecast. The test environment couldn't directly access `cast.__platform__` APIs, and more recently stopped being able to access EME due to presumed mistakes in the platform's implementation of iframe permission policies. This resolves the issue by removing iframes at both levels. - Flatten Karma's environment using "useIframe: false" and "runInParent: true" - Remove test flag --single-run; not supported in combination with Karma's "useIframe: false" option - Add a test boot file to force closure to use dynamic script tags instead of document.write; required with Karma's "useIframe: false" option - Adjust screenshot tests not to assume an iframe host - Fix compatibilty between Tizen and Karma's useIframe:false - joeyparrish/karma@32e8735 - joeyparrish/karma@f2132cc
@@ -221,6 +221,7 @@ module.exports = (config) => { | |||
'node_modules/eme-encryption-scheme-polyfill/dist/eme-encryption-scheme-polyfill.js', | |||
|
|||
// load closure base, the deps tree, and the uncompiled library | |||
'test/test/closure-boot.js', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like this causes karma's debug.html to stop working.
For whatever reason, if I try to run the debug file via something like python3 build/test.py --uncompiled --no-build --quick --auto-watch --no-browsers
, it fails to load node_modules/google-closure-library/closure/goog/deps.js
as well as errors out because it never ends up setting up var shaka = {}
.
Not really sure how to fix it but thought it's worth mentioning it. Maybe this file could only be configured on chromecast?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the problem, and it's more general. It has to do with the order in which scripts load. I'll work on a fix.
What seems to happen now is that Karma inserts shaka-player.uncompiled.js directly, which uses Closure to load the individual source files of Shaka, not with createElement attached to head instead of document.write. This allows some subsequent scripts inserted by Karma to execute before those createElement scripts load, which is what causes the problem.
In normal testing, Karma also loads scripts with createElement, so it works. Since flattening the environment, it's only debug.html that sticks <script>
tags directly into HTML.
Since we're on a fork of the now-dead-upstream Karma, I may be able to fix it there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wrong. Easier to fix in closure-boot.js, since the correct behavior depends on context.
Chromecast WebDriver Server and Karma both used iframes, which caused complications when testing on Chromecast. The test environment couldn't directly access `cast.__platform__` APIs, and more recently stopped being able to access EME due to presumed mistakes in the platform's implementation of iframe permission policies. This resolves the issue by removing iframes at both levels. - Flatten Karma's environment using "useIframe: false" and "runInParent: true" - Remove test flag --single-run; not supported in combination with Karma's "useIframe: false" option - Add a test boot file to force closure to use dynamic script tags instead of document.write; required with Karma's "useIframe: false" option - Adjust screenshot tests not to assume an iframe host - Fix compatibilty between Tizen and Karma's useIframe:false - joeyparrish/karma@32e8735 - joeyparrish/karma@f2132cc
Chromecast WebDriver Server and Karma both used iframes, which caused complications when testing on Chromecast. The test environment couldn't directly access
cast.__platform__
APIs, and more recently stopped being able to access EME due to presumed mistakes in the platform's implementation of iframe permission policies.This resolves the issue by removing iframes at both levels.