static void didFailProvisionalLoadWithErrorForFrame(WKPageRef page, WKFrameRef frame, WKErrorRef error, WKTypeRef userData, const void* clientInfo) { EXPECT_EQ(static_cast<uint32_t>(kWKFrameLoadStateFinished), WKFrameGetFrameLoadState(frame)); WKURLRef url = WKFrameCopyProvisionalURL(frame); EXPECT_NULL(url); testDone = true; }
static void didCommitLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo) { State* state = reinterpret_cast<State*>(const_cast<void*>(clientInfo)); EXPECT_TRUE(state->didDecidePolicyForNavigationAction); EXPECT_TRUE(state->didStartProvisionalLoadForFrame); // The provisional URL should be null. EXPECT_NULL(WKFrameCopyProvisionalURL(frame)); state->didCommitLoadForFrame = true; }
static void didFailProvisionalLoadWithErrorForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo) { TEST_ASSERT(WKFrameGetFrameLoadState(frame) == kWKFrameLoadStateFinished); WKURLRef url = WKFrameCopyProvisionalURL(frame); WKURLRef emptyURL = WKURLCreateWithUTF8CString(""); TEST_ASSERT(WKURLIsEqual(url, emptyURL)); WKRelease(url); WKRelease(emptyURL); testDone = true; }