Bug 124902 - Adding MediaConstraintsMock class
Summary: Adding MediaConstraintsMock class
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Thiago de Barros Lacerda
URL:
Keywords:
: 123093 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-11-26 14:57 PST by Thiago de Barros Lacerda
Modified: 2022-03-01 02:55 PST (History)
9 users (show)

See Also:


Attachments
Patch (14.77 KB, patch)
2013-11-26 15:01 PST, Thiago de Barros Lacerda
no flags Details | Formatted Diff | Diff
Patch (18.92 KB, patch)
2013-11-27 06:06 PST, Thiago de Barros Lacerda
eric.carlson: review+
Details | Formatted Diff | Diff
Patch for landing. (18.40 KB, patch)
2013-11-27 12:11 PST, Thiago de Barros Lacerda
thiago.lacerda: commit-queue-
Details | Formatted Diff | Diff
Patch for landing. (18.40 KB, patch)
2013-11-27 12:15 PST, Thiago de Barros Lacerda
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thiago de Barros Lacerda 2013-11-26 14:57:35 PST
Missing block to run RTCPeerConnection LayoutTests
Comment 1 Thiago de Barros Lacerda 2013-11-26 15:01:37 PST
Created attachment 217907 [details]
Patch
Comment 2 Thiago de Barros Lacerda 2013-11-26 15:02:45 PST
*** Bug 123093 has been marked as a duplicate of this bug. ***
Comment 3 Eric Carlson 2013-11-26 17:51:24 PST
Comment on attachment 217907 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=217907&action=review

> Source/WebCore/platform/mock/MediaConstraintsMock.cpp:52
> +bool isSupported(const String& constraint)
> +{
> +    return constraint == "valid_and_supported_1" || constraint == "valid_and_supported_2";
> +}
> +
> +bool isValid(const String& constraint)
> +{
> +    return isSupported(constraint) || constraint == "valid_but_unsupported_1" || constraint == "valid_but_unsupported_2";
> +}
> +
> +bool MediaConstraintsMock::verifyConstraints(PassRefPtr<MediaConstraints> prpConstraints)

This duplicates functionality in MockMediaStreamCenter. I would rather you use MockMediaStreamCenter::validateRequestConstraints and its supporting functions, and have MockMediaStreamCenter use this.
Comment 4 Thiago de Barros Lacerda 2013-11-26 18:27:29 PST
(In reply to comment #3)
> (From update of attachment 217907 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=217907&action=review
> 
> > Source/WebCore/platform/mock/MediaConstraintsMock.cpp:52
> > +bool isSupported(const String& constraint)
> > +{
> > +    return constraint == "valid_and_supported_1" || constraint == "valid_and_supported_2";
> > +}
> > +
> > +bool isValid(const String& constraint)
> > +{
> > +    return isSupported(constraint) || constraint == "valid_but_unsupported_1" || constraint == "valid_but_unsupported_2";
> > +}
> > +
> > +bool MediaConstraintsMock::verifyConstraints(PassRefPtr<MediaConstraints> prpConstraints)
> 
> This duplicates functionality in MockMediaStreamCenter. I would rather you use MockMediaStreamCenter::validateRequestConstraints and its supporting functions, and have MockMediaStreamCenter use this.

I agree, haven't seen that MockMediaStreamCenter was validating constraints too.
Comment 5 Thiago de Barros Lacerda 2013-11-27 06:06:01 PST
Created attachment 217945 [details]
Patch
Comment 6 Eric Carlson 2013-11-27 10:13:38 PST
Comment on attachment 217945 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=217945&action=review

> Source/WebCore/ChangeLog:8
> +        Missing block to run RTCPeerConnection LayoutTests

Not: do you mean missing *mock*?

> Source/WebCore/platform/mock/MediaConstraintsMock.cpp:2
> + * Copyright (C) 2012 Google Inc. All rights reserved.

Nit: I think you can replace "Google" with "Apple" here.

> Source/WebCore/platform/mock/MediaConstraintsMock.h:2
> + * Copyright (C) 2012 Google Inc. All rights reserved.

Ditto

> Source/WebCore/platform/mock/RTCPeerConnectionHandlerMock.cpp:52
> +    if (invalidQuery.isEmpty()) {

Nit: you could use an early return here.
Comment 7 Thiago de Barros Lacerda 2013-11-27 12:11:27 PST
Created attachment 217961 [details]
Patch for landing.
Comment 8 Thiago de Barros Lacerda 2013-11-27 12:15:22 PST
Created attachment 217962 [details]
Patch for landing.
Comment 9 WebKit Commit Bot 2013-11-27 13:01:13 PST
Comment on attachment 217962 [details]
Patch for landing.

Clearing flags on attachment: 217962

Committed r159823: <http://trac.webkit.org/changeset/159823>