REGRESSION(r162145): media/video-controls-visible-audio-only.html fails
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Jan 2014 02:12:19 +0000 (02:12 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Jan 2014 02:12:19 +0000 (02:12 +0000)
https://bugs.webkit.org/show_bug.cgi?id=127147

Source/WebCore:

Reviewed by Eric Carlson.

Reset the MediaSessionManager's restrictions to their default values before
each run.

Add a new virtual method "resetRestrictions()" so that each port-specific
MediaSessionManager can reset the restrictions to their default values.
Call this from Internals::resetToConsistentState() so that tests which change
the restrictions don't affect later tests.

* platform/audio/MediaSessionManager.cpp:
(WebCore::MediaSessionManager::MediaSessionManager):
(WebCore::MediaSessionManager::resetRestrictions):
* platform/audio/MediaSessionManager.h:
(WebCore::MediaSessionManager::~MediaSessionManager):
* platform/audio/ios/MediaSessionManagerIOS.h:
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::resetRestrictions):
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):

LayoutTests:

Re-enable media/video-controls-visible-audio-only.html.

Reviewed by Eric Carlson.

* platform/mac/TestExpectations:

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

LayoutTests/ChangeLog
LayoutTests/platform/mac/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/platform/audio/MediaSessionManager.cpp
Source/WebCore/platform/audio/MediaSessionManager.h
Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.h
Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm
Source/WebCore/testing/Internals.cpp

index 5f59c54c7bde60b7f81bdfc5b4a32cd31f00d0fa..13403adbcd50b38f9781aaf31da7e51cf89d84bf 100644 (file)
@@ -1,3 +1,14 @@
+2014-01-16  Jer Noble  <jer.noble@apple.com>
+
+        REGRESSION(r162145): media/video-controls-visible-audio-only.html fails
+        https://bugs.webkit.org/show_bug.cgi?id=127147
+
+        Re-enable media/video-controls-visible-audio-only.html.
+
+        Reviewed by Eric Carlson.
+
+        * platform/mac/TestExpectations:
+
 2014-01-16  Alexey Proskuryakov  <ap@apple.com>
 
         REGRESSION(r162145): media/video-controls-visible-audio-only.html fails
index d3920517315415a7b00ad0642071ef08cc43375f..e0f84fa0f571b63cecb677719fefb84e372d1cd3 100644 (file)
@@ -1362,5 +1362,3 @@ webkit.org/b/126899 svg/custom/masking-clipping-hidpi.svg
 
 # Subpixel: misplaced zoomed svg content.
 webkit.org/b/126900 svg/zoom/page/zoom-zoom-coords.xhtml
-
-webkit.org/b/127147 media/video-controls-visible-audio-only.html [ Pass Failure ]
index 8cc590ed561132419c2a8b823010c7502182a235..de1f3fa317a26a95d5c05097c4ca9b8abf9f0065 100644 (file)
@@ -1,3 +1,29 @@
+2014-01-16  Jer Noble  <jer.noble@apple.com>
+
+        REGRESSION(r162145): media/video-controls-visible-audio-only.html fails
+        https://bugs.webkit.org/show_bug.cgi?id=127147
+
+        Reviewed by Eric Carlson.
+
+        Reset the MediaSessionManager's restrictions to their default values before
+        each run.
+
+        Add a new virtual method "resetRestrictions()" so that each port-specific
+        MediaSessionManager can reset the restrictions to their default values.
+        Call this from Internals::resetToConsistentState() so that tests which change
+        the restrictions don't affect later tests.
+
+        * platform/audio/MediaSessionManager.cpp:
+        (WebCore::MediaSessionManager::MediaSessionManager):
+        (WebCore::MediaSessionManager::resetRestrictions):
+        * platform/audio/MediaSessionManager.h:
+        (WebCore::MediaSessionManager::~MediaSessionManager):
+        * platform/audio/ios/MediaSessionManagerIOS.h:
+        * platform/audio/ios/MediaSessionManagerIOS.mm:
+        (WebCore::MediaSessionManageriOS::resetRestrictions):
+        * testing/Internals.cpp:
+        (WebCore::Internals::resetToConsistentState):
+
 2014-01-16  Alex Christensen  <achristensen@webkit.org>
 
         Compile fix for WinCairo after r162138.
index 4144fb34f21064d42636ab3f79f38eaf3177d416..f049c6787215d3076c9d3e6587d5da59aac382ba 100644 (file)
@@ -40,6 +40,11 @@ MediaSessionManager& MediaSessionManager::sharedManager()
 
 MediaSessionManager::MediaSessionManager()
     : m_interruptions(0)
+{
+    resetRestrictions();
+}
+
+void MediaSessionManager::resetRestrictions()
 {
     m_restrictions[MediaSession::Video] = NoRestrictions;
     m_restrictions[MediaSession::Audio] = NoRestrictions;
index 096daf0c63136b4ecbec0b23d08eeffd5a8090f8..a2b34010edb0eaca33dcc68792b784feca2c7df2 100644 (file)
@@ -39,6 +39,7 @@ class MediaSession;
 class MediaSessionManager {
 public:
     static MediaSessionManager& sharedManager();
+    virtual ~MediaSessionManager() { }
 
     bool has(MediaSession::MediaType) const;
     int count(MediaSession::MediaType) const;
@@ -56,6 +57,7 @@ public:
     void addRestriction(MediaSession::MediaType, SessionRestrictions);
     void removeRestriction(MediaSession::MediaType, SessionRestrictions);
     SessionRestrictions restrictions(MediaSession::MediaType);
+    virtual void resetRestrictions();
 
     void sessionWillBeginPlayback(const MediaSession&) const;
     bool sessionRestrictsInlineVideoPlayback(const MediaSession&) const;
index 61528b90f5c51897b4dae01d11c149bf908036d9..b3ac71da442864109e304b3f5571209c58c28440 100644 (file)
@@ -42,6 +42,8 @@ public:
 private:
     friend class MediaSessionManager;
 
+    virtual void resetRestrictions() override;
+
     MediaSessionManageriOS();
     RetainPtr<WebMediaSessionHelper> m_objcObserver;
 };
index 2647bd0da4d3a25d7aa815301a4bdab12559c7c2..42d66244ca11b4dad47a7d39945717a37ce2eb48 100644 (file)
@@ -73,6 +73,12 @@ MediaSessionManageriOS::MediaSessionManageriOS()
     :MediaSessionManager()
     , m_objcObserver(adoptNS([[WebMediaSessionHelper alloc] initWithCallback:this]))
 {
+}
+
+void MediaSessionManageriOS::resetRestrictions()
+{
+    MediaSessionManager::resetRestrictions();
+
     DEFINE_STATIC_LOCAL(wkDeviceClass, deviceClass, (iosDeviceClass()));
 
     if (deviceClass == wkDeviceClassiPhone || deviceClass == wkDeviceClassiPod)
@@ -81,8 +87,6 @@ MediaSessionManageriOS::MediaSessionManageriOS()
     addRestriction(MediaSession::Video, ConcurrentPlaybackNotPermitted);
 }
 
-}
-
 @implementation WebMediaSessionHelper
 
 - (id)initWithCallback:(MediaSessionManageriOS*)callback
index 824e7854772e03838637fdc4e23272a4c9aec598..93c9bf23cf9588c3d3da83853eaddcb402272665 100644 (file)
@@ -292,6 +292,9 @@ void Internals::resetToConsistentState(Page* page)
     if (page->mainFrame().editor().isOverwriteModeEnabled())
         page->mainFrame().editor().toggleOverwriteModeEnabled();
     cacheStorage().setDefaultOriginQuota(ApplicationCacheStorage::noQuota());
+#if ENABLE(VIDEO)
+    MediaSessionManager::sharedManager().resetRestrictions();
+#endif
 }
 
 Internals::Internals(Document* document)