Esempio n. 1
0
static char*
_dumpFramesAsText(LayoutTestController* controller, WebCore::Frame* in_core_frame, bool is_main_frame)
{
    WTF::String result("");

    // Add header for all but the main frame.

    WebCore::FrameView* view = in_core_frame->view();

    if (view && view->layoutPending())
        view->layout();

    WebCore::Element* document_element = in_core_frame->document()->documentElement();
    WTF::String inner_text = document_element->innerText();

    if (!is_main_frame) {
        WTF::String frame_name(in_core_frame->tree().name());
        result.append("\n--------\nFrame: '");
        result.append(frame_name);
        result.append("'\n--------\n");
    }
    result.append(inner_text);
    result.append("\n");

    if (controller->dumpChildFramesAsText()) {
        for (WebCore::Frame* child = in_core_frame->tree().firstChild(); child; child = child->tree().nextSibling()) {
            char* tmp = _dumpFramesAsText(controller, child, false);
            result.append(tmp);
            free(tmp);
        }
    }

    return strdup(result.utf8().data());
}
Esempio n. 2
0
static char* getFrameNameSuitableForTestResult(WKC::WKCWebView* in_view, WKC::WKCWebFrame* in_frame)
{
    WTF::String frame_name(in_frame->name());
    WTF::String tmp("main frame ");
    const char* u8 = "";

    if (in_frame == in_view->mainFrame()) {
        if (frame_name.length()) {
            tmp.append('"');
            tmp.append(frame_name);
            tmp.append('"');
            tmp.append('\0');
            u8 = tmp.utf8().data();
        } else {
            u8 = "main frame";
        }
    } else if (!frame_name.length()) {
        u8 = "frame (anonymous)";
    }

    return strdup(u8);
}
std::string PointsFileSystem::getPointsFolder(int frame)
{
    QModelIndex root_index = index(rootPath());

    int start, end;
    getFrameRange(start, end);
    if (start < 0 || end < 0)
        return std::string();

    std::string folder;

    QString root_path = rootPath();
    if (root_path.contains("frame_"))
    {
        folder =  root_path.toStdString();
    }
    else if (root_path.contains("points"))
    {
        // not work ??
        /*std::cout << root_path.toStdString() << std::endl;
        QModelIndex frame_index = index(frame-start, 0, root_index);
        folder = filePath(frame_index).toStdString();*/

        QString frame_name(QString("frame_%1").arg(frame, 5, 10, QChar('0')));
        QStringList root_entries = QDir(root_path).entryList();
        for (QStringList::const_iterator root_entries_it = root_entries.begin();
            root_entries_it != root_entries.end(); ++ root_entries_it)
        {
            if (root_entries_it->compare(frame_name) == 0)
            {
                folder = (root_path + QString("/%1").arg(*root_entries_it)).toStdString();
                break;
            }
        }
    }

    return folder;
}
Esempio n. 4
0
std::string camera<Tdata>::frame_fullname()
{
    return frame_name();
}