void QtBuiltinBundlePage::didClearWindowForFrame(WKBundleFrameRef frame, WKBundleScriptWorldRef world) { if (!WKBundleFrameIsMainFrame(frame) || WKBundleScriptWorldNormalWorld() != world) return; JSGlobalContextRef context = WKBundleFrameGetJavaScriptContextForWorld(frame, world); registerNavigatorQtObject(context); }
static void didFinishLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef* userData, const void *clientInfo) { if (!WKBundleFrameIsMainFrame(frame)) { childFrame = frame; return; } bool isParentFrameCheckSuccessful = childFrame ? WKBundleFrameGetParentFrame(childFrame.get()) == frame : false; WKBundlePostMessage(testBundle.get(), Util::toWK("DidCheckParentFrame").get(), adoptWK(WKBooleanCreate(isParentFrameCheckSuccessful)).get()); }
void QtBuiltinBundlePage::didClearWindowForFrame(WKBundleFrameRef frame, WKBundleScriptWorldRef world) { if (!WKBundleFrameIsMainFrame(frame) || WKBundleScriptWorldNormalWorld() != world) return; JSGlobalContextRef context = WKBundleFrameGetJavaScriptContextForWorld(frame, world); registerNavigatorQtObject(context); #ifdef HAVE_WEBCHANNEL registerNavigatorQtWebChannelTransportObject(context); #endif }
static WKURLRequestRef willSendRequestForFrame(WKBundlePageRef, WKBundleFrameRef frame, uint64_t resourceIdentifier, WKURLRequestRef request, WKURLResponseRef redirectResponse, const void *clientInfo) { // Allow the loading of the main resource, but don't allow the loading of an iframe, return null from willSendRequest. if (WKBundleFrameIsMainFrame(frame)) { WKRetainPtr<WKURLRequestRef> newRequest = request; return newRequest.leakRef(); } return 0; }
void InjectedBundlePage::didFailLoadWithErrorForFrame(WKBundleFrameRef frame, WKErrorRef) { if (!InjectedBundle::shared().isTestRunning()) return; if (!WKBundleFrameIsMainFrame(frame)) return; m_isLoading = false; if (this != InjectedBundle::shared().page()) return; InjectedBundle::shared().done(); }
static ostream& operator<<(ostream& out, WKBundleFrameRef frame) { WKRetainPtr<WKStringRef> name(AdoptWK, WKBundleFrameCopyName(frame)); if (WKBundleFrameIsMainFrame(frame)) { if (!WKStringIsEmpty(name.get())) out << "main frame \"" << name << "\""; else out << "main frame"; } else { if (!WKStringIsEmpty(name.get())) out << "frame \"" << name << "\""; else out << "frame (anonymous)"; } return out; }
void InjectedBundlePage::didFinishLoadForFrame(WKBundleFrameRef frame) { if (!InjectedBundle::shared().isTestRunning()) return; if (!WKBundleFrameIsMainFrame(frame)) return; m_isLoading = false; if (this != InjectedBundle::shared().page()) return; if (InjectedBundle::shared().layoutTestController()->waitToDump()) return; dump(); }