<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[247956] branches/safari-608-branch</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/247956">247956</a></dd>
<dt>Author</dt> <dd>alancoon@apple.com</dd>
<dt>Date</dt> <dd>2019-07-29 20:54:19 -0700 (Mon, 29 Jul 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>Cherry-pick <a href="http://trac.webkit.org/projects/webkit/changeset/247695">r247695</a>. rdar://problem/53648210

    REGRESSION(rUnknown): YouTube playback pauses when switching to a new tab
    https://bugs.webkit.org/show_bug.cgi?id=199971
    <rdar://problem/51951218>

    Reviewed by Alex Christensen.

    Source/WebKit:

    When we get a message notifying us that the view has been removed from the window, we unconditionally
    ask the fullscreen manager to exit fullscreen, which has the side effect (on iOS) of pausing the video
    unconditionally. Only ask the fullscreen manager to exit fullscreen if there is actually a video in
    fullscreen mode.

    * UIProcess/WebPageProxy.cpp:
    (WebKit::WebPageProxy::viewDidLeaveWindow):

    Tools:

    * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
    * TestWebKitAPI/Tests/WebKitCocoa/NoPauseWhenSwitchingTabs.mm: Added.
    (TestWebKitAPI::TEST):

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247695 268f45cc-cd09-0410-ab3c-d52691b4dbfc</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari608branchSourceWebKitChangeLog">branches/safari-608-branch/Source/WebKit/ChangeLog</a></li>
<li><a href="#branchessafari608branchSourceWebKitUIProcessWebPageProxycpp">branches/safari-608-branch/Source/WebKit/UIProcess/WebPageProxy.cpp</a></li>
<li><a href="#branchessafari608branchToolsChangeLog">branches/safari-608-branch/Tools/ChangeLog</a></li>
<li><a href="#branchessafari608branchToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj">branches/safari-608-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari608branchToolsTestWebKitAPITestsWebKitCocoaNoPauseWhenSwitchingTabsmm">branches/safari-608-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/NoPauseWhenSwitchingTabs.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari608branchSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-608-branch/Source/WebKit/ChangeLog (247955 => 247956)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-608-branch/Source/WebKit/ChangeLog       2019-07-30 03:54:16 UTC (rev 247955)
+++ branches/safari-608-branch/Source/WebKit/ChangeLog  2019-07-30 03:54:19 UTC (rev 247956)
</span><span class="lines">@@ -1,5 +1,50 @@
</span><span class="cx"> 2019-07-29  Alan Coon  <alancoon@apple.com>
</span><span class="cx"> 
</span><ins>+        Cherry-pick r247695. rdar://problem/53648210
+
+    REGRESSION(rUnknown): YouTube playback pauses when switching to a new tab
+    https://bugs.webkit.org/show_bug.cgi?id=199971
+    <rdar://problem/51951218>
+    
+    Reviewed by Alex Christensen.
+    
+    Source/WebKit:
+    
+    When we get a message notifying us that the view has been removed from the window, we unconditionally
+    ask the fullscreen manager to exit fullscreen, which has the side effect (on iOS) of pausing the video
+    unconditionally. Only ask the fullscreen manager to exit fullscreen if there is actually a video in
+    fullscreen mode.
+    
+    * UIProcess/WebPageProxy.cpp:
+    (WebKit::WebPageProxy::viewDidLeaveWindow):
+    
+    Tools:
+    
+    * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+    * TestWebKitAPI/Tests/WebKitCocoa/NoPauseWhenSwitchingTabs.mm: Added.
+    (TestWebKitAPI::TEST):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247695 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-07-22  Jer Noble  <jer.noble@apple.com>
+
+            REGRESSION(rUnknown): YouTube playback pauses when switching to a new tab
+            https://bugs.webkit.org/show_bug.cgi?id=199971
+            <rdar://problem/51951218>
+
+            Reviewed by Alex Christensen.
+
+            When we get a message notifying us that the view has been removed from the window, we unconditionally
+            ask the fullscreen manager to exit fullscreen, which has the side effect (on iOS) of pausing the video
+            unconditionally. Only ask the fullscreen manager to exit fullscreen if there is actually a video in
+            fullscreen mode.
+
+            * UIProcess/WebPageProxy.cpp:
+            (WebKit::WebPageProxy::viewDidLeaveWindow):
+
+2019-07-29  Alan Coon  <alancoon@apple.com>
+
</ins><span class="cx">         Cherry-pick r247687. rdar://problem/53648060
</span><span class="cx"> 
</span><span class="cx">     [iOS] REGRESSION (r241734): Autocorrection highlight should hide when field becomes defocused
</span></span></pre></div>
<a id="branchessafari608branchSourceWebKitUIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: branches/safari-608-branch/Source/WebKit/UIProcess/WebPageProxy.cpp (247955 => 247956)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-608-branch/Source/WebKit/UIProcess/WebPageProxy.cpp      2019-07-30 03:54:16 UTC (rev 247955)
+++ branches/safari-608-branch/Source/WebKit/UIProcess/WebPageProxy.cpp 2019-07-30 03:54:19 UTC (rev 247956)
</span><span class="lines">@@ -1701,7 +1701,7 @@
</span><span class="cx">     closeOverlayedViews();
</span><span class="cx"> #if PLATFORM(IOS_FAMILY) && HAVE(AVKIT) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
</span><span class="cx">     // When leaving the current page, close the video fullscreen.
</span><del>-    if (m_videoFullscreenManager)
</del><ins>+    if (m_videoFullscreenManager && m_videoFullscreenManager->hasMode(WebCore::HTMLMediaElementEnums::VideoFullscreenModeStandard))
</ins><span class="cx">         m_videoFullscreenManager->requestHideAndExitFullscreen();
</span><span class="cx"> #endif
</span><span class="cx"> }
</span></span></pre></div>
<a id="branchessafari608branchToolsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-608-branch/Tools/ChangeLog (247955 => 247956)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-608-branch/Tools/ChangeLog       2019-07-30 03:54:16 UTC (rev 247955)
+++ branches/safari-608-branch/Tools/ChangeLog  2019-07-30 03:54:19 UTC (rev 247956)
</span><span class="lines">@@ -1,5 +1,46 @@
</span><span class="cx"> 2019-07-29  Alan Coon  <alancoon@apple.com>
</span><span class="cx"> 
</span><ins>+        Cherry-pick r247695. rdar://problem/53648210
+
+    REGRESSION(rUnknown): YouTube playback pauses when switching to a new tab
+    https://bugs.webkit.org/show_bug.cgi?id=199971
+    <rdar://problem/51951218>
+    
+    Reviewed by Alex Christensen.
+    
+    Source/WebKit:
+    
+    When we get a message notifying us that the view has been removed from the window, we unconditionally
+    ask the fullscreen manager to exit fullscreen, which has the side effect (on iOS) of pausing the video
+    unconditionally. Only ask the fullscreen manager to exit fullscreen if there is actually a video in
+    fullscreen mode.
+    
+    * UIProcess/WebPageProxy.cpp:
+    (WebKit::WebPageProxy::viewDidLeaveWindow):
+    
+    Tools:
+    
+    * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+    * TestWebKitAPI/Tests/WebKitCocoa/NoPauseWhenSwitchingTabs.mm: Added.
+    (TestWebKitAPI::TEST):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247695 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-07-22  Jer Noble  <jer.noble@apple.com>
+
+            REGRESSION(rUnknown): YouTube playback pauses when switching to a new tab
+            https://bugs.webkit.org/show_bug.cgi?id=199971
+            <rdar://problem/51951218>
+
+            Reviewed by Alex Christensen.
+
+            * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+            * TestWebKitAPI/Tests/WebKitCocoa/NoPauseWhenSwitchingTabs.mm: Added.
+            (TestWebKitAPI::TEST):
+
+2019-07-29  Alan Coon  <alancoon@apple.com>
+
</ins><span class="cx">         Cherry-pick r247692. rdar://problem/53519917
</span><span class="cx"> 
</span><span class="cx">     Disable MediaRecorder for legacy WebKit
</span></span></pre></div>
<a id="branchessafari608branchToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: branches/safari-608-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (247955 => 247956)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-608-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj   2019-07-30 03:54:16 UTC (rev 247955)
+++ branches/safari-608-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj      2019-07-30 03:54:19 UTC (rev 247956)
</span><span class="lines">@@ -866,6 +866,7 @@
</span><span class="cx">          CDC9442E1EF1FC080059C3C4 /* MediaStreamTrackDetached.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDC9442C1EF1FC080059C3C4 /* MediaStreamTrackDetached.mm */; };
</span><span class="cx">          CDC9442F1EF205D60059C3C4 /* mediastreamtrack-detached.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CDC9442B1EF1FBD20059C3C4 /* mediastreamtrack-detached.html */; };
</span><span class="cx">          CDCFA7AA1E45183200C2433D /* SampleMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDCFA7A91E45122F00C2433D /* SampleMap.cpp */; };
</span><ins>+               CDCFFEC122E26A1500DF4223 /* NoPauseWhenSwitchingTabs.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDCFFEC022E268D500DF4223 /* NoPauseWhenSwitchingTabs.mm */; };
</ins><span class="cx">           CDD68F0D22C18317000CF0AE /* WKWebViewCloseAllMediaPresentations.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDD68F0C22C18317000CF0AE /* WKWebViewCloseAllMediaPresentations.mm */; };
</span><span class="cx">          CDE195B51CFE0B880053D256 /* FullscreenTopContentInset.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CDE195B21CFE0ADE0053D256 /* FullscreenTopContentInset.html */; };
</span><span class="cx">          CDF0B78A216D48DC00421ECC /* CloseWebViewDuringEnterFullscreen.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDF0B789216D484300421ECC /* CloseWebViewDuringEnterFullscreen.mm */; };
</span><span class="lines">@@ -2285,6 +2286,7 @@
</span><span class="cx">          CDC9442B1EF1FBD20059C3C4 /* mediastreamtrack-detached.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = "mediastreamtrack-detached.html"; sourceTree = "<group>"; };
</span><span class="cx">          CDC9442C1EF1FC080059C3C4 /* MediaStreamTrackDetached.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MediaStreamTrackDetached.mm; sourceTree = "<group>"; };
</span><span class="cx">          CDCFA7A91E45122F00C2433D /* SampleMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SampleMap.cpp; sourceTree = "<group>"; };
</span><ins>+               CDCFFEC022E268D500DF4223 /* NoPauseWhenSwitchingTabs.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NoPauseWhenSwitchingTabs.mm; sourceTree = "<group>"; };
</ins><span class="cx">           CDD68F0C22C18317000CF0AE /* WKWebViewCloseAllMediaPresentations.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKWebViewCloseAllMediaPresentations.mm; sourceTree = "<group>"; };
</span><span class="cx">          CDE195B21CFE0ADE0053D256 /* FullscreenTopContentInset.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = FullscreenTopContentInset.html; sourceTree = "<group>"; };
</span><span class="cx">          CDE195B31CFE0ADE0053D256 /* FullscreenTopContentInset.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FullscreenTopContentInset.mm; sourceTree = "<group>"; };
</span><span class="lines">@@ -2735,6 +2737,7 @@
</span><span class="cx">                          6351992722275C6A00890AD3 /* NavigationAction.mm */,
</span><span class="cx">                          5C8BC798218CF3E900813886 /* NetworkProcess.mm */,
</span><span class="cx">                          5CAE4637201937CD0051610F /* NetworkProcessCrashNonPersistentDataStore.mm */,
</span><ins>+                               CDCFFEC022E268D500DF4223 /* NoPauseWhenSwitchingTabs.mm */,
</ins><span class="cx">                           CD2D0D19213465560018C784 /* NowPlaying.mm */,
</span><span class="cx">                          2ECFF5541D9B12F800B55394 /* NowPlayingControlsTests.mm */,
</span><span class="cx">                          A10F047C1E3AD29C00C95E19 /* NSFileManagerExtras.mm */,
</span><span class="lines">@@ -4714,6 +4717,7 @@
</span><span class="cx">                          9BD4239A1E04BD9800200395 /* AttributedSubstringForProposedRangeWithImage.mm in Sources */,
</span><span class="cx">                          5C9D923122D7E0EB008E9266 /* ClassMethodSwizzler.mm in Sources */,
</span><span class="cx">                          2E7765CD16C4D80A00BA2BB1 /* mainIOS.mm in Sources */,
</span><ins>+                               CDCFFEC122E26A1500DF4223 /* NoPauseWhenSwitchingTabs.mm in Sources */,
</ins><span class="cx">                           2E7765CF16C4D81100BA2BB1 /* mainMac.mm in Sources */,
</span><span class="cx">                          5797FE311EB15A6800B2F4A0 /* NavigationClientDefaultCrypto.cpp in Sources */,
</span><span class="cx">                          7AD3FE8E1D76131200B169A4 /* TransformationMatrix.cpp in Sources */,
</span></span></pre></div>
<a id="branchessafari608branchToolsTestWebKitAPITestsWebKitCocoaNoPauseWhenSwitchingTabsmm"></a>
<div class="addfile"><h4>Added: branches/safari-608-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/NoPauseWhenSwitchingTabs.mm (0 => 247956)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-608-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/NoPauseWhenSwitchingTabs.mm                             (rev 0)
+++ branches/safari-608-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/NoPauseWhenSwitchingTabs.mm        2019-07-30 03:54:19 UTC (rev 247956)
</span><span class="lines">@@ -0,0 +1,65 @@
</span><ins>+/*
+ * Copyright (C) 2019 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.
+ */
+
+#include "config.h"
+
+#import "PlatformUtilities.h"
+#import "Test.h"
+#import "TestWKWebView.h"
+#import <WebKit/WKPreferencesPrivate.h>
+#import <WebKit/WKUIDelegatePrivate.h>
+#import <WebKit/WKWebViewConfigurationPrivate.h>
+#import <WebKit/_WKFullscreenDelegate.h>
+#import <wtf/RetainPtr.h>
+#import <wtf/Seconds.h>
+
+namespace TestWebKitAPI {
+
+TEST(WebKit, NoPauseWhenSwitchingTabs)
+{
+    auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
+#if PLATFORM(IOS)
+    configuration.get().allowsInlineMediaPlayback = YES;
+    configuration.get()._inlineMediaPlaybackRequiresPlaysInlineAttribute = NO;
+#endif
+    configuration.get()._mediaDataLoadsAutomatically = YES;
+    configuration.get().mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeAudio;
+
+    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 300, 300) configuration:configuration.get() addToWindow:YES]);
+
+    [webView synchronouslyLoadTestPageNamed:@"video-with-audio"];
+
+    [webView evaluateJavaScript:@"document.querySelector('video').addEventListener('playing', playing)" completionHandler:nil];
+
+    __block bool didBeginPlaying = false;
+    [webView performAfterReceivingMessage:@"playing" action:^{ didBeginPlaying = true; }];
+    [webView evaluateJavaScript:@"document.querySelector('video').play()" completionHandler:nil];
+    TestWebKitAPI::Util::run(&didBeginPlaying);
+
+    [webView removeFromSuperview];
+    ASSERT_STREQ([[webView stringByEvaluatingJavaScript:@"document.querySelector('video').paused"] UTF8String], "0");
+}
+
+} // namespace TestWebKitAPI
</ins></span></pre>
</div>
</div>

</body>
</html>