Unreviewed, rolling out r218365.
authorjlewis3@apple.com <jlewis3@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Jun 2017 00:16:36 +0000 (00:16 +0000)
committerjlewis3@apple.com <jlewis3@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Jun 2017 00:16:36 +0000 (00:16 +0000)
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

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@218369 268f45cc-cd09-0410-ab3c-d52691b4dbfc

16 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/MediaStream.cpp
Source/WebCore/Modules/mediastream/MediaStream.h
Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp
Source/WebCore/Modules/mediastream/MediaStreamTrack.h
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h
Source/WebCore/platform/mediastream/MediaStreamPrivate.cpp
Source/WebCore/platform/mediastream/MediaStreamPrivate.h
Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.cpp
Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.h
Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp
Source/WebCore/platform/mediastream/RealtimeMediaSource.h
Tools/ChangeLog
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/WebKit2/MediaStreamTrackDetached.mm [deleted file]
Tools/TestWebKitAPI/Tests/WebKit2/mediastreamtrack-detached.html [deleted file]

index 52c600d547713f33159535d7d83f0ecaecf96405..ba5268e5116496c757d9d0c1e9e0958cdad35729 100644 (file)
@@ -1,3 +1,16 @@
+2017-06-15  Matt Lewis  <jlewis3@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.fraser@apple.com>
 
         Allow use of Layout* TextStream operators in WebKit2
index 99534f1bf7960599be7c005db7819b3fc17576af..3649bc0894af079de1bb06ee09cf36651024b347 100644 (file)
@@ -90,6 +90,7 @@ MediaStream::MediaStream(ScriptExecutionContext& context, const MediaStreamTrack
     setIsActive(m_private->active());
     m_private->addObserver(*this);
     MediaStreamRegistry::shared().registerStream(*this);
+    document()->addAudioProducer(this);
     suspendIfNeeded();
 }
 
@@ -110,6 +111,7 @@ MediaStream::MediaStream(ScriptExecutionContext& context, Ref<MediaStreamPrivate
         track->addObserver(*this);
         m_trackSet.add(track->id(), WTFMove(track));
     }
+    document()->addAudioProducer(this);
     suspendIfNeeded();
 }
 
@@ -123,6 +125,7 @@ MediaStream::~MediaStream()
     for (auto& track : m_trackSet.values())
         track->removeObserver(*this);
     if (Document* document = this->document()) {
+        document->removeAudioProducer(this);
         if (m_isWaitingUntilMediaCanStart)
             document->removeMediaCanStartListener(this);
     }
@@ -319,15 +322,52 @@ void MediaStream::endCaptureTracks()
     }
 }
 
+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 @@ void MediaStream::statusDidChange()
     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();
index 983bd513aa8aa87bb97385db876b4f9236655f4b..836eb63a83e9c89a7370ed530e2691a23a62be40 100644 (file)
@@ -54,6 +54,7 @@ class MediaStream final
     , public ActiveDOMObject
     , public MediaStreamTrack::Observer
     , public MediaStreamPrivate::Observer
+    , private MediaProducer
     , private MediaCanStartListener
     , private PlatformMediaSessionClient
     , public RefCounted<MediaStream> {
@@ -135,7 +136,9 @@ private:
     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 @@ private:
     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 };
index d230694452480847d59f769bcefaa8aa6d17fbe1..697c6957ed40ef58642c3ca0260493d440a7274d 100644 (file)
@@ -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 @@ MediaStreamTrack::MediaStreamTrack(ScriptExecutionContext& context, Ref<MediaStr
     : 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 @@ void MediaStreamTrack::removeObserver(Observer& observer)
     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::trackEnabledChanged(MediaStreamTrackPrivate&)
 
 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::configureTrackRendering()
 void MediaStreamTrack::stop()
 {
     stopTrack();
-    m_taskQueue.close();
 }
 
 const char* MediaStreamTrack::activeDOMObjectName() const
@@ -423,11 +361,6 @@ AudioSourceProvider* MediaStreamTrack::audioSourceProvider()
     return m_private->audioSourceProvider();
 }
 
-Document* MediaStreamTrack::document() const
-{
-    return downcast<Document>(scriptExecutionContext());
-}
-
 } // namespace WebCore
 
 #endif // ENABLE(MEDIA_STREAM)
index f9c0d1ab916ff4b185dae126d6a7c375bd52dc66..38715531d67460e3cc9a8aff602acc52ce0e644a 100644 (file)
 #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"
 
 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 @@ public:
     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 @@ private:
 
     void configureTrackRendering();
 
-    Document* document() const;
-
     // ActiveDOMObject API.
     void stop() final;
     const char* activeDOMObjectName() const final;
@@ -158,7 +144,6 @@ private:
     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 @@ private:
     MediaTrackConstraints m_constraints;
     std::optional<DOMPromiseDeferred<void>> m_promise;
     WeakPtrFactory<MediaStreamTrack> m_weakPtrFactory;
-    GenericTaskQueue<ScriptExecutionContext> m_taskQueue;
 
     bool m_ended { false };
 };
index c3cd988015051a013de33fb9016bc64bf685a99e..0e51eaba93774e5ef71e4b98b38918da08c0d920 100644 (file)
@@ -201,7 +201,6 @@ private:
     void didRemoveTrack(MediaStreamTrackPrivate&) override;
 
     // MediaStreamPrivateTrack::Observer
-    void trackStarted(MediaStreamTrackPrivate&) override { };
     void trackEnded(MediaStreamTrackPrivate&) override { };
     void trackMutedChanged(MediaStreamTrackPrivate&) override { };
     void trackSettingsChanged(MediaStreamTrackPrivate&) override { };
index b24e64e115f7757e001b7de89a9e33c6887e2eaf..4d0e4e602271d7441644d835a278b6d966a5246d 100644 (file)
@@ -281,13 +281,6 @@ void MediaStreamPrivate::trackEnabledChanged(MediaStreamTrackPrivate&)
     });
 }
 
-void MediaStreamPrivate::trackStarted(MediaStreamTrackPrivate&)
-{
-    scheduleDeferredTask([this] {
-        characteristicsChanged();
-    });
-}
-
 void MediaStreamPrivate::trackEnded(MediaStreamTrackPrivate&)
 {
     scheduleDeferredTask([this] {
index 212df90310830a50ec002080b27dd21244261f0a..a79704dd85a359893fb4cff58738a56ad9a16acb 100644 (file)
@@ -125,7 +125,6 @@ private:
     MediaStreamPrivate(const MediaStreamTrackPrivateVector&, String&&);
 
     // MediaStreamTrackPrivate::Observer
-    void trackStarted(MediaStreamTrackPrivate&) override;
     void trackEnded(MediaStreamTrackPrivate&) override;
     void trackMutedChanged(MediaStreamTrackPrivate&) override;
     void trackSettingsChanged(MediaStreamTrackPrivate&) override;
index ee547e32fd863cdf02689fcda796e949638dfb48..f5b4e29e9fbe626a58566f9b081e5f63a8cace4e 100644 (file)
@@ -151,12 +151,6 @@ AudioSourceProvider* MediaStreamTrackPrivate::audioSourceProvider()
     return m_source->audioSourceProvider();
 }
 
-void MediaStreamTrackPrivate::sourceStarted()
-{
-    for (auto& observer : m_observers)
-        observer->trackStarted(*this);
-}
-
 void MediaStreamTrackPrivate::sourceStopped()
 {
     if (m_isEnded)
index a96c76ba68c066a3aba56f4e8119e0bdc37b1127..aed379158d1b7f05ccc8afcbc9285760a23e9acc 100644 (file)
@@ -43,7 +43,6 @@ public:
     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 @@ private:
     MediaStreamTrackPrivate(Ref<RealtimeMediaSource>&&, String&& id);
 
     // RealtimeMediaSourceObserver
-    void sourceStarted() final;
     void sourceStopped() final;
     void sourceMutedChanged() final;
     void sourceEnabledChanged() final;
index 06cb44356971cb3f60a5d86070b552381256c574..57586294ec0d20089efaf62a475629526254c7ba 100644 (file)
@@ -162,9 +162,6 @@ void RealtimeMediaSource::start()
 
     m_isProducingData = true;
     startProducingData();
-
-    for (Observer& observer : m_observers)
-        observer.sourceStarted();
 }
 
 void RealtimeMediaSource::stop()
index 3a631086821572ac9894f263ae040c74a4adec72..1dbc07db4ffd6abef5c7cee75be9b7c06f5b17ba 100644 (file)
@@ -70,7 +70,6 @@ public:
         virtual ~Observer() { }
         
         // Source state changes.
-        virtual void sourceStarted() { }
         virtual void sourceStopped() { }
         virtual void sourceMutedChanged() { }
         virtual void sourceEnabledChanged() { }
index 565e6dc4dc88f9db19f6ee1ac5aa9c551731caf4..2abdb043bcaaae01e3cb08494375cec706107741 100644 (file)
@@ -1,3 +1,16 @@
+2017-06-15  Matt Lewis  <jlewis3@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.noble@apple.com>
 
         [WebRTC] Removing a MediaStreamTrack from a MediaStream reports no recording to WebKit clients
index 3afe7a264a6296c186d91ab30eb42d7ba131ea41..dcb669353b1b13f04773f1d41bf85a58d6ee41e0 100644 (file)
                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 */; };
                        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 */,
                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>"; };
                                33DC8910141953A300747EF7 /* LoadCanceledNoServerRedirectCallback.cpp */,
                                33DC89131419579F00747EF7 /* LoadCanceledNoServerRedirectCallback_Bundle.cpp */,
                                8AA28C1916D2FA7B002FF4DB /* LoadPageOnCrash.cpp */,
-                               CDC9442C1EF1FC080059C3C4 /* MediaStreamTrackDetached.mm */,
                                7A5623101AD5AF3E0096B920 /* MenuTypesForMouseEvents.cpp */,
                                51CB4AD71B3A079C00C1B1C6 /* ModalAlertsSPI.cpp */,
                                33BE5AF4137B5A6C00705813 /* MouseMoveAfterCrash.cpp */,
                                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 */,
                                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 */,
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/MediaStreamTrackDetached.mm b/Tools/TestWebKitAPI/Tests/WebKit2/MediaStreamTrackDetached.mm
deleted file mode 100644 (file)
index 1ffac67..0000000
+++ /dev/null
@@ -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
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/mediastreamtrack-detached.html b/Tools/TestWebKitAPI/Tests/WebKit2/mediastreamtrack-detached.html
deleted file mode 100644 (file)
index 3bc1692..0000000
+++ /dev/null
@@ -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