2011-04-04 Chang Shu <cshu@webkit.org>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Apr 2011 18:29:22 +0000 (18:29 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Apr 2011 18:29:22 +0000 (18:29 +0000)
        Reviewed by Darin Adler.

        WebKitTestRunner needs layoutTestController.setAllowFileAccessFromFileURLs
        https://bugs.webkit.org/show_bug.cgi?id=57572

        Unskip passed tests.

        * platform/mac-wk2/Skipped:
2011-04-04  Chang Shu  <cshu@webkit.org>

        Reviewed by Darin Adler.

        WebKitTestRunner needs layoutTestController.setAllowFileAccessFromFileURLs
        https://bugs.webkit.org/show_bug.cgi?id=57572

        * Shared/WebPreferencesStore.cpp:
        (WebKit::WebPreferencesStore::decode):
        (WebKit::WebPreferencesStore::overrideAllowFileAccessFromFileURLsForTestRunner):
        * Shared/WebPreferencesStore.h:
        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
        (WKBundleSetAllowFileAccessFromFileURLs):
        * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::setAllowFileAccessFromFileURLs):
        * WebProcess/InjectedBundle/InjectedBundle.h:
2011-04-04  Chang Shu  <cshu@webkit.org>

        Reviewed by Darin Adler.

        WebKitTestRunner needs layoutTestController.setAllowFileAccessFromFileURLs
        https://bugs.webkit.org/show_bug.cgi?id=57572

        * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
        * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
        (WTR::LayoutTestController::setAllowFileAccessFromFileURLs):
        * WebKitTestRunner/InjectedBundle/LayoutTestController.h:

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

13 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac-wk2/Skipped
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebPreferencesStore.cpp
Source/WebKit2/Shared/WebPreferencesStore.h
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl
Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h

index cbd5113..741d41a 100644 (file)
@@ -1,3 +1,14 @@
+2011-04-04  Chang Shu  <cshu@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        WebKitTestRunner needs layoutTestController.setAllowFileAccessFromFileURLs
+        https://bugs.webkit.org/show_bug.cgi?id=57572
+
+        Unskip passed tests.
+
+        * platform/mac-wk2/Skipped:
+
 2011-04-04  Pavel Feldman  <pfeldman@google.com>
 
         Reviewed by Yury Semikhatsky.
index b4269c2..07d81fd 100644 (file)
@@ -1439,13 +1439,6 @@ editing/style/iframe-onload-crash-win.html
 # <https://bugs.webkit.org/show_bug.cgi?id=42691>
 fast/loader/stop-provisional-loads.html
 
-# WebKitTestRunner needs layoutTestController.setAllowFileAccessFromFileURLs
-# <https://bugs.webkit.org/show_bug.cgi?id=57572>
-fast/frames/location-change-no-file-access.html
-fast/xmlhttprequest/xmlhttprequest-no-file-access.html
-
-fast/xmlhttprequest/xmlhttprequest-nonexistent-file.html
-
 # WebKitTestRunner needs layoutTestController.setPrinting
 # <https://bugs.webkit.org/show_bug.cgi?id=42693>
 printing/compositing-layer-printing.html
@@ -1945,6 +1938,8 @@ fast/overflow/overflow_hidden.html
 fast/workers/storage/interrupt-database-sync.html
 fast/workers/storage/interrupt-database.html
 fast/workers/storage/use-same-database-in-page-and-workers.html
+fast/xmlhttprequest/xmlhttprequest-no-file-access.html
+fast/xmlhttprequest/xmlhttprequest-nonexistent-file.html
 http/tests/appcache/different-https-origin-resource-main.html
 http/tests/appcache/fallback.html
 http/tests/cache/subresource-expiration-1.html
index 0447fca..98fd0da 100644 (file)
@@ -1,3 +1,21 @@
+2011-04-04  Chang Shu  <cshu@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        WebKitTestRunner needs layoutTestController.setAllowFileAccessFromFileURLs
+        https://bugs.webkit.org/show_bug.cgi?id=57572
+
+        * Shared/WebPreferencesStore.cpp:
+        (WebKit::WebPreferencesStore::decode):
+        (WebKit::WebPreferencesStore::overrideAllowFileAccessFromFileURLsForTestRunner):
+        * Shared/WebPreferencesStore.h:
+        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
+        (WKBundleSetAllowFileAccessFromFileURLs):
+        * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        (WebKit::InjectedBundle::setAllowFileAccessFromFileURLs):
+        * WebProcess/InjectedBundle/InjectedBundle.h:
+
 2011-04-04  Brady Eidson  <beidson@apple.com>
 
         Reviewed by Darin Adler.
index c072740..d012551 100644 (file)
@@ -51,6 +51,8 @@ static bool hasXSSAuditorEnabledTestRunnerOverride;
 static bool xssAuditorEnabledTestRunnerOverride;
 static bool hasAllowUniversalAccessFromFileURLsTestRunnerOverride;
 static bool allowUniversalAccessFromFileURLsTestRunnerOverride;
+static bool hasAllowFileAccessFromFileURLsTestRunnerOverride;
+static bool allowFileAccessFromFileURLsTestRunnerOverride;
 
 WebPreferencesStore::WebPreferencesStore()
 {
@@ -72,6 +74,9 @@ bool WebPreferencesStore::decode(CoreIPC::ArgumentDecoder* decoder, WebPreferenc
     if (hasAllowUniversalAccessFromFileURLsTestRunnerOverride)
         s.m_boolValues.set(WebPreferencesKey::allowUniversalAccessFromFileURLsKey(), allowUniversalAccessFromFileURLsTestRunnerOverride);
 
+    if (hasAllowFileAccessFromFileURLsTestRunnerOverride)
+        s.m_boolValues.set(WebPreferencesKey::allowFileAccessFromFileURLsKey(), allowFileAccessFromFileURLsTestRunnerOverride);
+
     return true;
 }
 
@@ -87,6 +92,12 @@ void WebPreferencesStore::overrideAllowUniversalAccessFromFileURLsForTestRunner(
     allowUniversalAccessFromFileURLsTestRunnerOverride = enabled;
 }
 
+void WebPreferencesStore::overrideAllowFileAccessFromFileURLsForTestRunner(bool enabled)
+{
+    hasAllowFileAccessFromFileURLsTestRunnerOverride = true;
+    allowFileAccessFromFileURLsTestRunnerOverride = enabled;
+}
+
 void WebPreferencesStore::removeTestRunnerOverrides()
 {
     hasXSSAuditorEnabledTestRunnerOverride = false;
index 43ef487..89ff1ab 100644 (file)
@@ -169,6 +169,7 @@ struct WebPreferencesStore {
 
     static void overrideXSSAuditorEnabledForTestRunner(bool);
     static void overrideAllowUniversalAccessFromFileURLsForTestRunner(bool);
+    static void overrideAllowFileAccessFromFileURLsForTestRunner(bool);
     static void removeTestRunnerOverrides();
 
     HashMap<String, String> m_stringValues;
index 1a84bc4..adfe603 100644 (file)
@@ -133,6 +133,11 @@ void WKBundleOverrideAllowUniversalAccessFromFileURLsForTestRunner(WKBundleRef b
     toImpl(bundleRef)->overrideAllowUniversalAccessFromFileURLsForTestRunner(toImpl(pageGroupRef), enabled);
 }
 
+void WKBundleSetAllowFileAccessFromFileURLs(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, bool enabled)
+{
+    toImpl(bundleRef)->setAllowFileAccessFromFileURLs(toImpl(pageGroupRef), enabled);
+}
+
 void WKBundleReportException(JSContextRef context, JSValueRef exception)
 {
     InjectedBundle::reportException(context, exception);
index 39ff2e2..2e4c0cc 100644 (file)
@@ -66,6 +66,7 @@ WK_EXPORT void WKBundleRemoveAllUserContent(WKBundleRef bundle, WKBundlePageGrou
 // Will make WebProcess ignore this preference until a preferences change notification, only for WebKitTestRunner use.
 WK_EXPORT void WKBundleOverrideXSSAuditorEnabledForTestRunner(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
 WK_EXPORT void WKBundleOverrideAllowUniversalAccessFromFileURLsForTestRunner(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
+WK_EXPORT void WKBundleSetAllowFileAccessFromFileURLs(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
 WK_EXPORT void WKBundleClearAllDatabases(WKBundleRef bundle);
 WK_EXPORT void WKBundleSetDatabaseQuota(WKBundleRef bundle, uint64_t);
 
index ee07065..a361eb2 100644 (file)
@@ -120,6 +120,17 @@ void InjectedBundle::overrideAllowUniversalAccessFromFileURLsForTestRunner(WebPa
         (*iter)->settings()->setAllowUniversalAccessFromFileURLs(enabled);
 }
 
+void InjectedBundle::setAllowFileAccessFromFileURLs(WebPageGroupProxy* pageGroup, bool enabled)
+{
+    // Override the preference for all future pages.
+    WebPreferencesStore::overrideAllowFileAccessFromFileURLsForTestRunner(enabled);
+
+    // Change the setting for existing ones.
+    const HashSet<Page*>& pages = PageGroup::pageGroup(pageGroup->identifier())->pages();
+    for (HashSet<Page*>::iterator iter = pages.begin(); iter != pages.end(); ++iter)
+        (*iter)->settings()->setAllowFileAccessFromFileURLs(enabled);
+}
+
 void InjectedBundle::clearAllDatabases()
 {
     WebDatabaseManager::shared().deleteAllDatabases();
index 0a6df60..6265ce8 100644 (file)
@@ -91,6 +91,7 @@ public:
     void activateMacFontAscentHack();
     void overrideXSSAuditorEnabledForTestRunner(WebPageGroupProxy* pageGroup, bool enabled);
     void overrideAllowUniversalAccessFromFileURLsForTestRunner(WebPageGroupProxy*, bool);
+    void setAllowFileAccessFromFileURLs(WebPageGroupProxy*, bool);
 
     // UserContent API
     void addUserScript(WebPageGroupProxy*, InjectedBundleScriptWorld*, const String& source, const String& url, ImmutableArray* whitelist, ImmutableArray* blacklist, WebCore::UserScriptInjectionTime, WebCore::UserContentInjectedFrames);
index 4f22371..7b8a2c2 100644 (file)
@@ -1,3 +1,15 @@
+2011-04-04  Chang Shu  <cshu@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        WebKitTestRunner needs layoutTestController.setAllowFileAccessFromFileURLs
+        https://bugs.webkit.org/show_bug.cgi?id=57572
+
+        * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
+        * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+        (WTR::LayoutTestController::setAllowFileAccessFromFileURLs):
+        * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
+
 2011-04-04  Keith Kyzivat  <keith.kyzivat@nokia.com>
 
         Reviewed by Csaba Osztrogon√°c.
index 1c02254..cc442d7 100644 (file)
@@ -47,6 +47,7 @@ module WTR {
         void setCloseRemainingWindowsWhenComplete(in boolean value);
         void setXSSAuditorEnabled(in boolean value);
         void setAllowUniversalAccessFromFileURLs(in boolean value);
+        void setAllowFileAccessFromFileURLs(in boolean value);
 
         // Special DOM functions.
         void clearBackForwardList();
index 9dcd798..5774878 100644 (file)
@@ -318,6 +318,11 @@ void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled)
     WKBundleOverrideAllowUniversalAccessFromFileURLsForTestRunner(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled);
 }
 
+void LayoutTestController::setAllowFileAccessFromFileURLs(bool enabled)
+{
+    WKBundleSetAllowFileAccessFromFileURLs(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled);
+}
+
 unsigned LayoutTestController::windowCount()
 {
     return InjectedBundle::shared().pageCount();
index d491f2c..1b25d21 100644 (file)
@@ -75,6 +75,7 @@ public:
     void setCloseRemainingWindowsWhenComplete(bool value) { m_shouldCloseExtraWindows = value; }
     void setXSSAuditorEnabled(bool);
     void setAllowUniversalAccessFromFileURLs(bool);
+    void setAllowFileAccessFromFileURLs(bool);
 
     // Special DOM functions.
     JSValueRef computedStyleIncludingVisitedInfo(JSValueRef element);