Title: [218369] trunk

Diff

Modified: trunk/Source/WebCore/ChangeLog (218368 => 218369)


--- trunk/Source/WebCore/ChangeLog	2017-06-15 23:49:12 UTC (rev 218368)
+++ trunk/Source/WebCore/ChangeLog	2017-06-16 00:16:36 UTC (rev 218369)
@@ -1,3 +1,16 @@
+2017-06-15  Matt Lewis  <jlew...@apple.com>
+
+        Unreviewed, rolling out r218365.
+
+        The revision caused API timeouts on all builds.
+
+        Reverted changeset:
+
+        "[WebRTC] Removing a MediaStreamTrack from a MediaStream
+        reports no recording to WebKit clients"
+        https://bugs.webkit.org/show_bug.cgi?id=173398
+        http://trac.webkit.org/changeset/218365
+
 2017-06-15  Simon Fraser  <simon.fra...@apple.com>
 
         Allow use of Layout* TextStream operators in WebKit2

Modified: trunk/Source/WebCore/Modules/mediastream/MediaStream.cpp (218368 => 218369)


--- trunk/Source/WebCore/Modules/mediastream/MediaStream.cpp	2017-06-15 23:49:12 UTC (rev 218368)
+++ trunk/Source/WebCore/Modules/mediastream/MediaStream.cpp	2017-06-16 00:16:36 UTC (rev 218369)
@@ -90,6 +90,7 @@
     setIsActive(m_private->active());
     m_private->addObserver(*this);
     MediaStreamRegistry::shared().registerStream(*this);
+    document()->addAudioProducer(this);
     suspendIfNeeded();
 }
 
@@ -110,6 +111,7 @@
         track->addObserver(*this);
         m_trackSet.add(track->id(), WTFMove(track));
     }
+    document()->addAudioProducer(this);
     suspendIfNeeded();
 }
 
@@ -123,6 +125,7 @@
     for (auto& track : m_trackSet.values())
         track->removeObserver(*this);
     if (Document* document = this->document()) {
+        document->removeAudioProducer(this);
         if (m_isWaitingUntilMediaCanStart)
             document->removeMediaCanStartListener(this);
     }
@@ -319,16 +322,53 @@
     }
 }
 
+void MediaStream::pageMutedStateDidChange()
+{
+    if (!m_isActive)
+        return;
+
+    Document* document = this->document();
+    if (!document)
+        return;
+
+    m_private->setCaptureTracksMuted(document->page()->isMediaCaptureMuted());
+}
+
 MediaProducer::MediaStateFlags MediaStream::mediaState() const
 {
-    MediaProducer::MediaStateFlags state = MediaProducer::IsNotPlaying;
+    MediaStateFlags state = IsNotPlaying;
 
     if (!m_isActive || !document() || !document()->page())
         return state;
 
-    for (const auto& track : m_trackSet.values())
-        state |= track->mediaState();
+    bool pageCaptureMuted = document()->page()->isMediaCaptureMuted();
+    for (const auto& track : m_trackSet.values()) {
+        if (!track->isCaptureTrack() || track->ended())
+            continue;
 
+        if (track->source().type() == RealtimeMediaSource::Type::Audio) {
+            if (track->source().interrupted() && !pageCaptureMuted)
+                state |= HasInterruptedAudioCaptureDevice;
+            else if (track->muted())
+                state |= HasMutedAudioCaptureDevice;
+            else if (m_isProducingData && m_private->isProducingData()) {
+                state |= HasActiveAudioCaptureDevice;
+                ASSERT(!track->source().interrupted());
+                ASSERT(!track->muted());
+            }
+        } else {
+            if (track->source().interrupted() && !pageCaptureMuted)
+                state |= HasInterruptedVideoCaptureDevice;
+            else if (track->muted())
+                state |= HasMutedVideoCaptureDevice;
+            else if (m_isProducingData && m_private->isProducingData()) {
+                state |= HasActiveVideoCaptureDevice;
+                ASSERT(!track->source().interrupted());
+                ASSERT(!track->muted());
+            }
+        }
+    }
+
     return state;
 }
 
@@ -339,12 +379,13 @@
     if (Document* document = this->document()) {
         if (m_isActive)
             document->setHasActiveMediaStreamTrack();
+        document->updateIsPlayingMedia();
     }
 }
 
 void MediaStream::characteristicsChanged()
 {
-    auto state = mediaState();
+    MediaStateFlags state = mediaState();
     if (m_state != state) {
         m_state = state;
         statusDidChange();

Modified: trunk/Source/WebCore/Modules/mediastream/MediaStream.h (218368 => 218369)


--- trunk/Source/WebCore/Modules/mediastream/MediaStream.h	2017-06-15 23:49:12 UTC (rev 218368)
+++ trunk/Source/WebCore/Modules/mediastream/MediaStream.h	2017-06-16 00:16:36 UTC (rev 218369)
@@ -54,6 +54,7 @@
     , public ActiveDOMObject
     , public MediaStreamTrack::Observer
     , public MediaStreamPrivate::Observer
+    , private MediaProducer
     , private MediaCanStartListener
     , private PlatformMediaSessionClient
     , public RefCounted<MediaStream> {
@@ -135,7 +136,9 @@
     void didRemoveTrack(MediaStreamTrackPrivate&) final;
     void characteristicsChanged() final;
 
-    MediaProducer::MediaStateFlags mediaState() const;
+    // MediaProducer
+    void pageMutedStateDidChange() final;
+    MediaProducer::MediaStateFlags mediaState() const final;
 
     // MediaCanStartListener
     void mediaCanStart(Document&) final;
@@ -177,7 +180,7 @@
     Vector<Observer*> m_observers;
     std::unique_ptr<PlatformMediaSession> m_mediaSession;
 
-    MediaProducer::MediaStateFlags m_state { MediaProducer::IsNotPlaying };
+    MediaStateFlags m_state { IsNotPlaying };
 
     bool m_isActive { false };
     bool m_isProducingData { false };

Modified: trunk/Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp (218368 => 218369)


--- trunk/Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp	2017-06-15 23:49:12 UTC (rev 218368)
+++ trunk/Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp	2017-06-16 00:16:36 UTC (rev 218369)
@@ -30,7 +30,6 @@
 
 #if ENABLE(MEDIA_STREAM)
 
-#include "Document.h"
 #include "Event.h"
 #include "EventNames.h"
 #include "JSOverconstrainedError.h"
@@ -39,7 +38,6 @@
 #include "MediaStreamPrivate.h"
 #include "NotImplemented.h"
 #include "OverconstrainedError.h"
-#include "Page.h"
 #include "ScriptExecutionContext.h"
 #include <wtf/NeverDestroyed.h>
 
@@ -54,22 +52,15 @@
     : ActiveDOMObject(&context)
     , m_private(WTFMove(privateTrack))
     , m_weakPtrFactory(this)
-    , m_taskQueue(context)
 {
     suspendIfNeeded();
 
     m_private->addObserver(*this);
-
-    if (auto document = this->document())
-        document->addAudioProducer(this);
 }
 
 MediaStreamTrack::~MediaStreamTrack()
 {
     m_private->removeObserver(*this);
-
-    if (auto document = this->document())
-        document->removeAudioProducer(this);
 }
 
 const AtomicString& MediaStreamTrack::kind() const
@@ -294,53 +285,6 @@
     m_observers.removeFirst(&observer);
 }
 
-void MediaStreamTrack::pageMutedStateDidChange()
-{
-    if (m_ended || !isCaptureTrack())
-        return;
-
-    Document* document = this->document();
-    if (!document || !document->page())
-        return;
-
-    m_private->setMuted(document->page()->isMediaCaptureMuted());
-}
-
-MediaProducer::MediaStateFlags MediaStreamTrack::mediaState() const
-{
-    if (m_ended || !isCaptureTrack())
-        return IsNotPlaying;
-
-    Document* document = this->document();
-    if (!document || !document->page())
-        return IsNotPlaying;
-
-    bool pageCaptureMuted = document->page()->isMediaCaptureMuted();
-
-    if (source().type() == RealtimeMediaSource::Type::Audio) {
-        if (source().interrupted() && !pageCaptureMuted)
-            return HasInterruptedAudioCaptureDevice;
-        if (muted())
-            return HasMutedAudioCaptureDevice;
-        if (m_private->isProducingData())
-            return HasActiveAudioCaptureDevice;
-    } else {
-        if (source().interrupted() && !pageCaptureMuted)
-            return HasInterruptedVideoCaptureDevice;
-        if (muted())
-            return HasMutedVideoCaptureDevice;
-        if (m_private->isProducingData())
-            return HasActiveVideoCaptureDevice;
-    }
-
-    return IsNotPlaying;
-}
-
-void MediaStreamTrack::trackStarted(MediaStreamTrackPrivate&)
-{
-    configureTrackRendering();
-}
-
 void MediaStreamTrack::trackEnded(MediaStreamTrackPrivate&)
 {
     // http://w3c.github.io/mediacapture-main/#life-cycle
@@ -388,11 +332,6 @@
 
 void MediaStreamTrack::configureTrackRendering()
 {
-    m_taskQueue.enqueueTask([this] {
-        if (auto document = this->document())
-            document->updateIsPlayingMedia();
-    });
-
     // 4.3.1
     // ... media from the source only flows when a MediaStreamTrack object is both unmuted and enabled
 }
@@ -400,7 +339,6 @@
 void MediaStreamTrack::stop()
 {
     stopTrack();
-    m_taskQueue.close();
 }
 
 const char* MediaStreamTrack::activeDOMObjectName() const
@@ -423,11 +361,6 @@
     return m_private->audioSourceProvider();
 }
 
-Document* MediaStreamTrack::document() const
-{
-    return downcast<Document>(scriptExecutionContext());
-}
-
 } // namespace WebCore
 
 #endif // ENABLE(MEDIA_STREAM)

Modified: trunk/Source/WebCore/Modules/mediastream/MediaStreamTrack.h (218368 => 218369)


--- trunk/Source/WebCore/Modules/mediastream/MediaStreamTrack.h	2017-06-15 23:49:12 UTC (rev 218368)
+++ trunk/Source/WebCore/Modules/mediastream/MediaStreamTrack.h	2017-06-16 00:16:36 UTC (rev 218369)
@@ -32,10 +32,8 @@
 #include "ActiveDOMObject.h"
 #include "DoubleRange.h"
 #include "EventTarget.h"
-#include "GenericTaskQueue.h"
 #include "JSDOMPromiseDeferred.h"
 #include "LongRange.h"
-#include "MediaProducer.h"
 #include "MediaStreamTrackPrivate.h"
 #include "MediaTrackConstraints.h"
 
@@ -42,16 +40,10 @@
 namespace WebCore {
 
 class AudioSourceProvider;
-class Document;
 
 struct MediaTrackConstraints;
 
-class MediaStreamTrack :
-    public RefCounted<MediaStreamTrack>,
-    public ActiveDOMObject,
-    public EventTargetWithInlineData,
-    private MediaProducer,
-    private MediaStreamTrackPrivate::Observer {
+class MediaStreamTrack : public RefCounted<MediaStreamTrack>, public ActiveDOMObject, public EventTargetWithInlineData, private MediaStreamTrackPrivate::Observer {
 public:
     class Observer {
     public:
@@ -118,15 +110,11 @@
     const MediaTrackConstraints& getConstraints() const { return m_constraints; }
     void applyConstraints(const std::optional<MediaTrackConstraints>&, DOMPromiseDeferred<void>&&);
 
-    RealtimeMediaSource& source() const { return m_private->source(); }
+    RealtimeMediaSource& source() { return m_private->source(); }
     MediaStreamTrackPrivate& privateTrack() { return m_private.get(); }
 
     AudioSourceProvider* audioSourceProvider();
 
-    // MediaProducer
-    void pageMutedStateDidChange() final;
-    MediaProducer::MediaStateFlags mediaState() const final;
-
     void addObserver(Observer&);
     void removeObserver(Observer&);
 
@@ -144,8 +132,6 @@
 
     void configureTrackRendering();
 
-    Document* document() const;
-
     // ActiveDOMObject API.
     void stop() final;
     const char* activeDOMObjectName() const final;
@@ -158,7 +144,6 @@
     ScriptExecutionContext* scriptExecutionContext() const final { return ActiveDOMObject::scriptExecutionContext(); }
 
     // MediaStreamTrackPrivate::Observer
-    void trackStarted(MediaStreamTrackPrivate&) final;
     void trackEnded(MediaStreamTrackPrivate&) final;
     void trackMutedChanged(MediaStreamTrackPrivate&) final;
     void trackSettingsChanged(MediaStreamTrackPrivate&) final;
@@ -172,7 +157,6 @@
     MediaTrackConstraints m_constraints;
     std::optional<DOMPromiseDeferred<void>> m_promise;
     WeakPtrFactory<MediaStreamTrack> m_weakPtrFactory;
-    GenericTaskQueue<ScriptExecutionContext> m_taskQueue;
 
     bool m_ended { false };
 };

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h (218368 => 218369)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h	2017-06-15 23:49:12 UTC (rev 218368)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h	2017-06-16 00:16:36 UTC (rev 218369)
@@ -201,7 +201,6 @@
     void didRemoveTrack(MediaStreamTrackPrivate&) override;
 
     // MediaStreamPrivateTrack::Observer
-    void trackStarted(MediaStreamTrackPrivate&) override { };
     void trackEnded(MediaStreamTrackPrivate&) override { };
     void trackMutedChanged(MediaStreamTrackPrivate&) override { };
     void trackSettingsChanged(MediaStreamTrackPrivate&) override { };

Modified: trunk/Source/WebCore/platform/mediastream/MediaStreamPrivate.cpp (218368 => 218369)


--- trunk/Source/WebCore/platform/mediastream/MediaStreamPrivate.cpp	2017-06-15 23:49:12 UTC (rev 218368)
+++ trunk/Source/WebCore/platform/mediastream/MediaStreamPrivate.cpp	2017-06-16 00:16:36 UTC (rev 218369)
@@ -281,13 +281,6 @@
     });
 }
 
-void MediaStreamPrivate::trackStarted(MediaStreamTrackPrivate&)
-{
-    scheduleDeferredTask([this] {
-        characteristicsChanged();
-    });
-}
-
 void MediaStreamPrivate::trackEnded(MediaStreamTrackPrivate&)
 {
     scheduleDeferredTask([this] {

Modified: trunk/Source/WebCore/platform/mediastream/MediaStreamPrivate.h (218368 => 218369)


--- trunk/Source/WebCore/platform/mediastream/MediaStreamPrivate.h	2017-06-15 23:49:12 UTC (rev 218368)
+++ trunk/Source/WebCore/platform/mediastream/MediaStreamPrivate.h	2017-06-16 00:16:36 UTC (rev 218369)
@@ -125,7 +125,6 @@
     MediaStreamPrivate(const MediaStreamTrackPrivateVector&, String&&);
 
     // MediaStreamTrackPrivate::Observer
-    void trackStarted(MediaStreamTrackPrivate&) override;
     void trackEnded(MediaStreamTrackPrivate&) override;
     void trackMutedChanged(MediaStreamTrackPrivate&) override;
     void trackSettingsChanged(MediaStreamTrackPrivate&) override;

Modified: trunk/Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.cpp (218368 => 218369)


--- trunk/Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.cpp	2017-06-15 23:49:12 UTC (rev 218368)
+++ trunk/Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.cpp	2017-06-16 00:16:36 UTC (rev 218369)
@@ -151,12 +151,6 @@
     return m_source->audioSourceProvider();
 }
 
-void MediaStreamTrackPrivate::sourceStarted()
-{
-    for (auto& observer : m_observers)
-        observer->trackStarted(*this);
-}
-
 void MediaStreamTrackPrivate::sourceStopped()
 {
     if (m_isEnded)

Modified: trunk/Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.h (218368 => 218369)


--- trunk/Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.h	2017-06-15 23:49:12 UTC (rev 218368)
+++ trunk/Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.h	2017-06-16 00:16:36 UTC (rev 218369)
@@ -43,7 +43,6 @@
     public:
         virtual ~Observer() { }
 
-        virtual void trackStarted(MediaStreamTrackPrivate&) { };
         virtual void trackEnded(MediaStreamTrackPrivate&) = 0;
         virtual void trackMutedChanged(MediaStreamTrackPrivate&) = 0;
         virtual void trackSettingsChanged(MediaStreamTrackPrivate&) = 0;
@@ -103,7 +102,6 @@
     MediaStreamTrackPrivate(Ref<RealtimeMediaSource>&&, String&& id);
 
     // RealtimeMediaSourceObserver
-    void sourceStarted() final;
     void sourceStopped() final;
     void sourceMutedChanged() final;
     void sourceEnabledChanged() final;

Modified: trunk/Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp (218368 => 218369)


--- trunk/Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp	2017-06-15 23:49:12 UTC (rev 218368)
+++ trunk/Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp	2017-06-16 00:16:36 UTC (rev 218369)
@@ -162,9 +162,6 @@
 
     m_isProducingData = true;
     startProducingData();
-
-    for (Observer& observer : m_observers)
-        observer.sourceStarted();
 }
 
 void RealtimeMediaSource::stop()

Modified: trunk/Source/WebCore/platform/mediastream/RealtimeMediaSource.h (218368 => 218369)


--- trunk/Source/WebCore/platform/mediastream/RealtimeMediaSource.h	2017-06-15 23:49:12 UTC (rev 218368)
+++ trunk/Source/WebCore/platform/mediastream/RealtimeMediaSource.h	2017-06-16 00:16:36 UTC (rev 218369)
@@ -70,7 +70,6 @@
         virtual ~Observer() { }
         
         // Source state changes.
-        virtual void sourceStarted() { }
         virtual void sourceStopped() { }
         virtual void sourceMutedChanged() { }
         virtual void sourceEnabledChanged() { }

Modified: trunk/Tools/ChangeLog (218368 => 218369)


--- trunk/Tools/ChangeLog	2017-06-15 23:49:12 UTC (rev 218368)
+++ trunk/Tools/ChangeLog	2017-06-16 00:16:36 UTC (rev 218369)
@@ -1,3 +1,16 @@
+2017-06-15  Matt Lewis  <jlew...@apple.com>
+
+        Unreviewed, rolling out r218365.
+
+        The revision caused API timeouts on all builds.
+
+        Reverted changeset:
+
+        "[WebRTC] Removing a MediaStreamTrack from a MediaStream
+        reports no recording to WebKit clients"
+        https://bugs.webkit.org/show_bug.cgi?id=173398
+        http://trac.webkit.org/changeset/218365
+
 2017-06-15  Jer Noble  <jer.no...@apple.com>
 
         [WebRTC] Removing a MediaStreamTrack from a MediaStream reports no recording to WebKit clients

Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (218368 => 218369)


--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj	2017-06-15 23:49:12 UTC (rev 218368)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj	2017-06-16 00:16:36 UTC (rev 218369)
@@ -601,8 +601,6 @@
 		CDC8E4951BC6F10800594FEC /* video-with-audio.mp4 in Copy Resources */ = {isa = PBXBuildFile; fileRef = CDC8E48A1BC5C96200594FEC /* video-with-audio.mp4 */; };
 		CDC8E4961BC6F10800594FEC /* video-without-audio.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CDC8E48B1BC5C96200594FEC /* video-without-audio.html */; };
 		CDC8E4971BC6F10800594FEC /* video-without-audio.mp4 in Copy Resources */ = {isa = PBXBuildFile; fileRef = CDC8E48C1BC5C96200594FEC /* video-without-audio.mp4 */; };
-		CDC9442E1EF1FC080059C3C4 /* MediaStreamTrackDetached.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDC9442C1EF1FC080059C3C4 /* MediaStreamTrackDetached.mm */; };
-		CDC9442F1EF205D60059C3C4 /* mediastreamtrack-detached.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CDC9442B1EF1FBD20059C3C4 /* mediastreamtrack-detached.html */; };
 		CDCFA7AA1E45183200C2433D /* SampleMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDCFA7A91E45122F00C2433D /* SampleMap.cpp */; };
 		CDE195B51CFE0B880053D256 /* FullscreenTopContentInset.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CDE195B21CFE0ADE0053D256 /* FullscreenTopContentInset.html */; };
 		CE06DF9B1E1851F200E570C9 /* SecurityOrigin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE06DF9A1E1851F200E570C9 /* SecurityOrigin.cpp */; };
@@ -711,7 +709,6 @@
 			dstPath = TestWebKitAPI.resources;
 			dstSubfolderSpec = 7;
 			files = (
-				CDC9442F1EF205D60059C3C4 /* mediastreamtrack-detached.html in Copy Resources */,
 				F46849C01EEF5EF300B937FE /* rich-and-plain-text.html in Copy Resources */,
 				93E2D2761ED7D53200FA76F6 /* offscreen-iframe-of-media-document.html in Copy Resources */,
 				F46A095A1ED8A6E600D4AA55 /* apple.gif in Copy Resources */,
@@ -1526,8 +1523,6 @@
 		CDC8E48A1BC5C96200594FEC /* video-with-audio.mp4 */ = {isa = PBXFileReference; lastKnownFileType = file; path = "video-with-audio.mp4"; sourceTree = "<group>"; };
 		CDC8E48B1BC5C96200594FEC /* video-without-audio.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "video-without-audio.html"; sourceTree = "<group>"; };
 		CDC8E48C1BC5C96200594FEC /* video-without-audio.mp4 */ = {isa = PBXFileReference; lastKnownFileType = file; path = "video-without-audio.mp4"; sourceTree = "<group>"; };
-		CDC9442B1EF1FBD20059C3C4 /* mediastreamtrack-detached.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = "mediastreamtrack-detached.html"; sourceTree = "<group>"; };
-		CDC9442C1EF1FC080059C3C4 /* MediaStreamTrackDetached.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MediaStreamTrackDetached.mm; sourceTree = "<group>"; };
 		CDCFA7A91E45122F00C2433D /* SampleMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SampleMap.cpp; sourceTree = "<group>"; };
 		CDE195B21CFE0ADE0053D256 /* FullscreenTopContentInset.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = FullscreenTopContentInset.html; sourceTree = "<group>"; };
 		CDE195B31CFE0ADE0053D256 /* FullscreenTopContentInset.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FullscreenTopContentInset.mm; sourceTree = "<group>"; };
@@ -2168,7 +2163,6 @@
 				33DC8910141953A300747EF7 /* LoadCanceledNoServerRedirectCallback.cpp */,
 				33DC89131419579F00747EF7 /* LoadCanceledNoServerRedirectCallback_Bundle.cpp */,
 				8AA28C1916D2FA7B002FF4DB /* LoadPageOnCrash.cpp */,
-				CDC9442C1EF1FC080059C3C4 /* MediaStreamTrackDetached.mm */,
 				7A5623101AD5AF3E0096B920 /* MenuTypesForMouseEvents.cpp */,
 				51CB4AD71B3A079C00C1B1C6 /* ModalAlertsSPI.cpp */,
 				33BE5AF4137B5A6C00705813 /* MouseMoveAfterCrash.cpp */,
@@ -2353,7 +2347,6 @@
 				930AD401150698B30067970F /* lots-of-text.html */,
 				5797FE321EB15A8900B2F4A0 /* navigation-client-default-crypto.html */,
 				AD57AC1D1DA7463800FF1BDE /* many-iframes.html */,
-				CDC9442B1EF1FBD20059C3C4 /* mediastreamtrack-detached.html */,
 				51CD1C711B38D48400142CA5 /* modal-alerts-in-new-about-blank-window.html */,
 				7A1458FB1AD5C03500E06772 /* mouse-button-listener.html */,
 				33E79E05137B5FCE00E32D99 /* mouse-move-listener.html */,
@@ -2914,7 +2907,6 @@
 				51D1249B1E785425002B2820 /* CookieManager.cpp in Sources */,
 				7CCE7EAC1A411A3400447C4C /* Counters.cpp in Sources */,
 				7AEAD47F1E20116C00416EFE /* CrossPartitionFileSchemeAccess.mm in Sources */,
-				CDC9442E1EF1FC080059C3C4 /* MediaStreamTrackDetached.mm in Sources */,
 				7CCE7EDB1A411A9200447C4C /* CSSParser.cpp in Sources */,
 				7CCE7F291A411B1000447C4C /* CustomProtocolsInvalidScheme.mm in Sources */,
 				7CCE7F2A1A411B1000447C4C /* CustomProtocolsSyncXHRTest.mm in Sources */,

Deleted: trunk/Tools/TestWebKitAPI/Tests/WebKit2/MediaStreamTrackDetached.mm (218368 => 218369)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit2/MediaStreamTrackDetached.mm	2017-06-15 23:49:12 UTC (rev 218368)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2/MediaStreamTrackDetached.mm	2017-06-16 00:16:36 UTC (rev 218369)
@@ -1,90 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "config.h"
-
-#if WK_API_ENABLED
-
-#if ENABLE(MEDIA_STREAM)
-
-#import "PlatformUtilities.h"
-#import "Test.h"
-#import "TestWKWebView.h"
-#import <WebKit/WKPreferencesPrivate.h>
-#import <WebKit/WKUIDelegatePrivate.h>
-#import <WebKit/WKWebViewConfiguration.h>
-#import <WebKit/_WKProcessPoolConfiguration.h>
-
-static bool hasRecievedCorrectCaptureState = false;
-
-@interface MediaStreamTrackDetachedUIDelegate : NSObject<WKUIDelegate>
-- (void)_webView:(WKWebView *)webView requestUserMediaAuthorizationForDevices:(_WKCaptureDevices)devices url:(NSURL *)url mainFrameURL:(NSURL *)mainFrameURL decisionHandler:(void (^)(BOOL authorized))decisionHandler;
-- (void)_webView:(WKWebView *)webView checkUserMediaPermissionForURL:(NSURL *)url mainFrameURL:(NSURL *)mainFrameURL frameIdentifier:(NSUInteger)frameIdentifier decisionHandler:(void (^)(NSString *salt, BOOL authorized))decisionHandler;
-- (void)_webView:(WKWebView *)webView mediaCaptureStateDidChange:(_WKMediaCaptureState)state;
-@end
-
-@implementation MediaStreamTrackDetachedUIDelegate
-- (void)_webView:(WKWebView *)webView requestUserMediaAuthorizationForDevices:(_WKCaptureDevices)devices url:(NSURL *)url mainFrameURL:(NSURL *)mainFrameURL decisionHandler:(void (^)(BOOL authorized))decisionHandler
-{
-    decisionHandler(YES);
-}
-
-- (void)_webView:(WKWebView *)webView checkUserMediaPermissionForURL:(NSURL *)url mainFrameURL:(NSURL *)mainFrameURL frameIdentifier:(NSUInteger)frameIdentifier decisionHandler:(void (^)(NSString *salt, BOOL authorized))decisionHandler
-{
-    decisionHandler(@"0x987654321", YES);
-}
-- (void)_webView:(WKWebView *)webView mediaCaptureStateDidChange:(_WKMediaCaptureState)state
-{
-    if (state == _WKMediaCaptureStateActiveMicrophone)
-        hasRecievedCorrectCaptureState = true;
-}
-@end
-
-namespace TestWebKitAPI {
-
-TEST(WebKit2, MediaStreamTrackDetached)
-{
-    auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
-    auto processPoolConfig = adoptNS([[_WKProcessPoolConfiguration alloc] init]);
-    auto preferences = [configuration preferences];
-    preferences._mediaCaptureRequiresSecureConnection = NO;
-    preferences._mediaDevicesEnabled = YES;
-    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500) configuration:configuration.get() processPoolConfiguration:processPoolConfig.get()]);
-    auto delegate = adoptNS([[MediaStreamTrackDetachedUIDelegate alloc] init]);
-    webView.get().UIDelegate = delegate.get();
-
-    hasRecievedCorrectCaptureState = false;
-    [webView loadTestPageNamed:@"mediastreamtrack-detached"];
-
-    TestWebKitAPI::Util::run(&hasRecievedCorrectCaptureState);
-
-
-}
-
-} // namespace TestWebKitAPI
-
-#endif // ENABLE(MEDIA_STREAM)
-
-#endif // WK_API_ENABLED

Deleted: trunk/Tools/TestWebKitAPI/Tests/WebKit2/mediastreamtrack-detached.html (218368 => 218369)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit2/mediastreamtrack-detached.html	2017-06-15 23:49:12 UTC (rev 218368)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2/mediastreamtrack-detached.html	2017-06-16 00:16:36 UTC (rev 218369)
@@ -1,23 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script>
-var audioTrack;
-
-function go() {
-    var constraints = { audio: true, video: true};
-    navigator.mediaDevices.getUserMedia(constraints).then(gotUserMedia);
-}
-
-function gotUserMedia(stream) {
-    audioTrack = stream.getAudioTracks()[0];
-    stream.removeTrack(audioTrack);
-
-    stream.getTracks().forEach(track => { track.stop(); });
-}
-</script>
-</head>
-<body _onload_="go()">
-    <div>This tests the behavior of the media capture indicator when a live MediaStreamTrack is removed from a MediaStream, and all the other tracks are stopped. The page should request access to the camera and microphone, and then display a audio-capture icon. If the page displays a camera icon or no capture icon at all, the test has failed.</div>
-</body>
-</html>
\ No newline at end of file
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to