Exemplo n.º 1
0
bool TestController::runTest(const char* test)
{
    if (!resetStateToConsistentValues()) {
        fputs("#CRASHED - WebProcess\n", stderr);
        fflush(stderr);
        return false;
    }

    std::string pathOrURL(test);
    std::string expectedPixelHash;
    size_t separatorPos = pathOrURL.find("'");
    if (separatorPos != std::string::npos) {
        pathOrURL = std::string(std::string(test), 0, separatorPos);
        expectedPixelHash = std::string(std::string(test), separatorPos + 1);
    }

    m_state = RunningTest;

    m_currentInvocation = adoptPtr(new TestInvocation(pathOrURL));
    m_currentInvocation->setSkipPixelTestOption(m_skipPixelTestOption);
    if (m_dumpPixels)
        m_currentInvocation->setIsPixelTest(expectedPixelHash);    

    m_currentInvocation->invoke();
    m_currentInvocation.clear();

    return true;
}
Exemplo n.º 2
0
void TestController::ensureViewSupportsOptions(WKDictionaryRef options)
{
    if (m_mainWebView && !m_mainWebView->viewSupportsOptions(options)) {
        WKPageSetPageUIClient(m_mainWebView->page(), 0);
        WKPageSetPageLoaderClient(m_mainWebView->page(), 0);
        WKPageSetPagePolicyClient(m_mainWebView->page(), 0);
        WKPageClose(m_mainWebView->page());

        m_mainWebView = nullptr;

        createWebViewWithOptions(options);
        resetStateToConsistentValues();
    }
}
Exemplo n.º 3
0
void TestController::run()
{
    if (!resetStateToConsistentValues()) {
        TestInvocation::dumpWebProcessUnresponsiveness("<unknown> - TestController::run - Failed to reset state to consistent values\n");
        return;
    }

    if (m_usingServerMode)
        runTestingServerLoop();
    else {
        for (size_t i = 0; i < m_paths.size(); ++i) {
            if (!runTest(m_paths[i].c_str()))
                break;
        }
    }
}
Exemplo n.º 4
0
void TestController::run()
{
    if (!resetStateToConsistentValues()) {
        m_currentInvocation->dumpWebProcessUnresponsiveness();
        return;
    }

    if (m_usingServerMode)
        runTestingServerLoop();
    else {
        for (size_t i = 0; i < m_paths.size(); ++i) {
            if (!runTest(m_paths[i].c_str()))
                break;
        }
    }
}