Chromium Code Reviews| Index: Source/core/testing/InternalSettings.cpp |
| diff --git a/Source/core/testing/InternalSettings.cpp b/Source/core/testing/InternalSettings.cpp |
| index d8be81d83a0cd79dc6ca77edd09f68f2d804aefd..69391751a85225422ded62965049d6988b1f52d8 100644 |
| --- a/Source/core/testing/InternalSettings.cpp |
| +++ b/Source/core/testing/InternalSettings.cpp |
| @@ -291,6 +291,23 @@ void InternalSettings::setTextAutosizingWindowSizeOverride(int width, int height |
| settings()->setTextAutosizingWindowSizeOverride(IntSize(width, height)); |
| } |
| +void InternalSettings::setTextTrackKindUserPreference(const String& preference, ExceptionState& exceptionState) |
| +{ |
| + InternalSettingsGuardForSettings(); |
| + String token = preference.stripWhiteSpace(); |
| + TextTrackKindUserPreference userPreference = TextTrackKindUserPreference::Default; |
| + if (token == "default") |
| + userPreference = TextTrackKindUserPreference::Default; |
| + else if (token == "captions") |
| + userPreference = TextTrackKindUserPreference::Captions; |
| + else if (token == "subtitles") |
| + userPreference = TextTrackKindUserPreference::Subtitles; |
| + else |
| + exceptionState.throwDOMException(SyntaxError, "The user preference for text track kind " + preference + ")' is invalid."); |
|
philipj_slow
2015/07/09 15:34:09
This should also return, otherwise we'll still cal
srivats
2015/07/09 21:25:37
Since userPreference is initialized to Default, if
philipj_slow
2015/07/09 22:36:26
I don't think continuing the execution after throw
|
| + |
| + settings()->setTextTrackKindUserPreference(userPreference); |
| +} |
| + |
| void InternalSettings::setMediaTypeOverride(const String& mediaType, ExceptionState& exceptionState) |
| { |
| InternalSettingsGuardForSettings(); |