Changeset 155714 in webkit


Ignore:
Timestamp:
Sep 13, 2013 12:06:11 PM (11 years ago)
Author:
kov@webkit.org
Message:

[GTK] Move to the new web inspector
https://bugs.webkit.org/show_bug.cgi?id=120647

Patch by Gustavo Noronha Silva <gustavo.noronha@collabora.com> on 2013-09-13
Reviewed by Carlos Garcia Campos.

.:

  • GNUmakefile.am: include the new WebInspectorUI GNUmakefile.am.

Source/WebCore:

No tests for the new inspector UI as of yet.

  • GNUmakefile.am: no longer install the deprecated inspector UI files.
  • WebCore.exp.in: add SchemeRegistry symbol that is now used.

Source/WebInspectorUI:

  • GNUmakefile.am: Added. Generate the GResource source and link it into libWebCore.

Source/WebKit/gtk:

  • WebCoreSupport/InspectorClientGtk.cpp:

(WebKit::InspectorClient::openInspectorFrontend): update paths to the internal resource ones.
(WebKit::InspectorClient::inspectorFilesPath): ditto.

  • tests/testwebinspector.c:

(consoleMessageCallback): the new inspector currently emits an error when loading, so add it to
the list of messages which are not considered failures.

  • webkit/webkitglobals.cpp:

(webkitInit): register resource as a local scheme; currently used by the inspector.

Source/WebKit2:

  • GNUmakefile.am: bundle the remote inspector page list HTML into libwebkit2gtk as a GResource.
  • UIProcess/API/gtk/tests/GNUmakefile.am: no need to set WEBKIT_INSPECTOR_PATH anymore.
  • UIProcess/API/gtk/tests/InspectorTestServer.cpp:

(main): ditto.

  • UIProcess/API/gtk/tests/TestInspector.cpp:

(beforeAll): ditto.

  • UIProcess/API/gtk/tests/TestInspectorServer.cpp:

(testInspectorServerPageList): update paths to the internal resource ones.

  • UIProcess/InspectorServer/WebInspectorServer.h:
  • UIProcess/InspectorServer/gtk/WebInspectorServerGtk.cpp:

(WebKit::WebInspectorServer::platformResourceForPath): ditto.
(WebKit::WebInspectorServer::buildPageList): ditto.

  • UIProcess/WebInspectorProxy.cpp:

(WebKit::isMainInspectorPage): factor out checking for the inspector main resource, to make
the code more readable.
(WebKit::decidePolicyForNavigationAction): use SchemeRegistry to figure out whether the
request is for a local resource instead of KURL::isLocalFile() to allow using schemes
other than file:// for the inspector resources.

  • UIProcess/gtk/WebInspectorProxyGtk.cpp:

(WebKit::WebInspectorProxy::inspectorPageURL): use the new internal resource URL; since it's now
static we no longer need to generate and store the string.
(WebKit::WebInspectorProxy::inspectorBaseURL): ditto.

  • WebProcess/WebPage/gtk/WebInspectorGtk.cpp:

(WebKit::WebInspector::localizedStringsURL): use the new internal resource URL.

  • UIProcess/gtk/WebContextGtk.cpp:

(WebKit::WebContext::platformInitializeWebProcess): register resource as a local scheme.

Tools:

  • GtkLauncher/main.c:

(main): no longer set WEBKIT_INSPECTOR_PATH.

  • MiniBrowser/gtk/main.c:

(main): ditto.

  • Scripts/old-run-webkit-tests:

(openDumpTool): ditto.

  • Scripts/run-gtk-tests: ditto.
  • Scripts/webkitpy/port/gtk.py:

(GtkPort.setup_environ_for_server): ditto.

LayoutTests:

  • platform/gtk/TestExpectations: the new inspector UI does not support the current

inspector testing harness so keep it skipped, a new one will eventually be landed.

Location:
trunk
Files:
1 added
30 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r155694 r155714  
     12013-09-13  Gustavo Noronha Silva  <gustavo.noronha@collabora.com>
     2
     3        [GTK] Move to the new web inspector
     4        https://bugs.webkit.org/show_bug.cgi?id=120647
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        * GNUmakefile.am: include the new WebInspectorUI GNUmakefile.am.
     9
    1102013-09-13  Allan Sandfeld Jensen  <allan.jensen@digia.com>
    211
  • trunk/GNUmakefile.am

    r151325 r155714  
    3535GENSOURCES_JAVASCRIPTCORE := $(top_builddir)/DerivedSources/JavaScriptCore
    3636GENSOURCES_WEBCORE := $(top_builddir)/DerivedSources/WebCore
     37GENSOURCES_WEBINSPECTOR_UI := $(top_builddir)/DerivedSources/WebInspectorUI
    3738GENSOURCES_WEBKIT := $(top_builddir)/DerivedSources/webkit
    3839GENSOURCES_WEBKIT2 := $(top_builddir)/DerivedSources/WebKit2
     
    4243GENSOURCES_INSPECTOR := $(GENPROGRAMS)/resources/inspector
    4344WebCore := $(srcdir)/Source/WebCore
     45WebInspectorUI := $(srcdir)/Source/WebInspectorUI
    4446WebKit := $(srcdir)/Source/WebKit/gtk
    4547WebKit2 := $(srcdir)/Source/WebKit2
     
    198200include Source/WebCore/bindings/gobject/GNUmakefile.am
    199201include Source/WebCore/platform/gtk/po/GNUmakefile.am
     202include Source/WebInspectorUI/GNUmakefile.am
    200203include Source/WebKit/gtk/GNUmakefile.am
    201204include Tools/GNUmakefile.am
  • trunk/LayoutTests/ChangeLog

    r155708 r155714  
     12013-09-13  Gustavo Noronha Silva  <gustavo.noronha@collabora.com>
     2
     3        [GTK] Move to the new web inspector
     4        https://bugs.webkit.org/show_bug.cgi?id=120647
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        * platform/gtk/TestExpectations: the new inspector UI does not support the current
     9        inspector testing harness so keep it skipped, a new one will eventually be landed.
     10
    1112013-09-13  Chris Fleizach  <cfleizach@apple.com>
    212
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r155599 r155714  
    7070
    7171# These test -apple- and -khtml- prefixed CSS properties, which we don't support.
    72 inspector/styles/vendor-prefixes.html [ WontFix Pass ]
     72inspector/styles/vendor-prefixes.html [ Skip ]
    7373
    7474# This port doesn't support detecting slow unload handlers.
     
    968968webkit.org/b/83174 http/tests/inspector [ Skip ]
    969969
    970 webkit.org/b/82886 inspector/styles/override-screen-size.html [ Failure ]
    971 webkit.org/b/88780 inspector/debugger/dom-breakpoints.html [ Timeout Failure ]
    972 webkit.org/b/88780 inspector/debugger/event-listener-breakpoints.html [ Failure ]
    973 webkit.org/b/88780 inspector/debugger/step-through-event-listeners.html [ Failure ]
    974 webkit.org/b/89056 inspector/debugger/xhr-breakpoints.html [ Failure Timeout ]
    975 webkit.org/b/40300 inspector/debugger/live-edit.html [ Timeout Failure ]
    976 webkit.org/b/40300 inspector/debugger/live-edit-breakpoints.html [ Failure ]
    977 webkit.org/b/89652 inspector/debugger/debugger-compile-and-run.html [ Failure ]
    978 webkit.org/b/85709 inspector/extensions/extensions-eval-content-script.html [ Failure ]
    979 webkit.org/b/85709 inspector/extensions/extensions-audits-content-script.html [ Failure ]
    980 
    981 # These inspector tests fell out of the radar after the transition to NRWT
    982 # Some time out and some are flaky or present different baselines.
    983 Bug(GTK) inspector/debugger/scripts-panel.html [ Failure Pass ]
    984 Bug(GTK) inspector/elements/edit-dom-actions.html [ Failure Timeout Pass ]
    985 Bug(GTK) inspector/timeline/timeline-paint.html [ Failure ]
    986 Bug(GTK) inspector/timeline/timeline-decode-resize.html [ Failure ]
    987 Bug(GTK) http/tests/inspector/resource-har-pages.html [ Failure ]
    988 Bug(GTK) http/tests/inspector/resource-parameters.html [ Timeout ]
    989 
    990 webkit.org/b/56691 http/tests/inspector/network/network-size-chunked.html [ Failure ]
    991 webkit.org/b/56691 http/tests/inspector/network/network-size-sync.html [ Failure ]
    992 webkit.org/b/56691 http/tests/inspector/network/network-size.html [ Failure ]
    993 webkit.org/b/51380 http/tests/inspector/console-websocket-error.html [ Failure Timeout ]
    994 
    995 # JSC doesn't support heap profiling
    996 webkit.org/b/50485 inspector/profiler/heap-snapshot-comparison-dom-groups-change.html [ Failure ]
    997 webkit.org/b/50485 inspector/profiler/heap-snapshot-inspect-dom-wrapper.html [ Timeout Failure ]
    998 webkit.org/b/50485 inspector/profiler/heap-snapshot-loader.html [ Failure ]
    999 webkit.org/b/50485 inspector/profiler/heap-snapshot-reveal-in-dominators-view.html [ Failure ]
    1000 webkit.org/b/50485 inspector/profiler/heap-snapshot-summary-retainers.html [ Failure ]
    1001 webkit.org/b/50485 inspector/profiler/heap-snapshot-summary-show-ranges.html [ Failure ]
    1002 webkit.org/b/50485 inspector/profiler/heap-snapshot-summary-sorting-fields.html [ Failure ]
    1003 webkit.org/b/50485 inspector/profiler/heap-snapshot-summary-sorting-instances.html [ Failure ]
    1004 webkit.org/b/50485 inspector-protocol/heap-profiler [ Skip ]
    1005 
    1006 webkit.org/b/73936 inspector/profiler/canvas2d/canvas-has-uninstrumented-canvases.html [ Failure ]
    1007 webkit.org/b/73936 inspector/profiler/canvas2d/canvas-stack-trace.html [ Failure ]
    1008 webkit.org/b/73936 inspector/profiler/canvas2d/canvas-replay-log-grid.html [ Timeout Failure ]
    1009 
    1010970webkit.org/b/37613 webkit.org/b/20011 printing [ Skip ]
    1011971webkit.org/b/37613 editing/execCommand/print.html [ Skip ]
  • trunk/Source/WebCore/ChangeLog

    r155713 r155714  
     12013-09-13  Gustavo Noronha Silva  <gustavo.noronha@collabora.com>
     2
     3        [GTK] Move to the new web inspector
     4        https://bugs.webkit.org/show_bug.cgi?id=120647
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        No tests for the new inspector UI as of yet.
     9
     10        * GNUmakefile.am: no longer install the deprecated inspector UI files.
     11        * WebCore.exp.in: add SchemeRegistry symbol that is now used.
     12
    1132013-09-13  Darin Adler  <darin@apple.com>
    214
  • trunk/Source/WebCore/GNUmakefile.am

    r155534 r155714  
    703703        Source/WebCore/xml/XPathGrammar.y
    704704
    705 # Installing web inspector files
    706 webinspectordir = ${datadir}/webkitgtk-@WEBKITGTK_API_VERSION@/webinspector
    707 dist_webinspector_DATA = \
    708         $(WebCore)/English.lproj/localizedStrings.js \
    709         DerivedSources/WebCore/InspectorBackendCommands.js \
    710         $(shell ls $(WebCore)/inspector/front-end/*.js) \
    711         $(shell ls $(WebCore)/inspector/front-end/*.html) \
    712         $(shell ls $(WebCore)/inspector/front-end/*.css)
    713 
    714 webinspectoruglifyjsdir = ${datadir}/webkitgtk-@WEBKITGTK_API_VERSION@/webinspector/UglifyJS
    715 dist_webinspectoruglifyjs_DATA = \
    716         $(shell ls $(WebCore)/inspector/front-end/UglifyJS/*.js)
    717 
    718 webinspectorimagesdir = ${datadir}/webkitgtk-@WEBKITGTK_API_VERSION@/webinspector/Images
    719 dist_webinspectorimages_DATA = \
    720         $(shell ls $(WebCore)/inspector/front-end/Images/*.gif) \
    721         $(shell ls $(WebCore)/inspector/front-end/Images/*.png)
    722 
    723 # It seems that $(shell) does not expand when it is a rule dependency, so
    724 # we must redefine this list of copied files with traditional dependency wildcards.
    725 noinst_DATA += ${GENSOURCES_INSPECTOR}/inspector.html
    726 ${GENSOURCES_INSPECTOR}/inspector.html: $(WebCore)/inspector/front-end/*.html \
    727                 $(WebCore)/inspector/front-end/*.js \
    728                 $(WebCore)/inspector/front-end/UglifyJS/*.js \
    729                 $(WebCore)/inspector/front-end/*.css \
    730                 $(WebCore)/inspector/front-end/Images/* \
    731                 DerivedSources/WebCore/InspectorBackendCommands.js \
    732                 $(WebCore)/English.lproj/localizedStrings.js
    733         $(AM_V_GEN)
    734         $(AM_V_at)mkdir -p ${GENSOURCES_INSPECTOR}/UglifyJS
    735         $(AM_V_at)mkdir -p ${GENSOURCES_INSPECTOR}/Images
    736         $(AM_V_at)cp ${dist_webinspector_DATA} ${GENSOURCES_INSPECTOR}
    737         $(AM_V_at)cp ${dist_webinspectoruglifyjs_DATA} ${GENSOURCES_INSPECTOR}/UglifyJS
    738         $(AM_V_at)cp ${dist_webinspectorimages_DATA} ${GENSOURCES_INSPECTOR}/Images
    739 
    740705webresourcesdir = ${datadir}/webkitgtk-@WEBKITGTK_API_VERSION@/images
    741706dist_webresources_DATA = \
  • trunk/Source/WebCore/WebCore.exp.in

    r155600 r155714  
    25752575__ZNK7WebCore19InspectorController13drawHighlightERNS_15GraphicsContextE
    25762576__ZNK7WebCore9DOMWindow8documentEv
     2577__ZN7WebCore14SchemeRegistry27shouldTreatURLSchemeAsLocalERKN3WTF6StringE
    25772578#endif
    25782579
  • trunk/Source/WebInspectorUI/ChangeLog

    r155661 r155714  
     12013-09-13  Gustavo Noronha Silva  <gustavo.noronha@collabora.com>
     2
     3        [GTK] Move to the new web inspector
     4        https://bugs.webkit.org/show_bug.cgi?id=120647
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        * GNUmakefile.am: Added. Generate the GResource source and link it into libWebCore.
     9
    1102013-09-12  Joseph Pecoraro  <pecoraro@apple.com>
    211
  • trunk/Source/WebKit/gtk/ChangeLog

    r155677 r155714  
     12013-09-13  Gustavo Noronha Silva  <gustavo.noronha@collabora.com>
     2
     3        [GTK] Move to the new web inspector
     4        https://bugs.webkit.org/show_bug.cgi?id=120647
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        * WebCoreSupport/InspectorClientGtk.cpp:
     9        (WebKit::InspectorClient::openInspectorFrontend): update paths to the internal resource ones.
     10        (WebKit::InspectorClient::inspectorFilesPath): ditto.
     11        * tests/testwebinspector.c:
     12        (consoleMessageCallback): the new inspector currently emits an error when loading, so add it to
     13        the list of messages which are not considered failures.
     14        * webkit/webkitglobals.cpp:
     15        (webkitInit): register resource as a local scheme; currently used by the inspector.
     16
    1172013-09-13  Alberto Garcia  <berto@igalia.com>
    218
  • trunk/Source/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp

    r150041 r155714  
    105105    webkit_web_inspector_set_web_view(webInspector, inspectorWebView);
    106106 
    107     GOwnPtr<gchar> inspectorPath(g_build_filename(inspectorFilesPath(), "inspector.html", NULL));
    108     GOwnPtr<gchar> inspectorURI(g_filename_to_uri(inspectorPath.get(), 0, 0));
    109     webkit_web_view_load_uri(inspectorWebView, inspectorURI.get());
     107    webkit_web_view_load_uri(inspectorWebView, "resource:///org/webkitgtk/inspector/UserInterface/Main.html");
    110108
    111109    gtk_widget_show(GTK_WIDGET(inspectorWebView));
     
    156154{
    157155    return doDispatchMessageOnFrontendPage(m_frontendPage, message);
    158 }
    159 
    160 const char* InspectorClient::inspectorFilesPath()
    161 {
    162     if (m_inspectorFilesPath)
    163         return m_inspectorFilesPath.get();
    164 
    165     const char* environmentPath = getenv("WEBKIT_INSPECTOR_PATH");
    166     if (environmentPath && g_file_test(environmentPath, G_FILE_TEST_IS_DIR))
    167         m_inspectorFilesPath.set(g_strdup(environmentPath));
    168     else
    169         m_inspectorFilesPath.set(g_build_filename(sharedResourcesPath().data(), "webinspector", NULL));
    170 
    171     return m_inspectorFilesPath.get();
    172156}
    173157
     
    221205String InspectorFrontendClient::localizedStringsURL()
    222206{
    223     GOwnPtr<gchar> stringsPath(g_build_filename(m_inspectorClient->inspectorFilesPath(), "localizedStrings.js", NULL));
    224     GOwnPtr<gchar> stringsURI(g_filename_to_uri(stringsPath.get(), 0, 0));
    225 
    226207    // FIXME: support l10n of localizedStrings.js
    227     return String::fromUTF8(stringsURI.get());
     208    return String("resource:///org/webkitgtk/inspector/Localizations/en.lproj/localizedStrings.js");
    228209}
    229210
  • trunk/Source/WebKit/gtk/tests/testwebinspector.c

    r149952 r155714  
    4040static gboolean consoleMessageCallback(WebKitWebView* webView, const char* message, unsigned int line, const char* sourceId)
    4141{
    42     if (strstr(message, "Localized string") || strstr(message, "Protocol Error: the message is for non-existing domain 'Profiler'"))
     42    if (strstr(message, "Localized string") || strstr(message, "Protocol Error: the message is for non-existing domain 'Profiler'") ||
     43        strstr(message, "Didn't find a TreeElement for a representedObject"))
    4344        return TRUE;
    4445
  • trunk/Source/WebKit/gtk/webkit/webkitglobals.cpp

    r153736 r155714  
    563563    WebCore::ResourceHandle::setIgnoreSSLErrors(true);
    564564
     565    WebCore::SchemeRegistry::registerURLSchemeAsLocal("resource");
     566
    565567    atexit(webkitExit);
    566568}
  • trunk/Source/WebKit2/ChangeLog

    r155702 r155714  
     12013-09-13  Gustavo Noronha Silva  <gustavo.noronha@collabora.com>
     2
     3        [GTK] Move to the new web inspector
     4        https://bugs.webkit.org/show_bug.cgi?id=120647
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        * GNUmakefile.am: bundle the remote inspector page list HTML into libwebkit2gtk as a GResource.
     9        * UIProcess/API/gtk/tests/GNUmakefile.am: no need to set WEBKIT_INSPECTOR_PATH anymore.
     10        * UIProcess/API/gtk/tests/InspectorTestServer.cpp:
     11        (main): ditto.
     12        * UIProcess/API/gtk/tests/TestInspector.cpp:
     13        (beforeAll): ditto.
     14        * UIProcess/API/gtk/tests/TestInspectorServer.cpp:
     15        (testInspectorServerPageList): update paths to the internal resource ones.
     16        * UIProcess/InspectorServer/WebInspectorServer.h:
     17        * UIProcess/InspectorServer/gtk/WebInspectorServerGtk.cpp:
     18        (WebKit::WebInspectorServer::platformResourceForPath): ditto.
     19        (WebKit::WebInspectorServer::buildPageList): ditto.
     20        * UIProcess/WebInspectorProxy.cpp:
     21        (WebKit::isMainInspectorPage): factor out checking for the inspector main resource, to make
     22        the code more readable.
     23        (WebKit::decidePolicyForNavigationAction): use SchemeRegistry to figure out whether the
     24        request is for a local resource instead of KURL::isLocalFile() to allow using schemes
     25        other than file:// for the inspector resources.
     26        * UIProcess/gtk/WebInspectorProxyGtk.cpp:
     27        (WebKit::WebInspectorProxy::inspectorPageURL): use the new internal resource URL; since it's now
     28        static we no longer need to generate and store the string.
     29        (WebKit::WebInspectorProxy::inspectorBaseURL): ditto.
     30        * WebProcess/WebPage/gtk/WebInspectorGtk.cpp:
     31        (WebKit::WebInspector::localizedStringsURL): use the new internal resource URL.
     32        * UIProcess/gtk/WebContextGtk.cpp:
     33        (WebKit::WebContext::platformInitializeWebProcess): register resource as a local scheme.
     34
    1352013-09-13  Allan Sandfeld Jensen  <allan.jensen@digia.com>
    236
  • trunk/Source/WebKit2/GNUmakefile.am

    r155534 r155714  
    1919        Programs/WebKitPluginProcess
    2020endif
     21
     22${GENSOURCES_WEBINSPECTOR_UI}/WebKit2GResourceBundle.xml: GNUmakefile \
     23        $(WebKit2)/UIProcess/InspectorServer/front-end/inspectorPageIndex.html
     24        $(AM_V_GEN)
     25        $(AM_V_at)mkdir -p ${GENSOURCES_WEBINSPECTOR_UI}
     26        $(AM_V_at)echo '<?xml version="1.0" encoding="UTF-8"?>' > ${GENSOURCES_WEBINSPECTOR_UI}/WebKit2GResourceBundle.xml
     27        $(AM_V_at)echo '<gresources>' >> ${GENSOURCES_WEBINSPECTOR_UI}/WebKit2GResourceBundle.xml
     28        $(AM_V_at)echo '  <gresource prefix="/org/webkitgtk/inspector/UserInterface">' >> ${GENSOURCES_WEBINSPECTOR_UI}/WebKit2GResourceBundle.xml
     29        $(AM_V_at)echo "    <file>inspectorPageIndex.html</file>" >> ${GENSOURCES_WEBINSPECTOR_UI}/WebKit2GResourceBundle.xml
     30        $(AM_V_at)echo '  </gresource>' >> ${GENSOURCES_WEBINSPECTOR_UI}/WebKit2GResourceBundle.xml
     31        $(AM_V_at)echo '</gresources>' >> ${GENSOURCES_WEBINSPECTOR_UI}/WebKit2GResourceBundle.xml
     32
     33${GENSOURCES_WEBINSPECTOR_UI}/WebKit2GResourceBundle.c: DerivedSources/WebInspectorUI/WebKit2GResourceBundle.xml
     34        $(AM_V_GEN)
     35        $(AM_V_at)glib-compile-resources --generate --sourcedir=$(WebKit2)/UIProcess/InspectorServer/front-end \
     36                --target=${GENSOURCES_WEBINSPECTOR_UI}/WebKit2GResourceBundle.c ${GENSOURCES_WEBINSPECTOR_UI}/WebKit2GResourceBundle.xml
     37
     38BUILT_SOURCES += \
     39        DerivedSources/WebInspectorUI/WebKit2GResourceBundle.xml
     40
     41webkit2gtk_built_sources += \
     42        DerivedSources/WebInspectorUI/WebKit2GResourceBundle.c
    2143
    2244# Platform
     
    723745        $(shell ls $(WebKit2)/WebProcess/soup/*.in)
    724746
    725 # Installing remote inspector files
    726 remoteinspectordir = ${datadir}/webkitgtk-@WEBKITGTK_API_VERSION@/webinspector
    727 remoteinspector_DATA = \
    728         $(WebKit2)/UIProcess/InspectorServer/front-end/inspectorPageIndex.html
    729 
  • trunk/Source/WebKit2/UIProcess/API/gtk/tests/GNUmakefile.am

    r154540 r155714  
    259259        Source/WebKit2/UIProcess/API/gtk/tests/TestInspector.cpp
    260260Programs_WebKit2APITests_TestInspector_CPPFLAGS = \
    261         -DWEBKIT_INSPECTOR_PATH=\"${shell pwd}/${top_builddir}/resources/inspector\" \
    262261        $(webkit2_tests_cppflags)
    263262Programs_WebKit2APITests_TestInspector_LDADD = $(webkit2_tests_ldadd)
  • trunk/Source/WebKit2/UIProcess/API/gtk/tests/InspectorTestServer.cpp

    r153085 r155714  
    4141    // Overwrite WEBKIT_INSPECTOR_SERVER variable with default value.
    4242    g_setenv("WEBKIT_INSPECTOR_SERVER", "127.0.0.1:2999", TRUE);
    43    
    44     // Overwrite WEBKIT_INSPECTOR_SERVER_PATH variable to point to inspector resources folder.
    45     const gchar* inspectorResourcesPath = g_getenv("WEBKIT_INSPECTOR_PATH");
    46     g_setenv("WEBKIT_INSPECTOR_SERVER_PATH", inspectorResourcesPath, TRUE);
    4743
    4844    WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new());
  • trunk/Source/WebKit2/UIProcess/API/gtk/tests/TestInspector.cpp

    r154567 r155714  
    347347void beforeAll()
    348348{
    349     g_setenv("WEBKIT_INSPECTOR_PATH", WEBKIT_INSPECTOR_PATH, FALSE);
    350349    InspectorTest::add("WebKitWebInspector", "default", testInspectorDefault);
    351350    CustomInspectorTest::add("WebKitWebInspector", "manual-attach-detach", testInspectorManualAttachDetach);
  • trunk/Source/WebKit2/UIProcess/API/gtk/tests/TestInspectorServer.cpp

    r155642 r155714  
    156156
    157157// Test to get inspector server page list from the test server.
    158 // Should contain only one entry pointing to http://127.0.0.1:2999/webinspector/inspector.html?page=1
     158// Should contain only one entry pointing to http://127.0.0.1:2999/webinspector/Main.html?page=1
    159159static void testInspectorServerPageList(InspectorServerTest* test, gconstpointer)
    160160{
     
    185185    g_assert(!error.get());
    186186    valueString.set(WebViewTest::javascriptResultToCString(javascriptResult));
    187     String validInspectorURL = String("/inspector.html?page=") + String::number(pageId);
     187    String validInspectorURL = String("/Main.html?page=") + String::number(pageId);
    188188    ASSERT_CMP_CSTRING(valueString.get(), ==, validInspectorURL.utf8());
    189189}
  • trunk/Source/WebKit2/UIProcess/InspectorServer/WebInspectorServer.h

    r150582 r155714  
    6868    void closeConnection(WebInspectorProxy*, WebSocketServerConnection*);
    6969
    70 #if PLATFORM(GTK)
    71     String inspectorServerFilesPath();
    72     String m_inspectorServerFilesPath;
    73 #endif
    7470    unsigned m_nextAvailablePageId;
    7571    ClientMap m_clientMap;
  • trunk/Source/WebKit2/UIProcess/InspectorServer/gtk/WebInspectorServerGtk.cpp

    r153085 r155714  
    3737#include <wtf/text/CString.h>
    3838#include <wtf/text/StringBuilder.h>
     39#include <wtf/text/StringConcatenate.h>
    3940
    4041namespace WebKit {
     
    4950
    5051    // Point the default path to a formatted page that queries the page list and display them.
    51     CString localPath = WebCore::fileSystemRepresentation(inspectorServerFilesPath() + ((path == "/") ? "/inspectorPageIndex.html" : path));
    52     if (localPath.isNull())
     52    CString resourceURI = makeString("resource:///org/webkitgtk/inspector/UserInterface", ((path == "/") ? "/inspectorPageIndex.html" : path)).utf8();
     53    if (resourceURI.isNull())
    5354        return false;
    5455
    55     GRefPtr<GFile> file = adoptGRef(g_file_new_for_path(localPath.data()));
     56    GRefPtr<GFile> file = adoptGRef(g_file_new_for_uri(resourceURI.data()));
    5657    GOwnPtr<GError> error;
    5758    GRefPtr<GFileInfo> fileInfo = adoptGRef(g_file_query_info(file.get(), G_FILE_ATTRIBUTE_STANDARD_SIZE "," G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE, G_FILE_QUERY_INFO_NONE, 0, &error.outPtr()));
     
    6263        builder.appendLiteral(", ");
    6364        builder.append(error->message);
    64         builder.appendLiteral(" occurred during fetching webinspector resource files.<br>Make sure you ran make install or have set WEBKIT_INSPECTOR_SERVER_PATH in your environment to point to webinspector folder.</body></html>");
     65        builder.appendLiteral(" occurred during fetching inspector resource files.</body></html>");
    6566        CString cstr = builder.toString().utf8();
    6667        data.append(cstr.data(), cstr.length());
     
    9899        builder.append(webPage->activeURL());
    99100        builder.appendLiteral("\", \"inspectorUrl\": \"");
    100         builder.appendLiteral("/inspector.html?page=");
     101        builder.appendLiteral("/Main.html?page=");
    101102        builder.appendNumber(it->key);
    102103        builder.appendLiteral("\" }");
     
    108109}
    109110
    110 String WebInspectorServer::inspectorServerFilesPath()
    111 {
    112     if (!m_inspectorServerFilesPath.isNull())
    113         return m_inspectorServerFilesPath;
    114 
    115     const char* environmentPath = g_getenv("WEBKIT_INSPECTOR_SERVER_PATH");
    116     if (environmentPath && g_file_test(environmentPath, G_FILE_TEST_IS_DIR))
    117         m_inspectorServerFilesPath = String(environmentPath);
    118     else
    119         m_inspectorServerFilesPath = String(WebCore::sharedResourcesPath().data()) + "/webinspector";
    120 
    121     return m_inspectorServerFilesPath;
    122 }
    123 
    124111}
    125112#endif
  • trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp

    r154828 r155714  
    4040#include "WebProcessProxy.h"
    4141#include "WebURLRequest.h"
     42#include <WebCore/SchemeRegistry.h>
    4243
    4344#if ENABLE(INSPECTOR_SERVER)
     
    314315}
    315316
     317static bool isMainInspectorPage(const WebInspectorProxy* webInspectorProxy, WKURLRequestRef requestRef)
     318{
     319    // Use KURL so we can compare just the paths.
     320    KURL inspectorURL(KURL(), webInspectorProxy->inspectorPageURL());
     321    KURL requestURL(KURL(), toImpl(requestRef)->url());
     322
     323    ASSERT(WebCore::SchemeRegistry::shouldTreatURLSchemeAsLocal(inspectorURL.protocol()));
     324
     325    return WebCore::SchemeRegistry::shouldTreatURLSchemeAsLocal(requestURL.protocol()) && decodeURLEscapeSequences(requestURL.path()) == decodeURLEscapeSequences(inspectorURL.path());
     326}
     327
    316328static void decidePolicyForNavigationAction(WKPageRef, WKFrameRef frameRef, WKFrameNavigationType, WKEventModifiers, WKEventMouseButton, WKURLRequestRef requestRef, WKFramePolicyListenerRef listenerRef, WKTypeRef, const void* clientInfo)
    317329{
     
    325337    ASSERT(webInspectorProxy);
    326338
    327     // Use KURL so we can compare just the fileSystemPaths.
    328     KURL inspectorURL(KURL(), webInspectorProxy->inspectorPageURL());
    329     KURL requestURL(KURL(), toImpl(requestRef)->url());
    330 
    331     ASSERT(inspectorURL.isLocalFile());
    332 
    333339    // Allow loading of the main inspector file.
    334     if (requestURL.isLocalFile() && requestURL.fileSystemPath() == inspectorURL.fileSystemPath()) {
     340    if (isMainInspectorPage(webInspectorProxy, requestRef)) {
    335341        toImpl(listenerRef)->use();
    336342        return;
  • trunk/Source/WebKit2/UIProcess/gtk/WebContextGtk.cpp

    r151429 r155714  
    3737#include <WebCore/FileSystem.h>
    3838#include <WebCore/NotImplemented.h>
     39#include <WebCore/SchemeRegistry.h>
    3940#include <wtf/gobject/GOwnPtr.h>
    4041#include <wtf/text/CString.h>
     
    8990    initInspectorServer();
    9091
     92    if (!parameters.urlSchemesRegisteredAsLocal.contains("resource")) {
     93        WebCore::SchemeRegistry::registerURLSchemeAsLocal("resource");
     94        parameters.urlSchemesRegisteredAsLocal.append("resource");
     95    }
     96
    9197    parameters.urlSchemesRegistered = supplement<WebSoupRequestManagerProxy>()->registeredURISchemes();
    9298    supplement<WebCookieManagerProxy>()->getCookiePersistentStorage(parameters.cookiePersistentStoragePath, parameters.cookiePersistentStorageType);
  • trunk/Source/WebKit2/UIProcess/gtk/WebInspectorProxyGtk.cpp

    r154828 r155714  
    4444namespace WebKit {
    4545
    46 static const char* inspectorFilesBasePath()
    47 {
    48     const gchar* environmentPath = g_getenv("WEBKIT_INSPECTOR_PATH");
    49     if (environmentPath && g_file_test(environmentPath, G_FILE_TEST_IS_DIR))
    50         return environmentPath;
    51 
    52     static const char* inspectorFilesPath = DATA_DIR G_DIR_SEPARATOR_S "webkitgtk-" WEBKITGTK_API_VERSION_STRING
    53         G_DIR_SEPARATOR_S "webinspector" G_DIR_SEPARATOR_S;
    54     return inspectorFilesPath;
    55 }
    56 
    5746static void inspectorViewDestroyed(GtkWidget*, gpointer userData)
    5847{
     
    161150String WebInspectorProxy::inspectorPageURL() const
    162151{
    163     GOwnPtr<gchar> filePath(g_build_filename(inspectorFilesBasePath(), "inspector.html", NULL));
    164     GOwnPtr<gchar> fileURI(g_filename_to_uri(filePath.get(), 0, 0));
    165     return WebCore::filenameToString(fileURI.get());
     152    return String("resource:///org/webkitgtk/inspector/UserInterface/Main.html");
    166153}
    167154
    168155String WebInspectorProxy::inspectorBaseURL() const
    169156{
    170     GOwnPtr<gchar> fileURI(g_filename_to_uri(inspectorFilesBasePath(), 0, 0));
    171     return WebCore::filenameToString(fileURI.get());
     157    return String("resource:///org/webkitgtk/inspector/UserInterface/");
    172158}
    173159
  • trunk/Source/WebKit2/WebProcess/WebPage/gtk/WebInspectorGtk.cpp

    r149923 r155714  
    4444String WebInspector::localizedStringsURL() const
    4545{
    46     GOwnPtr<gchar> filePath;
    47     const gchar* environmentPath = g_getenv("WEBKIT_INSPECTOR_PATH");
    48     if (environmentPath && g_file_test(environmentPath, G_FILE_TEST_IS_DIR))
    49         filePath.set(g_build_filename(environmentPath, "localizedStrings.js", NULL));
    50     else
    51         filePath.set(g_build_filename(WebCore::sharedResourcesPath().data(), "webinspector", "localizedStrings.js", NULL));
    52 
    53     GOwnPtr<gchar> fileURI(g_filename_to_uri(filePath.get(), 0, 0));
    54     return WebCore::filenameToString(fileURI.get());
     46    return String("resource:///org/webkitgtk/inspector/Localizations/en.lproj/localizedStrings.js");
    5547}
    5648
  • trunk/Tools/ChangeLog

    r155699 r155714  
     12013-09-13  Gustavo Noronha Silva  <gustavo.noronha@collabora.com>
     2
     3        [GTK] Move to the new web inspector
     4        https://bugs.webkit.org/show_bug.cgi?id=120647
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        * GtkLauncher/main.c:
     9        (main): no longer set WEBKIT_INSPECTOR_PATH.
     10        * MiniBrowser/gtk/main.c:
     11        (main): ditto.
     12        * Scripts/old-run-webkit-tests:
     13        (openDumpTool): ditto.
     14        * Scripts/run-gtk-tests: ditto.
     15        * Scripts/webkitpy/port/gtk.py:
     16        (GtkPort.setup_environ_for_server): ditto.
     17
    1182013-09-13  Allan Sandfeld Jensen  <allan.jensen@digia.com>
    219
  • trunk/Tools/GtkLauncher/main.c

    r149952 r155714  
    535535#endif
    536536
    537 #ifdef WEBKIT_EXEC_PATH
    538     g_setenv("WEBKIT_INSPECTOR_PATH", WEBKIT_EXEC_PATH "resources/inspector", FALSE);
    539 #endif /* WEBKIT_EXEC_PATH */
    540 
    541537    WebKitWebView *webView;
    542538    GtkWidget *main_window = createWindow(&webView);
  • trunk/Tools/MiniBrowser/gtk/main.c

    r154841 r155714  
    264264    g_option_context_free (context);
    265265
    266 #ifdef WEBKIT_EXEC_PATH
    267     g_setenv("WEBKIT_INSPECTOR_PATH", WEBKIT_EXEC_PATH "resources/inspector", FALSE);
    268 #endif /* WEBKIT_EXEC_PATH */
    269266    g_setenv("WEBKIT_INJECTED_BUNDLE_PATH", WEBKIT_INJECTED_BUNDLE_PATH, FALSE);
    270267
  • trunk/Tools/Scripts/old-run-webkit-tests

    r152852 r155714  
    15061506        $CLEAN_ENV{LIBOVERLAY_SCROLLBAR} = "0";
    15071507        $CLEAN_ENV{GTK_MODULES} = "gail";
    1508         $CLEAN_ENV{WEBKIT_INSPECTOR_PATH} = "$productDir/resources/inspector";
    15091508
    15101509        if ($useWebKitTestRunner) {
  • trunk/Tools/Scripts/run-gtk-tests

    r155606 r155714  
    189189    def _setup_testing_environment(self):
    190190        self._test_env = os.environ
    191         self._test_env["WEBKIT_INSPECTOR_PATH"] = os.path.abspath(os.path.join(self._programs_path, 'resources', 'inspector'))
    192191        self._test_env['GSETTINGS_BACKEND'] = 'memory'
    193192        self._test_env["TEST_WEBKIT_API_WEBKIT2_RESOURCES_PATH"] = common.top_level_path("Tools", "TestWebKitAPI", "Tests", "WebKit2")
  • trunk/Tools/Scripts/webkitpy/port/gtk.py

    r155614 r155714  
    9292        environment['TEST_RUNNER_INJECTED_BUNDLE_FILENAME'] = self._build_path('Libraries', 'libTestRunnerInjectedBundle.la')
    9393        environment['TEST_RUNNER_TEST_PLUGIN_PATH'] = self._build_path('TestNetscapePlugin', '.libs')
    94         environment['WEBKIT_INSPECTOR_PATH'] = self._build_path('Programs', 'resources', 'inspector')
    9594        environment['AUDIO_RESOURCES_PATH'] = self.path_from_webkit_base('Source', 'WebCore', 'platform', 'audio', 'resources')
    9695        self._copy_value_from_environ_if_set(environment, 'WEBKIT_OUTPUTDIR')
Note: See TracChangeset for help on using the changeset viewer.