2011-02-07 Maciej Stachowiak <mjs@apple.com>
authormjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 7 Feb 2011 09:47:00 +0000 (09:47 +0000)
committermjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 7 Feb 2011 09:47:00 +0000 (09:47 +0000)
        Reviewed by Antti Koivisto.

        WebKitTestRunner does not block remote resources or complain about them
        https://bugs.webkit.org/show_bug.cgi?id=42139
        <rdar://problem/8183942>

        * Configurations/WebCore.xcconfig: Allow WebKitTestRunner to link
        WebCore.
        * WebCore.exp.in: Export a handful of KURL symbols.
2011-02-07  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Antti Koivisto.

        WebKitTestRunner does not block remote resources or complain about them
        https://bugs.webkit.org/show_bug.cgi?id=42139
        <rdar://problem/8183942>

        * platform/mac-wk2/Skipped: Unskip formerly skipped tests.
2011-02-07  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Antti Koivisto.

        WebKitTestRunner does not block remote resources or complain about them
        https://bugs.webkit.org/show_bug.cgi?id=42139
        <rdar://problem/8183942>

        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
        (WTR::InjectedBundlePage::willSendRequestForFrame): Implement the required
        checks (using KURL, to avoid need to invent a whole URL API).
        * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj: Link WebCore
        directly to get at KURL symbols.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77794 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/mac-wk2/Skipped
Source/WebCore/ChangeLog
Source/WebCore/Configurations/WebCore.xcconfig
Source/WebCore/WebCore.exp.in
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj

index f1389a504a99d84fecfce062fe67dfa17b5c69cb..0662a1692eab6acee1daf16c13df9df21f046429 100644 (file)
@@ -1,3 +1,13 @@
+2011-02-07  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Antti Koivisto.
+
+        WebKitTestRunner does not block remote resources or complain about them
+        https://bugs.webkit.org/show_bug.cgi?id=42139
+        <rdar://problem/8183942>
+
+        * platform/mac-wk2/Skipped: Unskip formerly skipped tests.
+
 2011-02-06  MORITA Hajime  <morrita@google.com>
 
         Unreviewed, unskip the html5lib test again which fails for another reason. (See Bug 53030)
index ac2281d0dc8c377c8965a2284620c66de3b37f04..9aba090c743c12142534735e8ced128b849373eb 100644 (file)
 accessibility
 platform/mac/accessibility
 
-# WebKitTestRunner does not block remote resources or complain about them
-# <https://bugs.webkit.org/show_bug.cgi?id=42139>
-fast/loader/null-request-after-willSendRequest.html
-
 # Some compositing tests flakey
 # <https://bugs.webkit.org/show_bug.cgi?id=48354>
 compositing/iframes/iframe-size-from-zero.html
@@ -219,7 +215,6 @@ fast/blockflow/vertical-lr-replaced-selection.html
 fast/blockflow/vertical-rl-replaced-selection.html
 fast/css-generated-content/drag-state.html
 fast/css-generated-content/hover-style-change.html
-fast/css-generated-content/malformed-url.html
 fast/css-generated-content/positioned-background-hit-test-crash.html
 fast/css-generated-content/spellingToolTip-assert.html
 fast/css/affected-by-hover-after-style-change.html
index c0180507bf3639b5d979f6a27573f054f23284e3..bf26c1ac89e501513fd7d4242d7f7f0b52c51461 100644 (file)
@@ -1,3 +1,15 @@
+2011-02-07  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Antti Koivisto.
+
+        WebKitTestRunner does not block remote resources or complain about them
+        https://bugs.webkit.org/show_bug.cgi?id=42139
+        <rdar://problem/8183942>
+
+        * Configurations/WebCore.xcconfig: Allow WebKitTestRunner to link
+        WebCore.
+        * WebCore.exp.in: Export a handful of KURL symbols.
+
 2011-02-06  Ryosuke Niwa  <rniwa@webkit.org>
 
         Reviewed by Darin Adler.
index ac21049d7bb8253b39166efcad26846077d46c02..f164902f1f6122cc8e907c104542cfc29856f359 100644 (file)
@@ -63,7 +63,7 @@ PRODUCTION_FRAMEWORKS_DIR_iphonesimulator = $(PRODUCTION_FRAMEWORKS_DIR_iphoneos
 PRODUCTION_FRAMEWORKS_DIR_macosx = $(NEXT_ROOT)$(SYSTEM_LIBRARY_DIR)/Frameworks;
 
 WEBKIT2_LDFLAGS = $(WEBKIT2_LDFLAGS_$(TARGET_MAC_OS_X_VERSION_MAJOR));
-WEBKIT2_LDFLAGS_1060 = -allowable_client WebKit2;
+WEBKIT2_LDFLAGS_1060 = -allowable_client WebKit2 -allowable_client WebKitTestRunner -allowable_client WebKitTestRunnerInjectedBundle;
 WEBKIT2_LDFLAGS_1070 = $(WEBKIT2_LDFLAGS_1060);
 
 JAVASCRIPTCORE_PRIVATE_HEADERS_DIR = $(JAVASCRIPTCORE_PRIVATE_HEADERS_DIR_$(CONFIGURATION));
index 0a5c08fa5dcc15e3b1feacc8ee6b7e1ac6379152..14a5d1d0e6180c965dcf61cdfc9320c10f355234 100644 (file)
@@ -623,6 +623,7 @@ __ZN7WebCore4FontaSERKS0_
 __ZN7WebCore4Icon18createIconForFilesERKN3WTF6VectorINS1_6StringELm0EEE
 __ZN7WebCore4IconD1Ev
 __ZN7WebCore4KURL10invalidateEv
+__ZN7WebCore4KURLC1ENS_18ParsedURLStringTagEPKc
 __ZN7WebCore4KURLC1ENS_18ParsedURLStringTagERKN3WTF6StringE
 __ZN7WebCore4KURLC1EP5NSURL
 __ZN7WebCore4KURLC1EPK7__CFURL
@@ -1131,6 +1132,7 @@ __ZNK7WebCore4KURL14fileSystemPathEv
 __ZNK7WebCore4KURL17lastPathComponentEv
 __ZNK7WebCore4KURL4hostEv
 __ZNK7WebCore4KURL4pathEv
+__ZNK7WebCore4KURL8protocolEv
 __ZNK7WebCore4KURLcvP5NSURLEv
 __ZNK7WebCore4Node14isDescendantOfEPKS0_
 __ZNK7WebCore4Node18getSubresourceURLsERN3WTF11ListHashSetINS_4KURLELm256ENS_8KURLHashEEE
index 387c520aba19f2465392b5b6d5a7e4ad9f56308e..53370acf86e4e20f3c9d642be19d258dcfb7518a 100644 (file)
@@ -1,3 +1,17 @@
+2011-02-07  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Antti Koivisto.
+
+        WebKitTestRunner does not block remote resources or complain about them
+        https://bugs.webkit.org/show_bug.cgi?id=42139
+        <rdar://problem/8183942>
+
+        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+        (WTR::InjectedBundlePage::willSendRequestForFrame): Implement the required
+        checks (using KURL, to avoid need to invent a whole URL API).
+        * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj: Link WebCore
+        directly to get at KURL symbols.
+
 2011-02-06  Maciej Stachowiak  <mjs@apple.com>
 
         Reviewed by Daniel Bates.
index 9ae659a8efb796661b753da1211a155d96f936eb..ba1dbca0dce4b173829a478c915b1db89bdbb0bf 100644 (file)
@@ -29,6 +29,7 @@
 #include "StringFunctions.h"
 #include <cmath>
 #include <JavaScriptCore/JSRetainPtr.h>
+#include <WebCore/KURL.h>
 #include <WebKit2/WKArray.h>
 #include <WebKit2/WKBundle.h>
 #include <WebKit2/WKBundleBackForwardList.h>
@@ -36,6 +37,7 @@
 #include <WebKit2/WKBundleFrame.h>
 #include <WebKit2/WKBundleFramePrivate.h>
 #include <WebKit2/WKBundlePagePrivate.h>
+#include <WebKit2/WKURLRequest.h>
 
 using namespace std;
 
@@ -579,6 +581,19 @@ WKURLRequestRef InjectedBundlePage::willSendRequestForFrame(WKBundlePageRef, WKB
     if (InjectedBundle::shared().isTestRunning() && InjectedBundle::shared().layoutTestController()->willSendRequestReturnsNull())
         return 0;
 
+    string urlString = toSTD(adoptWK(WKURLCopyString(adoptWK(WKURLRequestCopyURL(request)).get())));
+    WebCore::KURL url(WebCore::ParsedURLString, urlString.c_str());
+
+    if (!url.host().isEmpty()
+        && (equalIgnoringCase(url.protocol(), "http") || (equalIgnoringCase(url.protocol(), "https")))
+        && (url.host() != "127.0.0.1")
+        && (url.host() != "255.255.255.255") // used in some tests that expect to get back an error
+        && (!equalIgnoringCase(url.host(), "localhost"))) {
+        InjectedBundle::shared().os() << "Blocked access to external URL " << urlString << "\n";
+        return 0;
+    }
+
+
     return request;
 }
 
index a15fe417c6a3de3fbddc8f42e64a3c61a53b3b17..adb1c1fb35aa511c51ef92a4f7f58925f5bb38f9 100644 (file)
@@ -32,6 +32,8 @@
                6510A78A11EC643800410867 /* WebKitWeightWatcher700.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 6510A77F11EC643800410867 /* WebKitWeightWatcher700.ttf */; };
                6510A78B11EC643800410867 /* WebKitWeightWatcher800.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 6510A78011EC643800410867 /* WebKitWeightWatcher800.ttf */; };
                6510A78C11EC643800410867 /* WebKitWeightWatcher900.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 6510A78111EC643800410867 /* WebKitWeightWatcher900.ttf */; };
+               65DD1D9612FFE798004B5285 /* WebCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65DD1D9512FFE798004B5285 /* WebCore.framework */; };
+               65DE432512FFE84000171BCA /* WebCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65DD1D9512FFE798004B5285 /* WebCore.framework */; };
                65EB85A011EC67CC0034D300 /* ActivateFonts.mm in Sources */ = {isa = PBXBuildFile; fileRef = 65EB859F11EC67CC0034D300 /* ActivateFonts.mm */; };
                BC14E4DB120E02D000826C0C /* GCController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC14E4D9120E02D000826C0C /* GCController.cpp */; };
                BC14E4EA120E03D800826C0C /* JSGCController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC14E4E8120E03D800826C0C /* JSGCController.cpp */; };
@@ -86,6 +88,7 @@
                6510A77F11EC643800410867 /* WebKitWeightWatcher700.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher700.ttf; path = fonts/WebKitWeightWatcher700.ttf; sourceTree = "<group>"; };
                6510A78011EC643800410867 /* WebKitWeightWatcher800.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher800.ttf; path = fonts/WebKitWeightWatcher800.ttf; sourceTree = "<group>"; };
                6510A78111EC643800410867 /* WebKitWeightWatcher900.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher900.ttf; path = fonts/WebKitWeightWatcher900.ttf; sourceTree = "<group>"; };
+               65DD1D9512FFE798004B5285 /* WebCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = WebCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
                65EB859D11EC67CC0034D300 /* ActivateFonts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ActivateFonts.h; sourceTree = "<group>"; };
                65EB859F11EC67CC0034D300 /* ActivateFonts.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ActivateFonts.mm; sourceTree = "<group>"; };
                8DD76FA10486AA7600D96B5E /* WebKitTestRunner */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = WebKitTestRunner; sourceTree = BUILT_PRODUCTS_DIR; };
                                BC7934A511906584005EA8E2 /* Cocoa.framework in Frameworks */,
                                BC7934AC1190658C005EA8E2 /* WebKit2.framework in Frameworks */,
                                BCDA2B9A1191051F00C3BC47 /* JavaScriptCore.framework in Frameworks */,
+                               65DD1D9612FFE798004B5285 /* WebCore.framework in Frameworks */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                BC25193E11D15D8B002EBC01 /* Cocoa.framework in Frameworks */,
                                BC25193F11D15D8B002EBC01 /* WebKit2.framework in Frameworks */,
                                BC25194011D15D8B002EBC01 /* JavaScriptCore.framework in Frameworks */,
+                               65DE432512FFE84000171BCA /* WebCore.framework in Frameworks */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                BC7934A411906584005EA8E2 /* Cocoa.framework */,
                                BC7934AB1190658C005EA8E2 /* WebKit2.framework */,
                                BCDA2B991191051F00C3BC47 /* JavaScriptCore.framework */,
+                               65DD1D9512FFE798004B5285 /* WebCore.framework */,
                        );
                        name = "External Frameworks and Libraries";
                        sourceTree = "<group>";
                        isa = XCBuildConfiguration;
                        baseConfigurationReference = BC251A1811D16795002EBC01 /* WebKitTestRunner.xcconfig */;
                        buildSettings = {
+                               FRAMEWORK_SEARCH_PATHS = (
+                                       "$(inherited)",
+                                       "\"$(SRCROOT)/../../../../../symroots/Release\"",
+                               );
                        };
                        name = Debug;
                };
                        isa = XCBuildConfiguration;
                        baseConfigurationReference = BC251A1811D16795002EBC01 /* WebKitTestRunner.xcconfig */;
                        buildSettings = {
+                               FRAMEWORK_SEARCH_PATHS = (
+                                       "$(inherited)",
+                                       "\"$(SRCROOT)/../../../../../symroots/Release\"",
+                               );
                        };
                        name = Release;
                };