Changeset 220317 in webkit
- Timestamp:
- Aug 5, 2017 4:14:34 AM (7 years ago)
- Location:
- trunk/Source
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebDriver/Capabilities.h
r220315 r220317 39 39 }; 40 40 41 enum class PageLoadStrategy { 42 None, 43 Normal, 44 Eager 45 }; 46 41 47 struct Capabilities { 42 48 std::optional<String> browserName; … … 45 51 std::optional<bool> acceptInsecureCerts; 46 52 std::optional<Timeouts> timeouts; 53 std::optional<PageLoadStrategy> pageLoadStrategy; 47 54 #if PLATFORM(GTK) 48 55 std::optional<String> browserBinary; -
trunk/Source/WebDriver/ChangeLog
r220316 r220317 1 2017-08-05 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 WebDriver: Implement page load strategy 4 https://bugs.webkit.org/show_bug.cgi?id=175183 5 6 Reviewed by Brian Burg. 7 8 Validate and parse page load strategy when processing capabilities. 9 10 * Capabilities.h: 11 * Session.cpp: 12 (WebDriver::Session::pageLoadStrategyString const): Helper to get the page load strategy as a String to be 13 passed to Automation. 14 (WebDriver::Session::go): Pass page load strategy if present. 15 (WebDriver::Session::back): Ditto. 16 (WebDriver::Session::forward): Ditto. 17 (WebDriver::Session::refresh): Ditto. 18 (WebDriver::Session::waitForNavigationToComplete): Ditto. 19 * Session.h: 20 * WebDriverService.cpp: 21 (WebDriver::deserializePageLoadStrategy): 22 (WebDriver::WebDriverService::parseCapabilities const): 23 (WebDriver::WebDriverService::validatedCapabilities const): 24 (WebDriver::WebDriverService::newSession): 25 1 26 2017-08-05 Carlos Garcia Campos <cgarcia@igalia.com> 2 27 -
trunk/Source/WebDriver/Session.cpp
r220314 r220317 103 103 } 104 104 105 std::optional<String> Session::pageLoadStrategyString() const 106 { 107 if (!capabilities().pageLoadStrategy) 108 return std::nullopt; 109 110 switch (capabilities().pageLoadStrategy.value()) { 111 case PageLoadStrategy::None: 112 return String("None"); 113 case PageLoadStrategy::Normal: 114 return String("Normal"); 115 case PageLoadStrategy::Eager: 116 return String("Eager"); 117 } 118 119 return std::nullopt; 120 } 121 105 122 void Session::createTopLevelBrowsingContext(Function<void (CommandResult&&)>&& completionHandler) 106 123 { … … 135 152 if (m_timeouts.pageLoad) 136 153 parameters->setInteger(ASCIILiteral("pageLoadTimeout"), m_timeouts.pageLoad.value().millisecondsAs<int>()); 154 if (auto pageLoadStrategy = pageLoadStrategyString()) 155 parameters->setString(ASCIILiteral("pageLoadStrategy"), pageLoadStrategy.value()); 137 156 m_host->sendCommandToBackend(ASCIILiteral("navigateBrowsingContext"), WTFMove(parameters), [this, protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)](SessionHost::CommandResponse&& response) { 138 157 if (response.isError) { … … 184 203 if (m_timeouts.pageLoad) 185 204 parameters->setInteger(ASCIILiteral("pageLoadTimeout"), m_timeouts.pageLoad.value().millisecondsAs<int>()); 205 if (auto pageLoadStrategy = pageLoadStrategyString()) 206 parameters->setString(ASCIILiteral("pageLoadStrategy"), pageLoadStrategy.value()); 186 207 m_host->sendCommandToBackend(ASCIILiteral("goBackInBrowsingContext"), WTFMove(parameters), [this, protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)](SessionHost::CommandResponse&& response) { 187 208 if (response.isError) { … … 205 226 if (m_timeouts.pageLoad) 206 227 parameters->setInteger(ASCIILiteral("pageLoadTimeout"), m_timeouts.pageLoad.value().millisecondsAs<int>()); 228 if (auto pageLoadStrategy = pageLoadStrategyString()) 229 parameters->setString(ASCIILiteral("pageLoadStrategy"), pageLoadStrategy.value()); 207 230 m_host->sendCommandToBackend(ASCIILiteral("goForwardInBrowsingContext"), WTFMove(parameters), [this, protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)](SessionHost::CommandResponse&& response) { 208 231 if (response.isError) { … … 226 249 if (m_timeouts.pageLoad) 227 250 parameters->setInteger(ASCIILiteral("pageLoadTimeout"), m_timeouts.pageLoad.value().millisecondsAs<int>()); 251 if (auto pageLoadStrategy = pageLoadStrategyString()) 252 parameters->setString(ASCIILiteral("pageLoadStrategy"), pageLoadStrategy.value()); 228 253 m_host->sendCommandToBackend(ASCIILiteral("reloadBrowsingContext"), WTFMove(parameters), [this, protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)](SessionHost::CommandResponse&& response) { 229 254 if (response.isError) { … … 982 1007 if (m_timeouts.pageLoad) 983 1008 parameters->setInteger(ASCIILiteral("pageLoadTimeout"), m_timeouts.pageLoad.value().millisecondsAs<int>()); 1009 if (auto pageLoadStrategy = pageLoadStrategyString()) 1010 parameters->setString(ASCIILiteral("pageLoadStrategy"), pageLoadStrategy.value()); 984 1011 m_host->sendCommandToBackend(ASCIILiteral("waitForNavigationToComplete"), WTFMove(parameters), [this, protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)](SessionHost::CommandResponse&& response) { 985 1012 if (response.isError) { -
trunk/Source/WebDriver/Session.h
r220315 r220317 102 102 void switchToBrowsingContext(std::optional<String>); 103 103 104 std::optional<String> pageLoadStrategyString() const; 105 104 106 RefPtr<Inspector::InspectorObject> createElement(RefPtr<Inspector::InspectorValue>&&); 105 107 RefPtr<Inspector::InspectorObject> createElement(const String& elementID); -
trunk/Source/WebDriver/WebDriverService.cpp
r220316 r220317 278 278 } 279 279 280 static std::optional<PageLoadStrategy> deserializePageLoadStrategy(const String& pageLoadStrategy) 281 { 282 if (pageLoadStrategy == "none") 283 return PageLoadStrategy::None; 284 if (pageLoadStrategy == "normal") 285 return PageLoadStrategy::Normal; 286 if (pageLoadStrategy == "eager") 287 return PageLoadStrategy::Eager; 288 return std::nullopt; 289 } 290 280 291 void WebDriverService::parseCapabilities(const InspectorObject& matchedCapabilities, Capabilities& capabilities) const 281 292 { … … 296 307 if (matchedCapabilities.getObject(ASCIILiteral("timeouts"), timeouts)) 297 308 capabilities.timeouts = deserializeTimeouts(*timeouts); 309 String pageLoadStrategy; 310 if (matchedCapabilities.getString(ASCIILiteral("pageLoadStrategy"), pageLoadStrategy)) 311 capabilities.pageLoadStrategy = deserializePageLoadStrategy(pageLoadStrategy); 298 312 platformParseCapabilities(matchedCapabilities, capabilities); 299 313 } … … 337 351 } else if (it->key == "pageLoadStrategy") { 338 352 String pageLoadStrategy; 339 if (!it->value->asString(pageLoadStrategy) )353 if (!it->value->asString(pageLoadStrategy) || !deserializePageLoadStrategy(pageLoadStrategy)) 340 354 return nullptr; 341 // FIXME: implement pageLoadStrategy.342 355 result->setString(it->key, pageLoadStrategy); 343 356 } else if (it->key == "proxy") { … … 561 574 capabilitiesObject->setObject(ASCIILiteral("timeouts"), WTFMove(timeoutsObject)); 562 575 } 576 if (capabilities.pageLoadStrategy) { 577 switch (capabilities.pageLoadStrategy.value()) { 578 case PageLoadStrategy::None: 579 capabilitiesObject->setString(ASCIILiteral("pageLoadStrategy"), "none"); 580 break; 581 case PageLoadStrategy::Normal: 582 capabilitiesObject->setString(ASCIILiteral("pageLoadStrategy"), "normal"); 583 break; 584 case PageLoadStrategy::Eager: 585 capabilitiesObject->setString(ASCIILiteral("pageLoadStrategy"), "eager"); 586 break; 587 } 588 } 563 589 resultObject->setObject(ASCIILiteral("value"), WTFMove(capabilitiesObject)); 564 590 completionHandler(CommandResult::success(WTFMove(resultObject))); -
trunk/Source/WebKit/ChangeLog
r220314 r220317 1 2017-08-05 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 WebDriver: Implement page load strategy 4 https://bugs.webkit.org/show_bug.cgi?id=175183 5 6 Reviewed by Brian Burg. 7 8 Split pending navigation maps into normal and eager, and use one or the other depending on the received page 9 load strategy. We need to keep different maps for every page load strategy because every command could use a 10 different strategy. 11 12 * UIProcess/Automation/WebAutomationSession.cpp: 13 (WebKit::WebAutomationSession::waitForNavigationToComplete): Extract page load strategy from parameter and pass 14 it to waitForNavigationToCompleteOnPage() and waitForNavigationToCompleteOnFrame(). 15 (WebKit::WebAutomationSession::waitForNavigationToCompleteOnPage): Return early if page load strategy is 16 none. Otherwise at the pening callback to the normal or eager map depeding on the page load straegy. 17 (WebKit::WebAutomationSession::waitForNavigationToCompleteOnFrame): Ditto. 18 (WebKit::respondToPendingNavigationCallbacksWithTimeout): Helper to send pening navigation callback in case of 19 timeout failure. 20 (WebKit::WebAutomationSession::loadTimerFired): Call finishPendingNavigationsWithTimeoutFailure() with all the maps. 21 (WebKit::WebAutomationSession::navigateBrowsingContext): Extract page load strategy from parameter and pass it 22 to waitForNavigationToCompleteOnPage(). 23 (WebKit::WebAutomationSession::goBackInBrowsingContext): Ditto. 24 (WebKit::WebAutomationSession::goForwardInBrowsingContext): Ditto. 25 (WebKit::WebAutomationSession::reloadBrowsingContext): Ditto. 26 (WebKit::WebAutomationSession::navigationOccurredForFrame): Use the normal maps. 27 (WebKit::WebAutomationSession::documentLoadedForFrame): Stop timeout timer and dispatch eager pending navigations. 28 * UIProcess/Automation/WebAutomationSession.h: 29 * UIProcess/WebPageProxy.cpp: 30 (WebKit::WebPageProxy::didFinishDocumentLoadForFrame): Notify the automation session. 31 1 32 2017-08-05 Carlos Garcia Campos <cgarcia@igalia.com> 2 33 -
trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp
r220314 r220317 55 55 // https://www.w3.org/TR/webdriver/#dfn-session-page-load-timeout 56 56 static const Seconds defaultPageLoadTimeout = 300_s; 57 // https://www.w3.org/TR/webdriver/#dfn-page-loading-strategy 58 static const Inspector::Protocol::Automation::PageLoadStrategy defaultPageLoadStrategy = Inspector::Protocol::Automation::PageLoadStrategy::Normal; 57 59 58 60 WebAutomationSession::WebAutomationSession() … … 386 388 } 387 389 390 static std::optional<Inspector::Protocol::Automation::PageLoadStrategy> pageLoadStrategyFromStringParameter(const String* optionalPageLoadStrategyString) 391 { 392 if (!optionalPageLoadStrategyString) 393 return defaultPageLoadStrategy; 394 395 auto parsedPageLoadStrategy = Inspector::Protocol::AutomationHelpers::parseEnumValueFromString<Inspector::Protocol::Automation::PageLoadStrategy>(*optionalPageLoadStrategyString); 396 if (!parsedPageLoadStrategy) 397 return std::nullopt; 398 return parsedPageLoadStrategy; 399 } 400 388 401 void WebAutomationSession::waitForNavigationToComplete(Inspector::ErrorString& errorString, const String& browsingContextHandle, const String* optionalFrameHandle, const String* optionalPageLoadStrategyString, const int* optionalPageLoadTimeout, Ref<WaitForNavigationToCompleteCallback>&& callback) 389 402 { … … 392 405 FAIL_WITH_PREDEFINED_ERROR(WindowNotFound); 393 406 394 // FIXME: Implement page load strategy. 395 396 Seconds pageLoadTimeout = optionalPageLoadTimeout ? Seconds::fromMilliseconds(*optionalPageLoadTimeout) : defaultPageLoadTimeout; 407 auto pageLoadStrategy = pageLoadStrategyFromStringParameter(optionalPageLoadStrategyString); 408 if (!pageLoadStrategy) 409 FAIL_WITH_PREDEFINED_ERROR_AND_DETAILS(InvalidParameter, "The parameter 'pageLoadStrategy' is invalid."); 410 auto pageLoadTimeout = optionalPageLoadTimeout ? Seconds::fromMilliseconds(*optionalPageLoadTimeout) : defaultPageLoadTimeout; 397 411 398 412 if (optionalFrameHandle && !optionalFrameHandle->isEmpty()) { … … 403 417 if (!frame) 404 418 FAIL_WITH_PREDEFINED_ERROR(FrameNotFound); 405 waitForNavigationToCompleteOnFrame(*frame, pageLoad Timeout, WTFMove(callback));419 waitForNavigationToCompleteOnFrame(*frame, pageLoadStrategy.value(), pageLoadTimeout, WTFMove(callback)); 406 420 } else 407 waitForNavigationToCompleteOnPage(*page, pageLoad Timeout, WTFMove(callback));408 } 409 410 void WebAutomationSession::waitForNavigationToCompleteOnPage(WebPageProxy& page, Seconds timeout, Ref<Inspector::BackendDispatcher::CallbackBase>&& callback)421 waitForNavigationToCompleteOnPage(*page, pageLoadStrategy.value(), pageLoadTimeout, WTFMove(callback)); 422 } 423 424 void WebAutomationSession::waitForNavigationToCompleteOnPage(WebPageProxy& page, Inspector::Protocol::Automation::PageLoadStrategy loadStrategy, Seconds timeout, Ref<Inspector::BackendDispatcher::CallbackBase>&& callback) 411 425 { 412 426 ASSERT(!m_loadTimer.isActive()); 413 if ( !page.pageLoadState().isLoading()) {427 if (loadStrategy == Inspector::Protocol::Automation::PageLoadStrategy::None || !page.pageLoadState().isLoading()) { 414 428 callback->sendSuccess(InspectorObject::create()); 415 429 return; … … 417 431 418 432 m_loadTimer.startOneShot(timeout); 419 m_pendingNavigationInBrowsingContextCallbacksPerPage.set(page.pageID(), WTFMove(callback)); 420 } 421 422 void WebAutomationSession::waitForNavigationToCompleteOnFrame(WebFrameProxy& frame, Seconds timeout, Ref<Inspector::BackendDispatcher::CallbackBase>&& callback) 433 switch (loadStrategy) { 434 case Inspector::Protocol::Automation::PageLoadStrategy::Normal: 435 m_pendingNormalNavigationInBrowsingContextCallbacksPerPage.set(page.pageID(), WTFMove(callback)); 436 break; 437 case Inspector::Protocol::Automation::PageLoadStrategy::Eager: 438 m_pendingEagerNavigationInBrowsingContextCallbacksPerPage.set(page.pageID(), WTFMove(callback)); 439 break; 440 case Inspector::Protocol::Automation::PageLoadStrategy::None: 441 ASSERT_NOT_REACHED(); 442 } 443 } 444 445 void WebAutomationSession::waitForNavigationToCompleteOnFrame(WebFrameProxy& frame, Inspector::Protocol::Automation::PageLoadStrategy loadStrategy, Seconds timeout, Ref<Inspector::BackendDispatcher::CallbackBase>&& callback) 423 446 { 424 447 ASSERT(!m_loadTimer.isActive()); 425 if ( frame.frameLoadState().state() == FrameLoadState::State::Finished) {448 if (loadStrategy == Inspector::Protocol::Automation::PageLoadStrategy::None || frame.frameLoadState().state() == FrameLoadState::State::Finished) { 426 449 callback->sendSuccess(InspectorObject::create()); 427 450 return; … … 429 452 430 453 m_loadTimer.startOneShot(timeout); 431 m_pendingNavigationInBrowsingContextCallbacksPerFrame.set(frame.frameID(), WTFMove(callback)); 454 switch (loadStrategy) { 455 case Inspector::Protocol::Automation::PageLoadStrategy::Normal: 456 m_pendingNormalNavigationInBrowsingContextCallbacksPerFrame.set(frame.frameID(), WTFMove(callback)); 457 break; 458 case Inspector::Protocol::Automation::PageLoadStrategy::Eager: 459 m_pendingEagerNavigationInBrowsingContextCallbacksPerFrame.set(frame.frameID(), WTFMove(callback)); 460 break; 461 case Inspector::Protocol::Automation::PageLoadStrategy::None: 462 ASSERT_NOT_REACHED(); 463 } 464 } 465 466 static void respondToPendingNavigationCallbacksWithTimeout(HashMap<uint64_t, RefPtr<Inspector::BackendDispatcher::CallbackBase>>& map) 467 { 468 for (auto id : map.keys()) { 469 auto callback = map.take(id); 470 callback->sendFailure(STRING_FOR_PREDEFINED_ERROR_NAME(Timeout)); 471 } 432 472 } 433 473 434 474 void WebAutomationSession::loadTimerFired() 435 475 { 436 for (auto frameID : m_pendingNavigationInBrowsingContextCallbacksPerFrame.keys()) { 437 auto callback = m_pendingNavigationInBrowsingContextCallbacksPerFrame.take(frameID); 438 callback->sendFailure(STRING_FOR_PREDEFINED_ERROR_NAME(Timeout)); 439 } 440 for (auto pageID : m_pendingNavigationInBrowsingContextCallbacksPerPage.keys()) { 441 auto callback = m_pendingNavigationInBrowsingContextCallbacksPerPage.take(pageID); 442 callback->sendFailure(STRING_FOR_PREDEFINED_ERROR_NAME(Timeout)); 443 } 476 respondToPendingNavigationCallbacksWithTimeout(m_pendingNormalNavigationInBrowsingContextCallbacksPerFrame); 477 respondToPendingNavigationCallbacksWithTimeout(m_pendingEagerNavigationInBrowsingContextCallbacksPerFrame); 478 respondToPendingNavigationCallbacksWithTimeout(m_pendingNormalNavigationInBrowsingContextCallbacksPerPage); 479 respondToPendingNavigationCallbacksWithTimeout(m_pendingEagerNavigationInBrowsingContextCallbacksPerPage); 444 480 } 445 481 … … 450 486 FAIL_WITH_PREDEFINED_ERROR(WindowNotFound); 451 487 452 // FIXME: Implement page load strategy. 488 auto pageLoadStrategy = pageLoadStrategyFromStringParameter(optionalPageLoadStrategyString); 489 if (!pageLoadStrategy) 490 FAIL_WITH_PREDEFINED_ERROR_AND_DETAILS(InvalidParameter, "The parameter 'pageLoadStrategy' is invalid."); 491 auto pageLoadTimeout = optionalPageLoadTimeout ? Seconds::fromMilliseconds(*optionalPageLoadTimeout) : defaultPageLoadTimeout; 453 492 454 493 page->loadRequest(WebCore::URL(WebCore::URL(), url)); 455 waitForNavigationToCompleteOnPage(*page, optionalPageLoadTimeout ? Seconds::fromMilliseconds(*optionalPageLoadTimeout) : defaultPageLoadTimeout, WTFMove(callback));494 waitForNavigationToCompleteOnPage(*page, pageLoadStrategy.value(), pageLoadTimeout, WTFMove(callback)); 456 495 } 457 496 … … 462 501 FAIL_WITH_PREDEFINED_ERROR(WindowNotFound); 463 502 464 // FIXME: Implement page load strategy. 503 auto pageLoadStrategy = pageLoadStrategyFromStringParameter(optionalPageLoadStrategyString); 504 if (!pageLoadStrategy) 505 FAIL_WITH_PREDEFINED_ERROR_AND_DETAILS(InvalidParameter, "The parameter 'pageLoadStrategy' is invalid."); 506 auto pageLoadTimeout = optionalPageLoadTimeout ? Seconds::fromMilliseconds(*optionalPageLoadTimeout) : defaultPageLoadTimeout; 465 507 466 508 page->goBack(); 467 waitForNavigationToCompleteOnPage(*page, optionalPageLoadTimeout ? Seconds::fromMilliseconds(*optionalPageLoadTimeout) : defaultPageLoadTimeout, WTFMove(callback));509 waitForNavigationToCompleteOnPage(*page, pageLoadStrategy.value(), pageLoadTimeout, WTFMove(callback)); 468 510 } 469 511 … … 474 516 FAIL_WITH_PREDEFINED_ERROR(WindowNotFound); 475 517 476 // FIXME: Implement page load strategy. 518 auto pageLoadStrategy = pageLoadStrategyFromStringParameter(optionalPageLoadStrategyString); 519 if (!pageLoadStrategy) 520 FAIL_WITH_PREDEFINED_ERROR_AND_DETAILS(InvalidParameter, "The parameter 'pageLoadStrategy' is invalid."); 521 auto pageLoadTimeout = optionalPageLoadTimeout ? Seconds::fromMilliseconds(*optionalPageLoadTimeout) : defaultPageLoadTimeout; 477 522 478 523 page->goForward(); 479 waitForNavigationToCompleteOnPage(*page, optionalPageLoadTimeout ? Seconds::fromMilliseconds(*optionalPageLoadTimeout) : defaultPageLoadTimeout, WTFMove(callback));524 waitForNavigationToCompleteOnPage(*page, pageLoadStrategy.value(), pageLoadTimeout, WTFMove(callback)); 480 525 } 481 526 … … 486 531 FAIL_WITH_PREDEFINED_ERROR(WindowNotFound); 487 532 488 // FIXME: Implement page load strategy. 533 auto pageLoadStrategy = pageLoadStrategyFromStringParameter(optionalPageLoadStrategyString); 534 if (!pageLoadStrategy) 535 FAIL_WITH_PREDEFINED_ERROR_AND_DETAILS(InvalidParameter, "The parameter 'pageLoadStrategy' is invalid."); 536 auto pageLoadTimeout = optionalPageLoadTimeout ? Seconds::fromMilliseconds(*optionalPageLoadTimeout) : defaultPageLoadTimeout; 489 537 490 538 page->reload({ }); 491 waitForNavigationToCompleteOnPage(*page, optionalPageLoadTimeout ? Seconds::fromMilliseconds(*optionalPageLoadTimeout) : defaultPageLoadTimeout, WTFMove(callback));539 waitForNavigationToCompleteOnPage(*page, pageLoadStrategy.value(), pageLoadTimeout, WTFMove(callback)); 492 540 } 493 541 … … 498 546 m_handleWebFrameMap.clear(); 499 547 m_webFrameHandleMap.clear(); 500 if (auto callback = m_pendingN avigationInBrowsingContextCallbacksPerPage.take(frame.page()->pageID())) {548 if (auto callback = m_pendingNormalNavigationInBrowsingContextCallbacksPerPage.take(frame.page()->pageID())) { 501 549 m_loadTimer.stop(); 502 550 callback->sendSuccess(InspectorObject::create()); … … 504 552 m_domainNotifier->browsingContextCleared(handleForWebPageProxy(*frame.page())); 505 553 } else { 506 if (auto callback = m_pendingNavigationInBrowsingContextCallbacksPerFrame.take(frame.frameID())) { 554 if (auto callback = m_pendingNormalNavigationInBrowsingContextCallbacksPerFrame.take(frame.frameID())) { 555 m_loadTimer.stop(); 556 callback->sendSuccess(InspectorObject::create()); 557 } 558 } 559 } 560 561 void WebAutomationSession::documentLoadedForFrame(const WebFrameProxy& frame) 562 { 563 if (frame.isMainFrame()) { 564 if (auto callback = m_pendingEagerNavigationInBrowsingContextCallbacksPerPage.take(frame.page()->pageID())) { 565 m_loadTimer.stop(); 566 callback->sendSuccess(InspectorObject::create()); 567 } 568 } else { 569 if (auto callback = m_pendingEagerNavigationInBrowsingContextCallbacksPerFrame.take(frame.frameID())) { 507 570 m_loadTimer.stop(); 508 571 callback->sendSuccess(InspectorObject::create()); -
trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.h
r220314 r220317 95 95 96 96 void navigationOccurredForFrame(const WebFrameProxy&); 97 void documentLoadedForFrame(const WebFrameProxy&); 97 98 void inspectorFrontendLoaded(const WebPageProxy&); 98 99 void keyboardEventsFlushedForPage(const WebPageProxy&); … … 164 165 String handleForWebFrameProxy(const WebFrameProxy&); 165 166 166 void waitForNavigationToCompleteOnPage(WebPageProxy&, Seconds, Ref<Inspector::BackendDispatcher::CallbackBase>&&);167 void waitForNavigationToCompleteOnFrame(WebFrameProxy&, Seconds, Ref<Inspector::BackendDispatcher::CallbackBase>&&);167 void waitForNavigationToCompleteOnPage(WebPageProxy&, Inspector::Protocol::Automation::PageLoadStrategy, Seconds, Ref<Inspector::BackendDispatcher::CallbackBase>&&); 168 void waitForNavigationToCompleteOnFrame(WebFrameProxy&, Inspector::Protocol::Automation::PageLoadStrategy, Seconds, Ref<Inspector::BackendDispatcher::CallbackBase>&&); 168 169 void loadTimerFired(); 169 170 … … 213 214 HashMap<String, uint64_t> m_handleWebFrameMap; 214 215 215 HashMap<uint64_t, RefPtr<Inspector::BackendDispatcher::CallbackBase>> m_pendingNavigationInBrowsingContextCallbacksPerPage; 216 HashMap<uint64_t, RefPtr<Inspector::BackendDispatcher::CallbackBase>> m_pendingNavigationInBrowsingContextCallbacksPerFrame; 216 HashMap<uint64_t, RefPtr<Inspector::BackendDispatcher::CallbackBase>> m_pendingNormalNavigationInBrowsingContextCallbacksPerPage; 217 HashMap<uint64_t, RefPtr<Inspector::BackendDispatcher::CallbackBase>> m_pendingEagerNavigationInBrowsingContextCallbacksPerPage; 218 HashMap<uint64_t, RefPtr<Inspector::BackendDispatcher::CallbackBase>> m_pendingNormalNavigationInBrowsingContextCallbacksPerFrame; 219 HashMap<uint64_t, RefPtr<Inspector::BackendDispatcher::CallbackBase>> m_pendingEagerNavigationInBrowsingContextCallbacksPerFrame; 217 220 HashMap<uint64_t, RefPtr<Inspector::BackendDispatcher::CallbackBase>> m_pendingInspectorCallbacksPerPage; 218 221 HashMap<uint64_t, RefPtr<Inspector::BackendDispatcher::CallbackBase>> m_pendingKeyboardEventsFlushedCallbacksPerPage; -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r220286 r220317 3370 3370 MESSAGE_CHECK(frame); 3371 3371 3372 if (m_controlledByAutomation) { 3373 if (auto* automationSession = process().processPool().automationSession()) 3374 automationSession->documentLoadedForFrame(*frame); 3375 } 3376 3372 3377 // FIXME: We should message check that navigationID is not zero here, but it's currently zero for some navigations through the page cache. 3373 3378 RefPtr<API::Navigation> navigation;
Note: See TracChangeset
for help on using the changeset viewer.