Changeset 214532 in webkit
- Timestamp:
- Mar 29, 2017 2:39:41 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r214527 r214532 1 2017-03-29 Antoine Quint <graouts@apple.com> 2 3 [mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout 4 https://bugs.webkit.org/show_bug.cgi?id=168409 5 <rdar://problem/30799198> 6 7 Reviewed by Dean Jackson. 8 9 Opt into ScriptedAnimationController logging. 10 11 * media/modern-media-controls/airplay-button/airplay-button-expected.txt: 12 * media/modern-media-controls/airplay-button/airplay-button.html: 13 1 14 2017-03-28 Youenn Fablet <youenn@apple.com> 2 15 -
trunk/LayoutTests/media/modern-media-controls/airplay-button/airplay-button-expected.txt
r214400 r214532 4 4 5 5 6 PASS airplayButton.element.localName is "button" 7 PASS airplayButton.element.classList.contains("icon") is true 8 PASS airplayButton.element.classList.contains("airplay") is true 9 PASS airplayButton.iconName is Icons.Airplay 10 PASS airplayButton.width is 0 11 PASS airplayButton.height is 0 12 PASS airplayButton._image is iconService.imageForIconNameAndLayoutTraits(Icons.Airplay.name, LayoutTraits.macOS) 13 PASS airplayButton._image.src is not "" 14 PASS airplayButton._image.complete is false 6 15 scheduleLayout() - start 7 16 _requestFrameIfNeeded() 17 [ScriptedAnimationController] raf-register-callback 18 [ScriptedAnimationController] raf-schedule-animation 8 19 _requestFrameIfNeeded() - registered rAF, _frameID = 1 9 20 scheduleLayout() - _layoutCallbacks.size = 1 … … 19 30 scheduleLayout() - _layoutCallbacks.size = 1 20 31 scheduleLayout() - end 21 PASS airplayButton.element.localName is "button"22 PASS airplayButton.element.classList.contains("icon") is true23 PASS airplayButton.element.classList.contains("airplay") is true24 PASS airplayButton.iconName is Icons.Airplay25 FAIL airplayButton.width should be 0. Was 25.26 FAIL airplayButton.height should be 0. Was 22.27 PASS airplayButton._image is iconService.imageForIconNameAndLayoutTraits(Icons.Airplay.name, LayoutTraits.macOS)28 PASS airplayButton._image.src is not ""29 FAIL airplayButton._image.complete should be false. Was true.30 32 PASS airplayButton.width is not 0 31 33 PASS airplayButton.height is not 0 … … 35 37 PASS scheduler._frameID is not -1 36 38 PASS dirtyNodes.has(airplayButton) is true 39 PASS airplayButton.element.style.webkitMaskImage.includes("macOS/airplay@") became true 40 [ScriptedAnimationController] raf-service-scripted-animations 41 [ScriptedAnimationController] raf-will-fire 37 42 _frameDidFire() - start 38 43 frameWillFire() … … 49 54 PASS airplayButton.element.getAttribute('aria-label') is "AirPlay" 50 55 _frameDidFire() - end 51 PASS airplayButton.element.style.webkitMaskImage.includes("macOS/airplay@") became true56 [ScriptedAnimationController] raf-did-fire 52 57 PASS successfullyParsed is true 53 58 -
trunk/LayoutTests/media/modern-media-controls/airplay-button/airplay-button.html
r214400 r214532 6 6 <script type="text/javascript"> 7 7 8 let reachedEndOfTest = false; 9 let receivedRAFDidFireEvent = false; 10 8 11 window.jsTestIsAsync = true; 9 12 scheduler.debug = debug; 10 13 11 14 description("Testing the <code>AirplayButton</code> class."); 15 16 if (window.internals) { 17 ["raf-suspend", "raf-resume", "raf-add-throttling-reason", "raf-remove-throttling-reason", "raf-register-callback", "raf-cancel-callback", "raf-did-cancel-callback", "raf-service-scripted-animations", "raf-will-fire", "raf-did-fire", "raf-schedule-animation", "raf-schedule-animation-display-refresh-monitor", "raf-schedule-animation-timer", "raf-schedule-animation-frame-view"].forEach(eventType => document.addEventListener(eventType, handleRAFEvent)); 18 window.internals.settings.setShouldDispatchRequestAnimationFrameEvents(true); 19 } 20 21 function handleRAFEvent(event) 22 { 23 debug(`[ScriptedAnimationController] ${event.type}`); 24 if (event.type === "raf-did-fire") { 25 receivedRAFDidFireEvent = true; 26 considerFinishingTest(); 27 } 28 } 29 30 function considerFinishingTest() 31 { 32 if (reachedEndOfTest && receivedRAFDidFireEvent) 33 finishJSTest(); 34 } 12 35 13 36 const airplayButton = new AirplayButton({ layoutTraits: LayoutTraits.macOS }); … … 45 68 shouldBeEqualToString("airplayButton.element.getAttribute('aria-label')", "AirPlay"); 46 69 } 47 shouldBecomeEqual('airplayButton.element.style.webkitMaskImage.includes("macOS/airplay@")', "true", finishJSTest); 70 shouldBecomeEqual('airplayButton.element.style.webkitMaskImage.includes("macOS/airplay@")', "true", () => { 71 reachedEndOfTest = true; 72 considerFinishingTest(); 73 }); 48 74 // shouldBecomeEqual('airplayButton.element.style.webkitMaskImage.includes("macOS/airplay@")', "true", () => { 49 75 // shouldBecomeEqual('macOSFullscreenAirplayButton.element.style.webkitMaskImage.includes("macOS/airplay-fullscreen@")', "true", () => { -
trunk/Source/WebCore/ChangeLog
r214527 r214532 1 2017-03-29 Antoine Quint <graouts@apple.com> 2 3 [mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout 4 https://bugs.webkit.org/show_bug.cgi?id=168409 5 <rdar://problem/30799198> 6 7 Reviewed by Dean Jackson. 8 9 Add a new internals setting to opt into ScriptedAnimationController logging through DOM events dispatched 10 through the document. This should allow this flaky test to get information as to why the frame isn't 11 firing when it times out. 12 13 * dom/ScriptedAnimationController.cpp: 14 (WebCore::ScriptedAnimationController::suspend): 15 (WebCore::ScriptedAnimationController::resume): 16 (WebCore::ScriptedAnimationController::addThrottlingReason): 17 (WebCore::ScriptedAnimationController::removeThrottlingReason): 18 (WebCore::ScriptedAnimationController::registerCallback): 19 (WebCore::ScriptedAnimationController::cancelCallback): 20 (WebCore::ScriptedAnimationController::serviceScriptedAnimations): 21 (WebCore::ScriptedAnimationController::scheduleAnimation): 22 (WebCore::ScriptedAnimationController::dispatchLoggingEventIfRequired): 23 * dom/ScriptedAnimationController.h: 24 * page/Settings.in: 25 * testing/InternalSettings.cpp: 26 (WebCore::InternalSettings::resetToConsistentState): 27 (WebCore::InternalSettings::shouldDispatchRequestAnimationFrameEvents): 28 (WebCore::InternalSettings::setShouldDispatchRequestAnimationFrameEvents): 29 * testing/InternalSettings.h: 30 * testing/InternalSettings.idl: 31 1 32 2017-03-28 Youenn Fablet <youenn@apple.com> 2 33 -
trunk/Source/WebCore/dom/ScriptedAnimationController.cpp
r213169 r214532 82 82 void ScriptedAnimationController::suspend() 83 83 { 84 dispatchLoggingEventIfRequired("raf-suspend"); 84 85 ++m_suspendCount; 85 86 } … … 87 88 void ScriptedAnimationController::resume() 88 89 { 90 dispatchLoggingEventIfRequired("raf-resume"); 89 91 // It would be nice to put an ASSERT(m_suspendCount > 0) here, but in WK1 resume() can be called 90 92 // even when suspend hasn't (if a tab was created in the background). … … 135 137 136 138 RELEASE_LOG_IF_ALLOWED("addThrottlingReason(%s) -> %s", throttlingReasonToString(reason), throttlingReasonsToString(m_throttlingReasons).utf8().data()); 139 dispatchLoggingEventIfRequired("raf-add-throttling-reason"); 137 140 138 141 if (m_animationTimer.isActive()) { … … 154 157 155 158 RELEASE_LOG_IF_ALLOWED("removeThrottlingReason(%s) -> %s", throttlingReasonToString(reason), throttlingReasonsToString(m_throttlingReasons).utf8().data()); 159 dispatchLoggingEventIfRequired("raf-remove-throttling-reason"); 156 160 157 161 if (m_animationTimer.isActive()) { … … 181 185 182 186 InspectorInstrumentation::didRequestAnimationFrame(m_document, id); 187 dispatchLoggingEventIfRequired("raf-register-callback"); 183 188 184 189 if (!m_suspendCount) … … 189 194 void ScriptedAnimationController::cancelCallback(CallbackId id) 190 195 { 196 dispatchLoggingEventIfRequired("raf-cancel-callback"); 191 197 for (size_t i = 0; i < m_callbacks.size(); ++i) { 192 198 if (m_callbacks[i]->m_id == id) { … … 194 200 InspectorInstrumentation::didCancelAnimationFrame(m_document, id); 195 201 m_callbacks.remove(i); 202 dispatchLoggingEventIfRequired("raf-did-cancel-callback"); 196 203 return; 197 204 } … … 201 208 void ScriptedAnimationController::serviceScriptedAnimations(double timestamp) 202 209 { 210 dispatchLoggingEventIfRequired("raf-service-scripted-animations"); 203 211 if (!m_callbacks.size() || m_suspendCount || !requestAnimationFrameEnabled()) 204 212 return; … … 221 229 callback->m_firedOrCancelled = true; 222 230 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willFireAnimationFrame(m_document, callback->m_id); 231 dispatchLoggingEventIfRequired("raf-will-fire"); 223 232 if (callback->m_useLegacyTimeBase) 224 233 callback->handleEvent(legacyHighResNowMs); … … 226 235 callback->handleEvent(highResNowMs); 227 236 InspectorInstrumentation::didFireAnimationFrame(cookie); 237 dispatchLoggingEventIfRequired("raf-did-fire"); 228 238 } 229 239 } … … 271 281 void ScriptedAnimationController::scheduleAnimation() 272 282 { 283 dispatchLoggingEventIfRequired("raf-schedule-animation"); 273 284 if (!requestAnimationFrameEnabled()) 274 285 return; … … 281 292 282 293 m_isUsingTimer = true; 294 dispatchLoggingEventIfRequired("raf-schedule-animation-display-refresh-monitor"); 283 295 } 284 296 #endif … … 289 301 double scheduleDelay = std::max<double>(animationInterval.value() - (m_document->domWindow()->nowTimestamp() - m_lastAnimationFrameTimestamp), 0); 290 302 m_animationTimer.startOneShot(scheduleDelay); 303 dispatchLoggingEventIfRequired("raf-schedule-animation-timer"); 291 304 #else 292 305 if (FrameView* frameView = m_document->view()) 293 306 frameView->scheduleAnimation(); 307 dispatchLoggingEventIfRequired("raf-schedule-animation-frame-view"); 294 308 #endif 295 309 } … … 323 337 #endif 324 338 325 } 339 void ScriptedAnimationController::dispatchLoggingEventIfRequired(const AtomicString& type) 340 { 341 if (m_document && m_document->frame() && m_document->frame()->settings().shouldDispatchRequestAnimationFrameEvents()) 342 m_document->dispatchEvent(Event::create(type, false, false)); 343 } 344 345 } -
trunk/Source/WebCore/dom/ScriptedAnimationController.h
r213169 r214532 32 32 #include <wtf/RefPtr.h> 33 33 #include <wtf/Vector.h> 34 #include <wtf/text/AtomicString.h> 34 35 35 36 #if USE(REQUEST_ANIMATION_FRAME_TIMER) … … 97 98 98 99 void scheduleAnimation(); 100 void dispatchLoggingEventIfRequired(const AtomicString&); 99 101 100 102 #if USE(REQUEST_ANIMATION_FRAME_TIMER) -
trunk/Source/WebCore/page/Settings.in
r213566 r214532 275 275 inputEventsEnabled initial=true 276 276 277 shouldDispatchRequestAnimationFrameEvents initial=false 278 277 279 quickTimePluginReplacementEnabled initial=defaultQuickTimePluginReplacementEnabled 278 280 youTubeFlashPluginReplacementEnabled initial=defaultYouTubeFlashPluginReplacementEnabled -
trunk/Source/WebCore/testing/InternalSettings.cpp
r213519 r214532 254 254 m_page->setCanStartMedia(true); 255 255 256 settings().setShouldDispatchRequestAnimationFrameEvents(false); 257 256 258 settings().setForcePendingWebGLPolicy(false); 257 259 #if ENABLE(WIRELESS_PLAYBACK_TARGET) … … 710 712 } 711 713 714 bool InternalSettings::shouldDispatchRequestAnimationFrameEvents() 715 { 716 return settings().shouldDispatchRequestAnimationFrameEvents(); 717 } 718 719 void InternalSettings::setShouldDispatchRequestAnimationFrameEvents(bool shouldDispatchRequestAnimationFrameEvents) 720 { 721 settings().setShouldDispatchRequestAnimationFrameEvents(shouldDispatchRequestAnimationFrameEvents); 722 } 723 712 724 ExceptionOr<String> InternalSettings::userInterfaceDirectionPolicy() 713 725 { -
trunk/Source/WebCore/testing/InternalSettings.h
r213519 r214532 110 110 void setForcedPrefersReducedMotionAccessibilityValue(ForcedAccessibilityValue); 111 111 112 bool shouldDispatchRequestAnimationFrameEvents(); 113 void setShouldDispatchRequestAnimationFrameEvents(bool); 114 112 115 // RuntimeEnabledFeatures. 113 116 static void setIndexedDBWorkersEnabled(bool); -
trunk/Source/WebCore/testing/InternalSettings.idl
r213410 r214532 97 97 [MayThrowException] void setDeferredCSSParserEnabled(boolean enabled); 98 98 99 boolean shouldDispatchRequestAnimationFrameEvents(); 100 void setShouldDispatchRequestAnimationFrameEvents(boolean shouldDispatchRequestAnimationFrameEvents); 101 99 102 attribute ForcedAccessibilityValue forcedColorsAreInvertedAccessibilityValue; 100 103 attribute ForcedAccessibilityValue forcedDisplayIsMonochromeAccessibilityValue;
Note: See TracChangeset
for help on using the changeset viewer.