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  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: http://svn.webkit.org/repository/webkit/trunk@82848 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 7d66a478
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.
......@@ -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
......
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.
......
......@@ -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;
......
......@@ -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;
......
......@@ -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);
......
......@@ -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);
......
......@@ -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();
......
......@@ -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);
......
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.
......
......@@ -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();
......
......@@ -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();
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment