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 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; }
static void didFinishLoad(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo) { // First load before WebProcess was terminated. if (!loadBeforeCrash) { loadBeforeCrash = true; return; } // Next load after WebProcess was terminated (hopefully // it will be correctly re-spawned). EXPECT_EQ(static_cast<uint32_t>(kWKFrameLoadStateFinished), WKFrameGetFrameLoadState(frame)); EXPECT_FALSE(loadAfterCrash); // Set it, otherwise the loop will not end. loadAfterCrash = true; }