This corrects/normalizes license headers in misc. files, such as
config files, docs, build tools, tests, and externs. This does not
affect the compiled output, and is only done for consistency.
Issue #2638
Change-Id: I9d8da2de55243b08d7df2b743aac73c6f15e858a
This change adds the following methods on CastReceiver:
- setContentMetadata(metadata)
- clearContentMetadata()
- setContentTitle(title)
- setContentImage(imageUrl)
- setContentArtist(artist)
These should be called from the CastReceiver's app data callback.
The title, image, and artist methods cover all the Cast content
metadata fields that have an effect in the Google Home App as of June
2020, and setContentMetadata can be used to set one of several object
formats with many more fields defined in the Cast SDK docs.
See https://developers.google.com/cast/docs/reference/messages and the
definitions of GenericMediaMetadata, MovieMediaMetadata,
TvShowMediaMetadata, and MusicTrackMediaMetadata for details.
This also uses these methods from our cast receiver demo, so our demo
will now set all possible metadata when casting our content library.
Closes#2606
Change-Id: I6386276449dbddd2501cd6e3e52206f7fb30b8fd
The fix for Google Home scrubber in 8c3775ce (Change-Id
Iceec95f18cf15325b7ee2350a0f30f31edc90560) did not come with a
regression test. This change covers that fix with an automated test.
I have confirmed that the test fails without the fix.
Issue #2606
Change-Id: I13a2bcfb2fcca059db4e909d7c27fb68b0bfb409
Details of the cleanup:
- Don't replace the load() spy with a non-spy
- Fix an out-of-date comment on an explicit delay in a test
- Hoist expectMediaInfo helper to make it available for all tests
- Simulate loading content before the "generic controls messages" to allow the
use of expectMediaInfo
- Don't do a substring comparison on a JSON blob, which is inherently
unreliable, and compare the parsed object structure instead
Related to #2606
Change-Id: Ifb46e223ba800c0e10cbdfa6cb847faa8424cd3d
In many places in the tests, we used "Object" or "*" or just no type
at all for various fakes. These were all flagged by the new Closure
Compiler version we are adopting.
In some other places, we mixed up similar types or had the wrong
nullability on a type.
In still others, types were missing fields.
These issues were caught by a compiler upgrade.
Issue #2528
Change-Id: I324e0b28f7e30a4102aa26ec2c9901fa9732211b
This reflects changes in Google's policy on JavaScript license
headers, which should be smaller to avoid increasing the size of the
binary unnecessarily.
This also updates the company name from "Google, Inc" to "Google LLC".
Change-Id: I3f8b9ed3700b6351f43173d50c94d35c333e82b4
This ensures that we get the expected types and that type coercion
doesn't convert between types. This also ensures we are consistent
in how we check for equality of primitives in tests.
Change-Id: I9f3aacdf25ab1afe5e8d6e4b895b5299ee687d54
- Reduce times for "short delays".
- Remove backoff delay from networking tests.
- Avoid hard-coding delays in the library.
- Move Storage tests to integration tests since they use indexedDB (and
take over 200ms each to run).
This reduces the time it takes to run unit tests (with --quick) from
50 seconds to about 6 seconds. Now all but one unit test finish <100ms.
Change-Id: I88461472a87c4cf750a36d07d07422818e069a4d
This add a filterDescribe that can be used to filter groups of tests
based on platform support. This consolidates the different test
filtering to one place.
Change-Id: I8f320fcf0edfa2d984433890fcfc3714e78b195b
This is a fully automated change. The linter will fail because the
extra indentation caused line-length errors. These won't be fixed
automatically. They are fixed in a follow-up to make this one fully
automated.
Change-Id: I4d8cf9c998985add2bcd24a81c8d65495668c4f3
With the new style rule, we cannot have two statements on the same line.
So we can no longer have an "if" on a single line and we cannot have
an arrow function with a body on the same line as when it is used.
This is mostly a manual change.
Change-Id: I2285202dd5ecbad764308bc725e6d317ff2ee7f0
This is an automated change to convert use of "function" functions
to arrow functions. This doesn't change all uses of bind() that
could be converted. This also doesn't remove all "function" functions.
Change-Id: I40ac7d086bcef947a1be083359c8fd1d4499a9c3
A coming update to the Google eslint config will require using "const"
over "let". This makes that one change to isolate the big changes.
Change-Id: I7d0974c3ae15c53cc45a6b07bf9f6586e2d34aca
This replaces almost every instance of indexOf on both String and
Array. There are very few places where we really wanted an index.
Mostly, indexOf was used to check for inclusion.
Change-Id: I08e299768b6ffdb4bfc30b39b5d82a058c6d1b56
In preparation to supporting non-manifest assets, let's change
|manifestUri| to |assetUri| as it is a more broad name.
Issue #816
Change-Id: Ibec761caa8acf173571592ce0a7029af0f60de68
- Translate uncaught Promise rejections into test failures
(Chrome only until the event is more widely implemented)
- Clean up uncaught Promise rejection caused by exceptions thrown
after destroy() in:
- CastProxy
- CastReceiver
- NetworkingEngine
- StreamingEngine
- Clean up uncaught Promise rejection caused by test cases in:
- CancelableChain unit tests
- DrmEngine unit tests
- StreamingEngine unit and integration tests
- Player unit and integration tests
- Speed up rejection in NetworkingEngine when we should not retry
- Add --delay-tests to test.py, to aid in debugging uncaught
Promise rejections and other types of async test pollution
Closes#1323
Change-Id: I5a8f5702a22430929babeb071bf6650c52c5ad17
This is an automated fix to be inline with Google style guides, this
was created with eslint's --fix option.
Change-Id: I860eecbc8152603e730aa17a1393f16d26b3b6fc
Google style guide requires adding curly braces to all block statements
even if it is only has one line. This fixes it by using eslint's
--fix flag followed by running clang-format to reformat the change.
Change-Id: Idc086c2aa8c02df5ef8b2140a11bfb9128eeb4bd
This is part of a change to convert all usages of 'var' with either
'let' or 'const'. This takes a conservative approach for 'const' where
it will only be used for aliases and storing the "original" values in
tests.
Change-Id: I8f857a24e4c1ad336177d23dfed4f4a29d3262d2
This replaces checkWhatever type functions, which are called at the
start of a test, with checkAndRun functions, which are a wrapper
around the test method. This change standardizes our tests, since
checkAndRun functions are used in the db engine tests but not
elsewhere.
Change-Id: I74c7ac6836bbaab15b57fd480dbd6105ddc5ee60
When casting, the cast dialogue contains information about the current
media, including volume, time, and duration. These values are
synchronized by different messages. We were sending over the
MediaStatus messages that synchronize current time, but were not
including duration in our MediaInfo messages. This caused the cast
dialogue progress bar to not display correctly.
This change makes it so that our MediaInfo messages now include
duration, and we now send over MediaInfo messages in situations where
we did not previously.
Closes#1174
Change-Id: Ic585f3befec9e44ef4e9895d04ddfad6cc5473b3
This digests and organizes many of the automatic settings in eslint,
and changes several of them to be more strict. This also fixes the
following errors:
- array-callback-return
- no-catch-shadow
- no-multi-spaces
- no-new
- no-throw-literal
- no-useless-call
- no-useless-concat
- no-useless-return
Several checks have been organized into a group of checks we should
use, but need more time to implement and fix. Some other checks have
been delegated to the Closure compiler, which can more precisely
whitelist exceptions.
Issue #1157
Change-Id: I8fe4966959e08050f8159e6a1fee161e7d71177e
Not all values need to be updated twice a second. This change modifies
the list of player getters so that each value also includes an update
frequency, and only updates that property once in that many updates.
This acts as a configurable way to ensure that some properties update
in different amounts, without having to have multiple update timers or
compose multiple update messages in the same timeframe.
Change-Id: I90e75e3e73f6c633d91b1799307ec2b15587327b
Beforehand, the Chromecast would poll getPlayheadTimeAsDate and
getPresentationStartTimeAsDate for every update message, which are live-only
getters, even on VOD.
This would cause a lot of error messages in the debug output of the receiver;
we didn't notice this before because we mostly run the receiver in compiled
mode.
This also allowed users to poll those attributes for VODs without any error
messages when casting, since the results of the last update were cached.
This change adds a list of getters that require live; such getters are not added
to state update messages, and are set up with asserts in the sender.
This should solve the problem and slim down our update messages a bit at the
same time.
Change-Id: Ifc0b445def2d85b22fcb9af160dec2205d1faace
There was a bug in the cast_utils test that meant that the new members
on Player weren't being detected. The test should fail when we forget
to add a new member to the list in cast_utils.js. This updates the
test and adds the new members to the list.
Change-Id: I27c25d07b409b8350b5709c3ce26696d72a6a11d
The getTracks and selectTrack methods have been deprecated since v2.1
and scheduled for removal in v2.2.
Change-Id: I938b3015262d71683ac871c05a9f4c74c96acf50
This is part of adding a new conformance rule to add additional type
safety. This will disallow using properties of unknown types or using
unknown properties.
The first parts will be fixing errors caused by the new rule. These
are backwards compatible, so can be applied before the rule is enabled.
Once all the errors and bugs are fixed, the rule will be enabled.
Change-Id: Iefde089b2f62ddfdf43944cda5badab438577561
The old definition using a union with a Function causes problems. The
compiler tends to treat this as an unknown type, so we loose type
safety. The new types ensure full type safety, at the cost of needing
to "convert" the spy when it is used as a function.
Change-Id: I98ebd9dffd9cb865d0cf5d03db0fb5d6ea001ed3
Somehow, errors thrown by CastReceiver unit test setup caused DRM
tests on IE and Edge to fail. This cleans up the Cast tests to fix
these uncaught errors that somehow polluted the DRM tests.
Change-Id: I435ff994b0b70199eb5a8febd419296b59497920
Media Playback messages are used by generic Chromecast controllers
(Google Home app and the likes). Supporting them is required by
the Chromecast SDK.
Closes#722.
Change-Id: I3c98fb9d63da81b59c2cc82a3e790332fc9bb56e
This adds a severity field to Error objects. This can be used to
detect whether an error is recoverable. All the same errors are still
reported so the field can be ignored.
There are two possible values:
* RECOVERABLE means that the Player will try to recover from the error
* CRITICAL means the Player will be unable to continue and must call
load() again
Closes#564
Change-Id: Ie2c5468340c13e7a288b99690ab65b7ecc0a6b29
This adds a method on Player to get the license expiration times for
the current EME sessions. This also adds the expiration times to the
stored content structure for offline content. This will update the
stored expiration while playing content (e.g. license duration changes
when playback starts).
Closes#727
Change-Id: I18770a79413423695bbb2ed5f31f6b19038a33d2
There were two instances of tests not cleaning up correctly. The
Dash Live tests didn't uninstall the Promise polyfill, which breaks
Promise.resolve for tests that don't expect it. Also, in the
CastReceiver tests, it defines a property on window. It needs to be
configurable, otherwise it cannot be set twice. Somehow the resulting
exception is not being caught by jasmine.
Change-Id: I0691a7bcddf14fd455f034d63e12fc8046044750
There are several tests that use fake <video> elements. All of them
have a createMockVideo method. This consolidates all of them into a
fake class that also provides more type safety.
Change-Id: I132c3e4a75676594bcefb60d0b115c00ede03067
Add UI options to select current audio and text language.
Split selectTrack() into selectText() and selectVariant().
Stop automatically disabling ABR manager when a variant is selected.
Add a warning if selectVariant() is called while abr is enabled.
Issue #412.
Issue #626.
Change-Id: I15f1c3c4fdc6d6b641f708fbef19dbcf10cbcfc6
Using a special API available on the Chromecast, determine if we can
do 4k. If so, raise the hardware limit from 1080p to 4k.
Change-Id: I6e403cce5d9c43a22f1b76cf4d79661ac096dd82
The emsg, loading, and unloading events were present in v2.0.0.
The drmInfo, isInProgress, and keySystem method were also present in
v2.0.0. The getPlayheadTimeAsDate method was introduced in v2.0.1.
None of these were proxied to the cast device until now. All v2.0.x
events and methods are now being proxied.
Change-Id: I6fba60f4ca451053c1449cafcddd9c1006292ad9
All tests now have the same timeout value. This should simplify the
process of addressing timeouts on Safari.
Change-Id: I3b455bd639758007ec8b2b86ef236c56e919c15a
* Drop unnecessary type alternation in SegmentIndex unit tests
* Drop unnecessary bind in StreamingEngine unit tests
* Drop unnecessary expose annotations in Pssh
* Add comments about quoted access in cast unit tests
* Move afterAll() position in cast unit tests
* Make return type for PublicPromise constructor more specific
* Define a type for Util.eventLoop return value
Related to PR #421
Change-Id: I092a8ff366b4ac4ea868dd3f4fbe4e3d63a2167f