void TestRunner::reset() { m_hasDumped = false; m_loadFinished = false; m_textDump = false; m_canOpenWindows = false; m_waitForDone = false; m_disallowIncreaseForApplicationCacheQuota = false; m_timeoutTimer.stop(); m_topLoadingFrame = 0; m_waitForPolicy = false; m_handleErrorPages = false; m_webHistory = 0; m_globalFlag = false; m_userStyleSheetEnabled = false; m_desktopNotificationAllowedOrigins.clear(); m_ignoreDesktopNotification = false; m_isGeolocationPermissionSet = false; m_isPrinting = false; m_geolocationPermission = false; DumpRenderTreeSupportQt::setDeferMainResourceDataLoad(true); DumpRenderTreeSupportQt::setWillSendRequestReturnsNullOnRedirect(false); DumpRenderTreeSupportQt::setWillSendRequestReturnsNull(false); DumpRenderTreeSupportQt::setWillSendRequestClearHeaders(QStringList()); DumpRenderTreeSupportQt::clearScriptWorlds(); DumpRenderTreeSupportQt::resetGeolocationMock(m_drt->webPage()); setIconDatabaseEnabled(false); clearAllDatabases(); // The default state for DRT is to block third-party cookies, mimicing the Mac port setAlwaysAcceptCookies(false); emit hidePage(); }
void LayoutTestController::reset() { m_hasDumped = false; m_loadFinished = false; m_textDump = false; m_dumpBackForwardList = false; m_dumpChildrenAsText = false; m_canOpenWindows = false; m_waitForDone = false; m_dumpTitleChanges = false; m_dumpDatabaseCallbacks = false; m_dumpStatusCallbacks = false; m_timeoutTimer.stop(); m_topLoadingFrame = 0; m_waitForPolicy = false; m_handleErrorPages = false; m_webHistory = 0; m_globalFlag = false; qt_dump_editing_callbacks(false); qt_dump_frame_loader(false); qt_dump_resource_load_callbacks(false); qt_set_will_send_request_returns_null_on_redirect(false); qt_set_will_send_request_returns_null(false); qt_set_will_send_request_clear_headers(QStringList()); emit hidePage(); }
static void switchMonitorOffAndShowSwitchOnPage() { auto page_mgr = Factory< PageManager >::get( Slicer::getGroup() ); page_mgr->hidePage(); page_mgr->showPage( "Monitor On Switch" ); Factory< Timer >::get( "Timer" )->suspend(); ecore_x_dpms_timeout_standby_set( 1 ); ecore_x_dpms_enabled_set( 1 ); ecore_x_randr_screen_backlight_level_set( ecore_x_window_root_get( ecore_x_window_focus_get() ) , 0.0 ); }
void TestRunner::reset() { m_hasDumped = false; m_loadFinished = false; m_textDump = false; m_audioDump = false; m_shouldDumpPixels = true; m_dumpBackForwardList = false; m_dumpChildrenAsText = false; m_dumpChildFrameScrollPositions = false; m_canOpenWindows = false; m_waitForDone = false; m_disallowIncreaseForApplicationCacheQuota = false; m_dumpTitleChanges = false; m_dumpDatabaseCallbacks = false; m_dumpApplicationCacheDelegateCallbacks = false; m_dumpStatusCallbacks = false; m_timeoutTimer.stop(); m_topLoadingFrame = 0; m_waitForPolicy = false; m_handleErrorPages = false; m_webHistory = 0; m_globalFlag = false; m_userStyleSheetEnabled = false; m_ignoreDesktopNotification = false; m_isGeolocationPermissionSet = false; m_isPrinting = false; m_geolocationPermission = false; m_audioData.clear(); DumpRenderTreeSupportQt::dumpEditingCallbacks(false); DumpRenderTreeSupportQt::dumpFrameLoader(false); DumpRenderTreeSupportQt::dumpProgressFinishedCallback(false); DumpRenderTreeSupportQt::dumpUserGestureInFrameLoader(false); DumpRenderTreeSupportQt::dumpResourceLoadCallbacks(false); DumpRenderTreeSupportQt::dumpResourceResponseMIMETypes(false); DumpRenderTreeSupportQt::dumpWillCacheResponseCallbacks(false); DumpRenderTreeSupportQt::setDeferMainResourceDataLoad(true); DumpRenderTreeSupportQt::setWillSendRequestReturnsNullOnRedirect(false); DumpRenderTreeSupportQt::setWillSendRequestReturnsNull(false); DumpRenderTreeSupportQt::setWillSendRequestClearHeaders(QStringList()); DumpRenderTreeSupportQt::clearScriptWorlds(); DumpRenderTreeSupportQt::setCustomPolicyDelegate(false, false); DumpRenderTreeSupportQt::dumpHistoryCallbacks(false); DumpRenderTreeSupportQt::dumpVisitedLinksCallbacks(false); DumpRenderTreeSupportQt::resetGeolocationMock(m_drt->pageAdapter()); DumpRenderTreeSupportQt::dumpNotification(false); setIconDatabaseEnabled(false); clearAllDatabases(); removeAllWebNotificationPermissions(); // The default state for DRT is to block third-party cookies, mimicing the Mac port setAlwaysAcceptCookies(false); emit hidePage(); }
/** * Called when the selection has been changed */ LPARAM CTabControl::selChanged() { LOG("Entered"); if(onSelChanged != NULL) { onSelChanged(this); } hidePage(oldPage); showPage(TabCtrl_GetCurSel(getHandle())); currentPage = pages[TabCtrl_GetCurSel(getHandle())]; return 1; }
void LayoutTestController::reset() { m_hasDumped = false; m_loadFinished = false; m_textDump = false; m_dumpBackForwardList = false; m_dumpChildrenAsText = false; m_dumpChildFrameScrollPositions = false; m_canOpenWindows = false; m_waitForDone = false; m_dumpTitleChanges = false; m_dumpDatabaseCallbacks = false; m_dumpApplicationCacheDelegateCallbacks = false; m_dumpStatusCallbacks = false; m_timeoutTimer.stop(); m_topLoadingFrame = 0; m_waitForPolicy = false; m_handleErrorPages = false; m_webHistory = 0; m_globalFlag = false; m_userStyleSheetEnabled = false; m_desktopNotificationAllowedOrigins.clear(); m_ignoreDesktopNotification = false; m_isGeolocationPermissionSet = false; m_isPrinting = false; m_geolocationPermission = false; DumpRenderTreeSupportQt::dumpEditingCallbacks(false); DumpRenderTreeSupportQt::dumpFrameLoader(false); DumpRenderTreeSupportQt::dumpUserGestureInFrameLoader(false); DumpRenderTreeSupportQt::dumpResourceLoadCallbacks(false); DumpRenderTreeSupportQt::dumpResourceResponseMIMETypes(false); DumpRenderTreeSupportQt::setDeferMainResourceDataLoad(true); DumpRenderTreeSupportQt::setWillSendRequestReturnsNullOnRedirect(false); DumpRenderTreeSupportQt::setWillSendRequestReturnsNull(false); DumpRenderTreeSupportQt::setWillSendRequestClearHeaders(QStringList()); DumpRenderTreeSupportQt::clearScriptWorlds(); DumpRenderTreeSupportQt::setCustomPolicyDelegate(false, false); DumpRenderTreeSupportQt::dumpHistoryCallbacks(false); DumpRenderTreeSupportQt::dumpVisitedLinksCallbacks(false); DumpRenderTreeSupportQt::resetGeolocationMock(m_drt->webPage()); setIconDatabaseEnabled(false); clearAllDatabases(); emit hidePage(); }
void LayoutTestController::reset() { m_hasDumped = false; m_loadFinished = false; m_textDump = false; m_dumpBackForwardList = false; m_dumpChildrenAsText = false; m_canOpenWindows = false; m_waitForDone = false; m_dumpTitleChanges = false; m_dumpDatabaseCallbacks = false; m_dumpStatusCallbacks = false; m_timeoutTimer.stop(); m_topLoadingFrame = 0; m_waitForPolicy = false; m_handleErrorPages = false; m_webHistory = 0; m_globalFlag = false; qt_dump_editing_callbacks(false); qt_dump_resource_load_callbacks(false); emit hidePage(); }
DumpRenderTree::DumpRenderTree() : m_dumpPixels(false) , m_stdin(0) , m_enableTextOutput(false) , m_standAloneMode(false) , m_graphicsBased(false) , m_persistentStoragePath(QString(getenv("DUMPRENDERTREE_TEMP"))) { QByteArray viewMode = getenv("QT_DRT_WEBVIEW_MODE"); if (viewMode == "graphics") setGraphicsBased(true); DumpRenderTreeSupportQt::overwritePluginDirectories(); DumpRenderTreeSupportQt::activeMockDeviceOrientationClient(true); QWebSettings::enablePersistentStorage(m_persistentStoragePath); m_networkAccessManager = new NetworkAccessManager(this); // create our primary testing page/view. if (isGraphicsBased()) { WebViewGraphicsBased* view = new WebViewGraphicsBased(0); m_page = new WebPage(view, this); view->setPage(m_page); m_mainView = view; } else { QWebView* view = new QWebView(0); m_page = new WebPage(view, this); view->setPage(m_page); m_mainView = view; } // Use a frame group name for all pages created by DumpRenderTree to allow // testing of cross-page frame lookup. DumpRenderTreeSupportQt::webPageSetGroupName(m_page, "org.webkit.qt.DumpRenderTree"); m_mainView->setContextMenuPolicy(Qt::NoContextMenu); m_mainView->resize(QSize(LayoutTestController::maxViewWidth, LayoutTestController::maxViewHeight)); // clean up cache by resetting quota. qint64 quota = webPage()->settings()->offlineWebApplicationCacheQuota(); webPage()->settings()->setOfflineWebApplicationCacheQuota(quota); // create our controllers. This has to be done before connectFrame, // as it exports there to the JavaScript DOM window. m_controller = new LayoutTestController(this); connect(m_controller, SIGNAL(showPage()), this, SLOT(showPage())); connect(m_controller, SIGNAL(hidePage()), this, SLOT(hidePage())); // async geolocation permission set by controller connect(m_controller, SIGNAL(geolocationPermissionSet()), this, SLOT(geolocationPermissionSet())); connect(m_controller, SIGNAL(done()), this, SLOT(dump())); m_eventSender = new EventSender(m_page); m_textInputController = new TextInputController(m_page); m_plainTextController = new PlainTextController(m_page); m_gcController = new GCController(m_page); // now connect our different signals connect(m_page, SIGNAL(frameCreated(QWebFrame *)), this, SLOT(connectFrame(QWebFrame *))); connectFrame(m_page->mainFrame()); connect(m_page, SIGNAL(loadFinished(bool)), m_controller, SLOT(maybeDump(bool))); // We need to connect to loadStarted() because notifyDone should only // dump results itself when the last page loaded in the test has finished loading. connect(m_page, SIGNAL(loadStarted()), m_controller, SLOT(resetLoadFinished())); connect(m_page, SIGNAL(windowCloseRequested()), this, SLOT(windowCloseRequested())); connect(m_page, SIGNAL(printRequested(QWebFrame*)), this, SLOT(dryRunPrint(QWebFrame*))); connect(m_page->mainFrame(), SIGNAL(titleChanged(const QString&)), SLOT(titleChanged(const QString&))); connect(m_page, SIGNAL(databaseQuotaExceeded(QWebFrame*,QString)), this, SLOT(dumpDatabaseQuota(QWebFrame*,QString))); connect(m_page, SIGNAL(applicationCacheQuotaExceeded(QWebSecurityOrigin *, quint64)), this, SLOT(dumpApplicationCacheQuota(QWebSecurityOrigin *, quint64))); connect(m_page, SIGNAL(statusBarMessage(const QString&)), this, SLOT(statusBarMessage(const QString&))); QObject::connect(this, SIGNAL(quit()), qApp, SLOT(quit()), Qt::QueuedConnection); DumpRenderTreeSupportQt::setDumpRenderTreeModeEnabled(true); QFocusEvent event(QEvent::FocusIn, Qt::ActiveWindowFocusReason); QApplication::sendEvent(m_mainView, &event); }
void OutputPaneManager::init() { ActionContainer *mwindow = ActionManager::actionContainer(Constants::M_WINDOW); const Context globalContext(Constants::C_GLOBAL); // Window->Output Panes ActionContainer *mpanes = ActionManager::createMenu(Constants::M_WINDOW_PANES); mwindow->addMenu(mpanes, Constants::G_WINDOW_PANES); mpanes->menu()->setTitle(tr("Output &Panes")); mpanes->appendGroup("Coreplugin.OutputPane.ActionsGroup"); mpanes->appendGroup("Coreplugin.OutputPane.PanesGroup"); Command *cmd; cmd = ActionManager::registerAction(m_clearAction, "Coreplugin.OutputPane.clear", globalContext); m_clearButton->setDefaultAction(cmd->action()); mpanes->addAction(cmd, "Coreplugin.OutputPane.ActionsGroup"); cmd = ActionManager::registerAction(m_prevAction, "Coreplugin.OutputPane.previtem", globalContext); cmd->setDefaultKeySequence(QKeySequence(tr("Shift+F6"))); m_prevToolButton->setDefaultAction(cmd->action()); mpanes->addAction(cmd, "Coreplugin.OutputPane.ActionsGroup"); cmd = ActionManager::registerAction(m_nextAction, "Coreplugin.OutputPane.nextitem", globalContext); m_nextToolButton->setDefaultAction(cmd->action()); cmd->setDefaultKeySequence(QKeySequence(tr("F6"))); mpanes->addAction(cmd, "Coreplugin.OutputPane.ActionsGroup"); cmd = ActionManager::registerAction(m_minMaxAction, "Coreplugin.OutputPane.minmax", globalContext); cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Ctrl+9") : tr("Alt+9"))); cmd->setAttribute(Command::CA_UpdateText); cmd->setAttribute(Command::CA_UpdateIcon); mpanes->addAction(cmd, "Coreplugin.OutputPane.ActionsGroup"); connect(m_minMaxAction, SIGNAL(triggered()), this, SLOT(slotMinMax())); m_minMaxButton->setDefaultAction(cmd->action()); mpanes->addSeparator(globalContext, "Coreplugin.OutputPane.ActionsGroup"); QFontMetrics titleFm = m_titleLabel->fontMetrics(); int minTitleWidth = 0; m_panes = ExtensionSystem::PluginManager::getObjects<IOutputPane>(); qSort(m_panes.begin(), m_panes.end(), &comparePanes); const int n = m_panes.size(); int shortcutNumber = 1; const Id baseId = "QtCreator.Pane."; for (int i = 0; i != n; ++i) { IOutputPane *outPane = m_panes.at(i); const int idx = m_outputWidgetPane->addWidget(outPane->outputWidget(this)); QTC_CHECK(idx == i); connect(outPane, SIGNAL(showPage(int)), this, SLOT(showPage(int))); connect(outPane, SIGNAL(hidePage()), this, SLOT(slotHide())); connect(outPane, SIGNAL(togglePage(int)), this, SLOT(togglePage(int))); connect(outPane, SIGNAL(navigateStateUpdate()), this, SLOT(updateNavigateState())); connect(outPane, SIGNAL(flashButton()), this, SLOT(flashButton())); connect(outPane, SIGNAL(setBadgeNumber(int)), this, SLOT(setBadgeNumber(int))); QWidget *toolButtonsContainer = new QWidget(m_opToolBarWidgets); QHBoxLayout *toolButtonsLayout = new QHBoxLayout; toolButtonsLayout->setMargin(0); toolButtonsLayout->setSpacing(0); foreach (QWidget *toolButton, outPane->toolBarWidgets()) toolButtonsLayout->addWidget(toolButton); toolButtonsLayout->addStretch(5); toolButtonsContainer->setLayout(toolButtonsLayout); m_opToolBarWidgets->addWidget(toolButtonsContainer); minTitleWidth = qMax(minTitleWidth, titleFm.width(outPane->displayName())); QString suffix = outPane->displayName().simplified(); suffix.remove(QLatin1Char(' ')); const Id id = baseId.withSuffix(suffix); QAction *action = new QAction(outPane->displayName(), this); Command *cmd = ActionManager::registerAction(action, id, globalContext); mpanes->addAction(cmd, "Coreplugin.OutputPane.PanesGroup"); m_actions.append(action); m_ids.append(id); cmd->setDefaultKeySequence(QKeySequence(paneShortCut(shortcutNumber))); OutputPaneToggleButton *button = new OutputPaneToggleButton(shortcutNumber, outPane->displayName(), cmd->action()); ++shortcutNumber; m_buttonsWidget->layout()->addWidget(button); m_buttons.append(button); connect(button, SIGNAL(clicked()), this, SLOT(buttonTriggered())); bool visible = outPane->priorityInStatusBar() != -1; button->setVisible(visible); connect(action, SIGNAL(triggered()), this, SLOT(shortcutTriggered())); } m_titleLabel->setMinimumWidth(minTitleWidth + m_titleLabel->contentsMargins().left() + m_titleLabel->contentsMargins().right()); m_buttonsWidget->layout()->addWidget(m_manageButton); connect(m_manageButton, SIGNAL(clicked()), this, SLOT(popupMenu())); readSettings(); }
void OutputPaneManager::init() { ActionManager *am = Core::ICore::instance()->actionManager(); ActionContainer *mwindow = am->actionContainer(Constants::M_WINDOW); const Context globalcontext(Core::Constants::C_GLOBAL); // Window->Output Panes ActionContainer *mpanes = am->createMenu(Constants::M_WINDOW_PANES); mwindow->addMenu(mpanes, Constants::G_WINDOW_PANES); mpanes->menu()->setTitle(tr("Output &Panes")); mpanes->appendGroup("Coreplugin.OutputPane.ActionsGroup"); mpanes->appendGroup("Coreplugin.OutputPane.PanesGroup"); Core::Command *cmd; cmd = am->registerAction(m_clearAction, "Coreplugin.OutputPane.clear", globalcontext); m_clearButton->setDefaultAction(cmd->action()); mpanes->addAction(cmd, "Coreplugin.OutputPane.ActionsGroup"); cmd = am->registerAction(m_prevAction, "Coreplugin.OutputPane.previtem", globalcontext); cmd->setDefaultKeySequence(QKeySequence("Shift+F6")); m_prevToolButton->setDefaultAction(cmd->action()); mpanes->addAction(cmd, "Coreplugin.OutputPane.ActionsGroup"); cmd = am->registerAction(m_nextAction, "Coreplugin.OutputPane.nextitem", globalcontext); m_nextToolButton->setDefaultAction(cmd->action()); cmd->setDefaultKeySequence(QKeySequence("F6")); mpanes->addAction(cmd, "Coreplugin.OutputPane.ActionsGroup"); cmd = am->registerAction(m_minMaxAction, "Coreplugin.OutputPane.minmax", globalcontext); #ifdef Q_WS_MAC cmd->setDefaultKeySequence(QKeySequence("Ctrl+9")); #else cmd->setDefaultKeySequence(QKeySequence("Alt+9")); #endif cmd->setAttribute(Command::CA_UpdateText); cmd->setAttribute(Command::CA_UpdateIcon); mpanes->addAction(cmd, "Coreplugin.OutputPane.ActionsGroup"); connect(m_minMaxAction, SIGNAL(triggered()), this, SLOT(slotMinMax())); m_minMaxButton->setDefaultAction(cmd->action()); QAction *sep = new QAction(this); sep->setSeparator(true); cmd = am->registerAction(sep, "Coreplugin.OutputPane.Sep", globalcontext); mpanes->addAction(cmd, "Coreplugin.OutputPane.ActionsGroup"); QList<IOutputPane*> panes = ExtensionSystem::PluginManager::instance() ->getObjects<IOutputPane>(); QMultiMap<int, IOutputPane*> sorted; foreach (IOutputPane* outPane, panes) sorted.insertMulti(outPane->priorityInStatusBar(), outPane); QMultiMap<int, IOutputPane*>::const_iterator it, begin; begin = sorted.constBegin(); it = sorted.constEnd(); int shortcutNumber = 1; while (it != begin) { --it; IOutputPane* outPane = it.value(); const int idx = m_outputWidgetPane->addWidget(outPane->outputWidget(this)); m_pageMap.insert(idx, outPane); connect(outPane, SIGNAL(showPage(bool,bool)), this, SLOT(showPage(bool,bool))); connect(outPane, SIGNAL(hidePage()), this, SLOT(slotHide())); connect(outPane, SIGNAL(togglePage(bool)), this, SLOT(togglePage(bool))); connect(outPane, SIGNAL(navigateStateUpdate()), this, SLOT(updateNavigateState())); QWidget *toolButtonsContainer = new QWidget(m_opToolBarWidgets); QHBoxLayout *toolButtonsLayout = new QHBoxLayout; toolButtonsLayout->setMargin(0); toolButtonsLayout->setSpacing(0); foreach (QWidget *toolButton, outPane->toolBarWidgets()) toolButtonsLayout->addWidget(toolButton); toolButtonsLayout->addStretch(5); toolButtonsContainer->setLayout(toolButtonsLayout); m_opToolBarWidgets->addWidget(toolButtonsContainer); QString actionId = QString("QtCreator.Pane.%1").arg(outPane->displayName().simplified()); actionId.remove(QLatin1Char(' ')); QAction *action = new QAction(outPane->displayName(), this); Command *cmd = am->registerAction(action, Id(actionId), Context(Constants::C_GLOBAL)); mpanes->addAction(cmd, "Coreplugin.OutputPane.PanesGroup"); m_actions.insert(cmd->action(), idx); if (outPane->priorityInStatusBar() != -1) { cmd->setDefaultKeySequence(QKeySequence(paneShortCut(shortcutNumber))); QToolButton *button = new OutputPaneToggleButton(shortcutNumber, outPane->displayName(), cmd->action()); ++shortcutNumber; m_buttonsWidget->layout()->addWidget(button); connect(button, SIGNAL(clicked()), this, SLOT(buttonTriggered())); m_buttons.insert(idx, button); } // Now add the entry to the combobox, since the first item we add sets the currentIndex, thus we need to be set up for that m_widgetComboBox->addItem(outPane->displayName(), idx); connect(cmd->action(), SIGNAL(triggered()), this, SLOT(shortcutTriggered())); } changePage(); }