Title: [132726] trunk
Revision
132726
Author
t...@chromium.org
Date
2012-10-27 08:13:49 -0700 (Sat, 27 Oct 2012)

Log Message

Remove internals shouldDisplayTrackKind methods; these are also on internals.settings
https://bugs.webkit.org/show_bug.cgi?id=100564

Reviewed by Adam Barth.

Source/WebCore:

Remove duplicate methods from internals that was just forwarding on the call to internals.settings.
Also fix a bug where we didn't reset these settings properly.

No new tests, this is covered by existing media/track tests.

* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup): Properly save display track settings.
(WebCore::InternalSettings::Backup::restoreTo): Restore display track settings.
* testing/InternalSettings.h:
* testing/InternalSettings.idl: Use [Conditional=VIDEO_TRACK].
* testing/Internals.cpp: Remove code.
* testing/Internals.h: Remove code.
* testing/Internals.idl: Remove code.

LayoutTests:

Update tests to use the internals.settings method.

* media/track/track-language-preference-expected.txt:
* media/track/track-language-preference.html:
* media/track/track-prefer-captions-expected.txt:
* media/track/track-prefer-captions.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (132725 => 132726)


--- trunk/LayoutTests/ChangeLog	2012-10-27 15:11:30 UTC (rev 132725)
+++ trunk/LayoutTests/ChangeLog	2012-10-27 15:13:49 UTC (rev 132726)
@@ -1,3 +1,17 @@
+2012-10-27  Tony Chang  <t...@chromium.org>
+
+        Remove internals shouldDisplayTrackKind methods; these are also on internals.settings
+        https://bugs.webkit.org/show_bug.cgi?id=100564
+
+        Reviewed by Adam Barth.
+
+        Update tests to use the internals.settings method.
+
+        * media/track/track-language-preference-expected.txt:
+        * media/track/track-language-preference.html:
+        * media/track/track-prefer-captions-expected.txt:
+        * media/track/track-prefer-captions.html:
+
 2012-10-26  Philip Rogers  <p...@google.com>
 
         Prevent NaN offset values in ElementTimeControl.

Modified: trunk/LayoutTests/media/track/track-language-preference-expected.txt (132725 => 132726)


--- trunk/LayoutTests/media/track/track-language-preference-expected.txt	2012-10-27 15:11:30 UTC (rev 132725)
+++ trunk/LayoutTests/media/track/track-language-preference-expected.txt	2012-10-27 15:13:49 UTC (rev 132726)
@@ -1,7 +1,7 @@
 Tests that the user's preferred languages are honored.
 
 **Set track preferences and user preferred languages
-RUN(internals.setShouldDisplayTrackKind(document, 'Captions', true))
+RUN(internals.settings.setShouldDisplayTrackKind('Captions', true))
 RUN(internals.setUserPreferredLanguages(['jp', 'es-ES', 'en', 'fr']))
 
 Test: a track language matches one of the user's preferred languages exactly.

Modified: trunk/LayoutTests/media/track/track-language-preference.html (132725 => 132726)


--- trunk/LayoutTests/media/track/track-language-preference.html	2012-10-27 15:11:30 UTC (rev 132725)
+++ trunk/LayoutTests/media/track/track-language-preference.html	2012-10-27 15:13:49 UTC (rev 132726)
@@ -75,7 +75,7 @@
                 }
 
                 consoleWrite("<i>**Set track preferences and user preferred languages<" + "/i>");
-                run("internals.setShouldDisplayTrackKind(document, 'Captions', true)");
+                run("internals.settings.setShouldDisplayTrackKind('Captions', true)");
                 run("internals.setUserPreferredLanguages(['jp', 'es-ES', 'en', 'fr'])");
             }
             

Modified: trunk/LayoutTests/media/track/track-prefer-captions-expected.txt (132725 => 132726)


--- trunk/LayoutTests/media/track/track-prefer-captions-expected.txt	2012-10-27 15:11:30 UTC (rev 132725)
+++ trunk/LayoutTests/media/track/track-prefer-captions-expected.txt	2012-10-27 15:13:49 UTC (rev 132726)
@@ -1,12 +1,12 @@
 Tests that the user preferences for track kind are honored.
 
 **Set preferences so subtitles and descriptions load, but captions do not
-RUN(internals.setShouldDisplayTrackKind(document, 'Subtitles', true))
-EXPECTED (internals.shouldDisplayTrackKind(document, 'Subtitles') == 'true') OK
-RUN(internals.setShouldDisplayTrackKind(document, 'Captions', false))
-EXPECTED (internals.shouldDisplayTrackKind(document, 'Captions') == 'false') OK
-RUN(internals.setShouldDisplayTrackKind(document, 'TextDescriptions', true))
-EXPECTED (internals.shouldDisplayTrackKind(document, 'TextDescriptions') == 'true') OK
+RUN(internals.settings.setShouldDisplayTrackKind('Subtitles', true))
+EXPECTED (internals.settings.shouldDisplayTrackKind('Subtitles') == 'true') OK
+RUN(internals.settings.setShouldDisplayTrackKind('Captions', false))
+EXPECTED (internals.settings.shouldDisplayTrackKind('Captions') == 'false') OK
+RUN(internals.settings.setShouldDisplayTrackKind('TextDescriptions', true))
+EXPECTED (internals.settings.shouldDisplayTrackKind('TextDescriptions') == 'true') OK
 
 **Create track elements dynamically so they aren't processed by the media element until after preferences have been configured.
 - creating 'subtitles' track.

Modified: trunk/LayoutTests/media/track/track-prefer-captions.html (132725 => 132726)


--- trunk/LayoutTests/media/track/track-prefer-captions.html	2012-10-27 15:11:30 UTC (rev 132725)
+++ trunk/LayoutTests/media/track/track-prefer-captions.html	2012-10-27 15:13:49 UTC (rev 132726)
@@ -36,8 +36,8 @@
                     return;
                 }
 
-                run("internals.setShouldDisplayTrackKind(document, '" + type + "', " + flag + ")");
-                testExpected("internals.shouldDisplayTrackKind(document, '" + type + "')", flag);
+                run("internals.settings.setShouldDisplayTrackKind('" + type + "', " + flag + ")");
+                testExpected("internals.settings.shouldDisplayTrackKind('" + type + "')", flag);
             }
             
             function createTrackElement(kind, src)

Modified: trunk/Source/WebCore/ChangeLog (132725 => 132726)


--- trunk/Source/WebCore/ChangeLog	2012-10-27 15:11:30 UTC (rev 132725)
+++ trunk/Source/WebCore/ChangeLog	2012-10-27 15:13:49 UTC (rev 132726)
@@ -1,3 +1,24 @@
+2012-10-27  Tony Chang  <t...@chromium.org>
+
+        Remove internals shouldDisplayTrackKind methods; these are also on internals.settings
+        https://bugs.webkit.org/show_bug.cgi?id=100564
+
+        Reviewed by Adam Barth.
+
+        Remove duplicate methods from internals that was just forwarding on the call to internals.settings.
+        Also fix a bug where we didn't reset these settings properly.
+
+        No new tests, this is covered by existing media/track tests.
+
+        * testing/InternalSettings.cpp:
+        (WebCore::InternalSettings::Backup::Backup): Properly save display track settings.
+        (WebCore::InternalSettings::Backup::restoreTo): Restore display track settings.
+        * testing/InternalSettings.h:
+        * testing/InternalSettings.idl: Use [Conditional=VIDEO_TRACK].
+        * testing/Internals.cpp: Remove code.
+        * testing/Internals.h: Remove code.
+        * testing/Internals.idl: Remove code.
+
 2012-10-26  Ilya Tikhonovsky  <loi...@chromium.org>
 
         Web Inspector: instrument chromium GlyphCache. It keeps ~2mb.

Modified: trunk/Source/WebCore/testing/InternalSettings.cpp (132725 => 132726)


--- trunk/Source/WebCore/testing/InternalSettings.cpp	2012-10-27 15:11:30 UTC (rev 132725)
+++ trunk/Source/WebCore/testing/InternalSettings.cpp	2012-10-27 15:13:49 UTC (rev 132726)
@@ -96,6 +96,11 @@
     , m_originalMockScrollbarsEnabled(settings->mockScrollbarsEnabled())
     , m_langAttributeAwareFormControlUIEnabled(RuntimeEnabledFeatures::langAttributeAwareFormControlUIEnabled())
     , m_imagesEnabled(settings->areImagesEnabled())
+#if ENABLE(VIDEO_TRACK)
+    , m_shouldDisplaySubtitles(settings->shouldDisplaySubtitles())
+    , m_shouldDisplayCaptions(settings->shouldDisplayCaptions())
+    , m_shouldDisplayTextDescriptions(settings->shouldDisplayTextDescriptions())
+#endif
 {
 }
 
@@ -133,6 +138,11 @@
     settings->setMockScrollbarsEnabled(m_originalMockScrollbarsEnabled);
     RuntimeEnabledFeatures::setLangAttributeAwareFormControlUIEnabled(m_langAttributeAwareFormControlUIEnabled);
     settings->setImagesEnabled(m_imagesEnabled);
+#if ENABLE(VIDEO_TRACK)
+    settings->setShouldDisplaySubtitles(m_shouldDisplaySubtitles);
+    settings->setShouldDisplayCaptions(m_shouldDisplayCaptions);
+    settings->setShouldDisplayTextDescriptions(m_shouldDisplayTextDescriptions);
+#endif
 }
 
 InternalSettings* InternalSettings::from(Page* page)

Modified: trunk/Source/WebCore/testing/InternalSettings.h (132725 => 132726)


--- trunk/Source/WebCore/testing/InternalSettings.h	2012-10-27 15:11:30 UTC (rev 132725)
+++ trunk/Source/WebCore/testing/InternalSettings.h	2012-10-27 15:13:49 UTC (rev 132726)
@@ -82,6 +82,11 @@
         bool m_originalMockScrollbarsEnabled;
         bool m_langAttributeAwareFormControlUIEnabled;
         bool m_imagesEnabled;
+#if ENABLE(VIDEO_TRACK)
+        bool m_shouldDisplaySubtitles;
+        bool m_shouldDisplayCaptions;
+        bool m_shouldDisplayTextDescriptions;
+#endif
     };
 
     typedef RefCountedSupplement<Page, InternalSettings> SuperType;

Modified: trunk/Source/WebCore/testing/InternalSettings.idl (132725 => 132726)


--- trunk/Source/WebCore/testing/InternalSettings.idl	2012-10-27 15:11:30 UTC (rev 132725)
+++ trunk/Source/WebCore/testing/InternalSettings.idl	2012-10-27 15:13:49 UTC (rev 132726)
@@ -76,10 +76,8 @@
     void setUserPreferredLanguages(in sequence<String> languages);
     void allowRoundingHacks();
     void setEnableMockPagePopup(in boolean enabled) raises(DOMException);
-#if defined(ENABLE_VIDEO_TRACK) && ENABLE_VIDEO_TRACK
-    void setShouldDisplayTrackKind(in DOMString kind, in boolean enabled) raises (DOMException);
-    boolean shouldDisplayTrackKind(in DOMString trackKind) raises (DOMException);
-#endif
+    [Conditional=VIDEO_TRACK] void setShouldDisplayTrackKind(in DOMString kind, in boolean enabled) raises (DOMException);
+    [Conditional=VIDEO_TRACK] boolean shouldDisplayTrackKind(in DOMString trackKind) raises (DOMException);
     void setMemoryInfoEnabled(in boolean enabled) raises(DOMException);
     void setStorageBlockingPolicy(in DOMString policy) raises(DOMException);
     void setImagesEnabled(in boolean enabled) raises(DOMException);

Modified: trunk/Source/WebCore/testing/Internals.cpp (132725 => 132726)


--- trunk/Source/WebCore/testing/Internals.cpp	2012-10-27 15:11:30 UTC (rev 132725)
+++ trunk/Source/WebCore/testing/Internals.cpp	2012-10-27 15:13:49 UTC (rev 132726)
@@ -1003,16 +1003,6 @@
     settings()->setUserPreferredLanguages(languages);
 }
 
-void Internals::setShouldDisplayTrackKind(Document*, const String& kind, bool enabled, ExceptionCode& ec)
-{
-    settings()->setShouldDisplayTrackKind(kind, enabled, ec);
-}
-
-bool Internals::shouldDisplayTrackKind(Document*, const String& kind, ExceptionCode& ec)
-{
-    return settings()->shouldDisplayTrackKind(kind, ec);
-}
-
 unsigned Internals::wheelEventHandlerCount(Document* document, ExceptionCode& ec)
 {
     if (!document) {

Modified: trunk/Source/WebCore/testing/Internals.h (132725 => 132726)


--- trunk/Source/WebCore/testing/Internals.h	2012-10-27 15:11:30 UTC (rev 132725)
+++ trunk/Source/WebCore/testing/Internals.h	2012-10-27 15:13:49 UTC (rev 132726)
@@ -159,9 +159,6 @@
     Vector<String> userPreferredLanguages() const;
     void setUserPreferredLanguages(const Vector<String>&);
 
-    void setShouldDisplayTrackKind(Document*, const String& kind, bool, ExceptionCode&);
-    bool shouldDisplayTrackKind(Document*, const String& kind, ExceptionCode&);
-
     unsigned wheelEventHandlerCount(Document*, ExceptionCode&);
     unsigned touchEventHandlerCount(Document*, ExceptionCode&);
 

Modified: trunk/Source/WebCore/testing/Internals.idl (132725 => 132726)


--- trunk/Source/WebCore/testing/Internals.idl	2012-10-27 15:11:30 UTC (rev 132725)
+++ trunk/Source/WebCore/testing/Internals.idl	2012-10-27 15:13:49 UTC (rev 132726)
@@ -125,11 +125,6 @@
     long lastSpellCheckRequestSequence(in Document document) raises (DOMException);
     long lastSpellCheckProcessedSequence(in Document document) raises (DOMException);
 
-#if defined(ENABLE_VIDEO_TRACK) && ENABLE_VIDEO_TRACK
-    void setShouldDisplayTrackKind(in Document document, in DOMString kind, in boolean enabled) raises (DOMException);
-    boolean shouldDisplayTrackKind(in Document document, in DOMString trackKind) raises (DOMException);
-#endif
-
     sequence<String> userPreferredLanguages();
     void setUserPreferredLanguages(in sequence<String> languages);
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to