Changeset 116299 in webkit
- Timestamp:
- May 7, 2012 4:49:00 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 10 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r116277 r116299 1 2012-05-07 Balazs Kelemen <kbalazs@webkit.org> 2 3 [Qt] Add test specific platform plugin to achieve unified layout test results 4 https://bugs.webkit.org/show_bug.cgi?id=80996 5 6 Reviewed by Simon Hausmann. 7 8 Initialize the test platform plugin before initializing 9 the web process if we are in a WTR run. 10 It is necessary to place this initialization here as we 11 cannot control wich platform plugin will be used after 12 the instantiation of the QApplication. 13 14 * qt/MainQt.cpp: 15 (initializeTestPlatformPluginForWTRIfRequired): 16 (main): 17 1 18 2012-05-06 MORITA Hajime <morrita@google.com> 2 19 -
trunk/Source/WebKit2/qt/MainQt.cpp
r115958 r116299 26 26 27 27 #include <QApplication> 28 28 #include <QByteArray> 29 #include <QFile> 30 #include <QPlatformIntegration> 31 #include <QPlatformIntegrationPlugin> 32 #include <QPluginLoader> 29 33 #include <stdio.h> 30 34 … … 44 48 } 45 49 50 static void initializeTestPlatformPluginForWTRIfRequired() 51 { 52 QByteArray pluginPath = qgetenv("QT_WEBKIT2_TEST_PLATFORM_PLUGIN_PATH"); 53 if (pluginPath.isEmpty()) 54 return; 55 56 QPluginLoader loader(QFile::decodeName(pluginPath.data())); 57 QPlatformIntegrationPlugin* plugin = qobject_cast<QPlatformIntegrationPlugin*>(loader.instance()); 58 if (!plugin) 59 qFatal("cannot initialize test platform plugin\n"); 60 61 qputenv("QT_QPA_PLATFORM_PLUGIN_PATH", pluginPath); 62 qputenv("QT_QPA_PLATFORM", "testplatform"); 63 } 64 46 65 // The framework entry point. 47 66 // We call our platform specific entry point directly rather than WebKitMain because it makes little sense … … 57 76 #endif 58 77 78 initializeTestPlatformPluginForWTRIfRequired(); 59 79 WebKit::initializeWebKit2Theme(); 60 80 -
trunk/Tools/ChangeLog
r116296 r116299 1 2012-05-07 Balazs Kelemen <kbalazs@webkit.org> 2 3 [Qt] Add test specific platform plugin to achieve unified layout test results 4 https://bugs.webkit.org/show_bug.cgi?id=80996 5 6 Reviewed by Simon Hausmann. 7 8 Added QtTestPlatformPlugin as a new project under Tools. 9 This is a Qt5-ish platform plugin that can be used to tweak the 10 platform support interfaces in order to unify layout test results. 11 For now it only overrides the font database on Mac and redirects 12 everything else to the real platform plugin. The font database it 13 provides mimics the way how we set up test fonts with fontconfig on Linux. 14 Make DumpRenderTree and WebKitTestRunner use this platform plugin. 15 16 * DumpRenderTree/qt/DumpRenderTree.pro: 17 * DumpRenderTree/qt/main.cpp: 18 (initializeTestPlatformPlugin): 19 (main): 20 * QtTestPlatformPlugin/QtTestPlatformPlugin.pro: Added. 21 * QtTestPlatformPlugin/TestIntegration.cpp: Added. 22 (TestIntegration::TestIntegration): 23 (TestIntegration::fontDatabase): 24 * QtTestPlatformPlugin/TestIntegration.h: Added. 25 (TestIntegration): 26 (TestIntegration::hasCapability): 27 (TestIntegration::createPlatformPixmap): 28 (TestIntegration::createPlatformWindow): 29 (TestIntegration::createPlatformBackingStore): 30 (TestIntegration::createPlatformOpenGLContext): 31 (TestIntegration::createPlatformSharedGraphicsCache): 32 (TestIntegration::guiThreadEventDispatcher): 33 (TestIntegration::clipboard): 34 (TestIntegration::drag): 35 (TestIntegration::inputContext): 36 (TestIntegration::accessibility): 37 (TestIntegration::nativeInterface): 38 (TestIntegration::services): 39 (TestIntegration::styleHint): 40 (TestIntegration::platformTheme): 41 * QtTestPlatformPlugin/mac/TestFontDatabase.h: Added. 42 (TestFontDatabase): 43 * QtTestPlatformPlugin/mac/TestFontDatabase.mm: Added. 44 (TestFontDatabase::populateFontDatabase): 45 * QtTestPlatformPlugin/mac/TestIntegrationMac.mm: Added. 46 (TestIntegration::fontDatabase): 47 * QtTestPlatformPlugin/main.cpp: Added. 48 (TestIntegrationPlugin::keys): 49 (TestIntegrationPlugin::create): 50 (TestIntegrationPlugin::initialize): 51 * QtTestPlatformPlugin/testplatform.json: Added. 52 * Tools.pro: 53 * WebKitTestRunner/Target.pri: 54 * WebKitTestRunner/qt/main.cpp: 55 (main): 56 1 57 2012-05-07 Christophe Dumez <christophe.dumez@intel.com> 2 58 -
trunk/Tools/DumpRenderTree/qt/DumpRenderTree.pro
r114042 r116299 58 58 DEFINES += USE_SYSTEM_MALLOC=1 59 59 60 mac: LIB_SUFFIX=.dylib 61 win: LIB_SUFFIX=.dll 62 unix:!mac: LIB_SUFFIX=.so 63 DEFINES += TEST_PLATFORM_PLUGIN_PATH=\"\\\"$${ROOT_BUILD_DIR}$${QMAKE_DIR_SEP}lib$${QMAKE_DIR_SEP}libtestplatform$${LIB_SUFFIX}\\\"\" 64 60 65 RESOURCES = DumpRenderTree.qrc -
trunk/Tools/DumpRenderTree/qt/main.cpp
r108790 r116299 32 32 #include "QtInitializeTestFonts.h" 33 33 34 #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) 35 #include <QPlatformIntegration> 36 #include <QPlatformIntegrationPlugin> 37 #include <QPluginLoader> 38 #endif 39 34 40 #include <wtf/AlwaysInline.h> 35 41 … … 124 130 #endif 125 131 132 static void initializeTestPlatformPlugin(int argc, char* argv[] const) 133 { 134 #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) 135 QPluginLoader loader(TEST_PLATFORM_PLUGIN_PATH); 136 QPlatformIntegrationPlugin* plugin = qobject_cast<QPlatformIntegrationPlugin*>(loader.instance()); 137 if (!plugin) 138 qFatal("cannot initialize test platform plugin\n"); 139 140 QByteArray platform = qgetenv("QT_QPA_PLATFORM"); 141 QByteArray platformPluginPath = qgetenv("QT_QPA_PLATFORM_PLUGIN_PATH"); 142 for (int i = 0; i < argc; ++i) { 143 if (QByteArray(argv[i]) == "-platform" && i + 1 < argc) 144 platform = argv[i + 1]; 145 else if (QByteArray(argv[i]) == "-platformpluginpath" && i + 1 < argc) 146 platformPluginPath = argv[i + 1]; 147 } 148 if (!platform.isEmpty()) 149 qputenv("QT_WEBKIT_ORIGINAL_PLATFORM", platform); 150 if (!platformPluginPath.isEmpty()) 151 qputenv("QT_WEBKIT_ORIGINAL_PLATFORM_PLUGIN_PATH", platformPluginPath); 152 153 qputenv("QT_QPA_PLATFORM_PLUGIN_PATH", TEST_PLATFORM_PLUGIN_PATH); 154 qputenv("QT_QPA_PLATFORM", "testplatform"); 155 #endif 156 } 157 126 158 int main(int argc, char* argv[]) 127 159 { … … 146 178 147 179 WebKit::initializeTestFonts(); 180 181 initializeTestPlatformPlugin(argc, argv); 148 182 149 183 QApplication::setGraphicsSystem("raster"); -
trunk/Tools/Tools.pro
r116107 r116299 13 13 SUBDIRS += DumpRenderTree/qt/DumpRenderTree.pro 14 14 SUBDIRS += DumpRenderTree/qt/ImageDiff.pro 15 16 haveQt(5): SUBDIRS += QtTestPlatformPlugin/QtTestPlatformPlugin.pro 15 17 16 18 !no_webkit2 { -
trunk/Tools/WebKitTestRunner/Target.pri
r113172 r116299 38 38 *-clang*:QMAKE_CXXFLAGS += "-include $$PREFIX_HEADER" 39 39 40 mac: LIB_SUFFIX=.dylib 41 win: LIB_SUFFIX=.dll 42 unix:!mac: LIB_SUFFIX=.so 43 DEFINES += TEST_PLATFORM_PLUGIN_PATH=\"\\\"$${ROOT_BUILD_DIR}$${QMAKE_DIR_SEP}lib$${QMAKE_DIR_SEP}libtestplatform$${LIB_SUFFIX}\\\"\" 44 40 45 RESOURCES = qt/WebKitTestRunner.qrc -
trunk/Tools/WebKitTestRunner/qt/main.cpp
r115958 r116299 103 103 qputenv("QT_WEBKIT_THEME_NAME", "qstyle"); 104 104 105 QByteArray platform = qgetenv("QT_QPA_PLATFORM"); 106 QByteArray platformPluginPath = qgetenv("QT_QPA_PLATFORM_PLUGIN_PATH"); 107 for (int i = 0; i < argc; ++i) { 108 if (QByteArray(argv[i]) == "-platform" && i + 1 < argc) 109 platform = argv[i + 1]; 110 else if (QByteArray(argv[i]) == "-platformpluginpath" && i + 1 < argc) 111 platformPluginPath = argv[i + 1]; 112 } 113 if (!platform.isEmpty()) 114 qputenv("QT_WEBKIT_ORIGINAL_PLATFORM", platform); 115 if (!platformPluginPath.isEmpty()) 116 qputenv("QT_WEBKIT_ORIGINAL_PLATFORM_PLUGIN_PATH", platformPluginPath); 117 118 // Tell the web process that we want to use the test platform plugin. 119 qputenv("QT_WEBKIT2_TEST_PLATFORM_PLUGIN_PATH", TEST_PLATFORM_PLUGIN_PATH); 120 105 121 QQuickWebViewExperimental::setFlickableViewportEnabled(false); 106 122 QApplication app(argc, argv);
Note: See TracChangeset
for help on using the changeset viewer.