Skip to content
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 existence and typeof MediaError.message #4638

Merged

Conversation

wolenetz
Copy link
Member

These may currently pass only on Mozilla nightly/aurora builds. Chrome support for MediaError.message is in-progress. @domenic @foolip @jyavenard Please review.

@jdsmith3000, @travisleithead FYI

See related WHATWG spec change whatwg/html#2085 and communication to W3C at https://lists.w3.org/Archives/Public/www-archive/2016Nov/0004.html.

@wpt-pr-bot
Copy link
Collaborator

wpt-pr-bot commented Jan 26, 2017

Copy link
Member

@foolip foolip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM % nit, but should not merge this until spec PR is up and ready to merge.

@@ -28,6 +28,7 @@
assert_true(e.error instanceof MediaError);
assert_equals(e.error.code, 4);
assert_equals(e.error.code, e.error.MEDIA_ERR_SRC_NOT_SUPPORTED);
assert_equals(typeof e.error.message, 'string');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this will fail initially, can you add 'error.message type' as the description (third argument)? That will make the failures more intelligible.

@foolip
Copy link
Member

foolip commented Jan 27, 2017

Actually, do you think the spec could require a non-empty error message, or will there be errors where we just don't know and would end up having to use "unknown decoder error" or something similarly useless? If it is always possible to have a useful message, then you could also test that the string is non-empty.

@jyavenard
Copy link
Contributor

@foolip We had discussion already on whether message should be an optional string or not. The consensus was that it was better not to.
Forcing message to be set fall in the same discussion I think, and you don't always know what caused the error. Like with MSE and endOfStream, there's no "message" parameter that could be passed there.

@foolip
Copy link
Member

foolip commented Jan 27, 2017

@jyavenard I see, there was a bunch of discussion about nullability. And in any event, turns out there's already a PR at whatwg/html#2086 that allows for the empty string, so let's go with that. There's nothing more that could be tested here I think.

@domenic domenic merged commit 48a73b6 into web-platform-tests:master Jan 27, 2017
@wolenetz wolenetz deleted the add_MediaError_message_tests branch January 27, 2017 19:20
MXEBot pushed a commit to mirror/chromium that referenced this pull request Apr 22, 2017
This improves the level of information available for web authors to use
when debugging media playback errors.

* Adds support for the MediaError.message field [1] [2]

* Changes MediaLog::PipelineStatusToString() to return just a
  stringified version of the enum identifier, suitable for use as a
  UA-specific-code when included in MediaError.message.

* Changes MediaLog::GetErrorMessage() to produce messages in the form:
  [[Stringified pipeline error code, if any, without any colon][: The
  first MEDIA_ERROR_LOG_ENTRY from the log, if any, since that is most
  likely to contain the most precise error information]]
  The produced message does not contain any newlines.
  See the updated media_browsertest.cc for basic examples.

* When the message would otherwise be empty for various cases in
  HTMLMediaElement, and more meaningful information beyond the basic
  standard MediaError codes and HTMLMediaElement networkStates is
  available, reports basic additional information (prefixed by error
  code "MEDIA_ELEMENT_ERROR: ".) This should assist edge case
  differentiation. See the updated media_browsertest.cc for basic
  examples.

* Test coverage:
  * Adds basic layout test coverage test similar to that added in [3].
  * Adds basic content browser test coverage for a small variety of
    errors, since these messages' format and content are specific to
    Chrom*.

The format of the message string may change in future (for example, see
discussion in [4]). Also, the variety of error codes in the message
prior to the first ':' will likely change in future, and the descriptive
error message detail following the ':' will likely change to include
more cases or more consistent format in future.

[1] - whatwg/html#2085
[2] - whatwg/html#2086
[3] - web-platform-tests/wpt#4638
[4] - whatwg/html#2531
[Intent to implement and ship] -
https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/yDIyWozG1xk

BUG=601086, 710617

Review-Url: https://codereview.chromium.org/2660003003
Cr-Commit-Position: refs/heads/master@{#466359}
GnorTech pushed a commit to nwjs/chromium.src that referenced this pull request Apr 26, 2017
This improves the level of information available for web authors to use
when debugging media playback errors.

* Adds support for the MediaError.message field [1] [2]

* Changes MediaLog::PipelineStatusToString() to return just a
  stringified version of the enum identifier, suitable for use as a
  UA-specific-code when included in MediaError.message.

* Changes MediaLog::GetErrorMessage() to produce messages in the form:
  [[Stringified pipeline error code, if any, without any colon][: The
  first MEDIA_ERROR_LOG_ENTRY from the log, if any, since that is most
  likely to contain the most precise error information]]
  The produced message does not contain any newlines.
  See the updated media_browsertest.cc for basic examples.

* When the message would otherwise be empty for various cases in
  HTMLMediaElement, and more meaningful information beyond the basic
  standard MediaError codes and HTMLMediaElement networkStates is
  available, reports basic additional information (prefixed by error
  code "MEDIA_ELEMENT_ERROR: ".) This should assist edge case
  differentiation. See the updated media_browsertest.cc for basic
  examples.

* Test coverage:
  * Adds basic layout test coverage test similar to that added in [3].
  * Adds basic content browser test coverage for a small variety of
    errors, since these messages' format and content are specific to
    Chrom*.

The format of the message string may change in future (for example, see
discussion in [4]). Also, the variety of error codes in the message
prior to the first ':' will likely change in future, and the descriptive
error message detail following the ':' will likely change to include
more cases or more consistent format in future.

[1] - whatwg/html#2085
[2] - whatwg/html#2086
[3] - web-platform-tests/wpt#4638
[4] - whatwg/html#2531
[Intent to implement and ship] -
https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/yDIyWozG1xk

BUG=601086, 710617

Review-Url: https://codereview.chromium.org/2660003003
Cr-Commit-Position: refs/heads/master@{#466359}
(cherry picked from commit ed8e709)

TBR=jochen@chromium.org,sandersd@chromium.org,mlamouri@chromium.org,mcasas@chromium.org,dalecurtis@chromium.org,foolip@chromium.org

Review-Url: https://codereview.chromium.org/2837133002 .
Cr-Commit-Position: refs/branch-heads/3071@{#173}
Cr-Branched-From: a106f0a-refs/heads/master@{#464641}
xqq pushed a commit to xqq/chromium-media that referenced this pull request May 17, 2017
This improves the level of information available for web authors to use
when debugging media playback errors.

* Adds support for the MediaError.message field [1] [2]

* Changes MediaLog::PipelineStatusToString() to return just a
  stringified version of the enum identifier, suitable for use as a
  UA-specific-code when included in MediaError.message.

* Changes MediaLog::GetErrorMessage() to produce messages in the form:
  [[Stringified pipeline error code, if any, without any colon][: The
  first MEDIA_ERROR_LOG_ENTRY from the log, if any, since that is most
  likely to contain the most precise error information]]
  The produced message does not contain any newlines.
  See the updated media_browsertest.cc for basic examples.

* When the message would otherwise be empty for various cases in
  HTMLMediaElement, and more meaningful information beyond the basic
  standard MediaError codes and HTMLMediaElement networkStates is
  available, reports basic additional information (prefixed by error
  code "MEDIA_ELEMENT_ERROR: ".) This should assist edge case
  differentiation. See the updated media_browsertest.cc for basic
  examples.

* Test coverage:
  * Adds basic layout test coverage test similar to that added in [3].
  * Adds basic content browser test coverage for a small variety of
    errors, since these messages' format and content are specific to
    Chrom*.

The format of the message string may change in future (for example, see
discussion in [4]). Also, the variety of error codes in the message
prior to the first ':' will likely change in future, and the descriptive
error message detail following the ':' will likely change to include
more cases or more consistent format in future.

[1] - whatwg/html#2085
[2] - whatwg/html#2086
[3] - web-platform-tests/wpt#4638
[4] - whatwg/html#2531
[Intent to implement and ship] -
https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/yDIyWozG1xk

BUG=601086, 710617

Review-Url: https://codereview.chromium.org/2660003003
Cr-Original-Commit-Position: refs/heads/master@{#466359}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: ed8e7091b5b0a51a8c0781f95813a5929c1f8110
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants