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: svn://svn.chromium.org/blink/trunk@82848 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent d5eb8fd9
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> 2011-04-04 Pavel Feldman <pfeldman@google.com>
Reviewed by Yury Semikhatsky. Reviewed by Yury Semikhatsky.
...@@ -1439,13 +1439,6 @@ editing/style/iframe-onload-crash-win.html ...@@ -1439,13 +1439,6 @@ editing/style/iframe-onload-crash-win.html
# <https://bugs.webkit.org/show_bug.cgi?id=42691> # <https://bugs.webkit.org/show_bug.cgi?id=42691>
fast/loader/stop-provisional-loads.html 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 # WebKitTestRunner needs layoutTestController.setPrinting
# <https://bugs.webkit.org/show_bug.cgi?id=42693> # <https://bugs.webkit.org/show_bug.cgi?id=42693>
printing/compositing-layer-printing.html printing/compositing-layer-printing.html
...@@ -1945,6 +1938,8 @@ fast/overflow/overflow_hidden.html ...@@ -1945,6 +1938,8 @@ fast/overflow/overflow_hidden.html
fast/workers/storage/interrupt-database-sync.html fast/workers/storage/interrupt-database-sync.html
fast/workers/storage/interrupt-database.html fast/workers/storage/interrupt-database.html
fast/workers/storage/use-same-database-in-page-and-workers.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/different-https-origin-resource-main.html
http/tests/appcache/fallback.html http/tests/appcache/fallback.html
http/tests/cache/subresource-expiration-1.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> 2011-04-04 Brady Eidson <beidson@apple.com>
Reviewed by Darin Adler. Reviewed by Darin Adler.
......
...@@ -51,6 +51,8 @@ static bool hasXSSAuditorEnabledTestRunnerOverride; ...@@ -51,6 +51,8 @@ static bool hasXSSAuditorEnabledTestRunnerOverride;
static bool xssAuditorEnabledTestRunnerOverride; static bool xssAuditorEnabledTestRunnerOverride;
static bool hasAllowUniversalAccessFromFileURLsTestRunnerOverride; static bool hasAllowUniversalAccessFromFileURLsTestRunnerOverride;
static bool allowUniversalAccessFromFileURLsTestRunnerOverride; static bool allowUniversalAccessFromFileURLsTestRunnerOverride;
static bool hasAllowFileAccessFromFileURLsTestRunnerOverride;
static bool allowFileAccessFromFileURLsTestRunnerOverride;
WebPreferencesStore::WebPreferencesStore() WebPreferencesStore::WebPreferencesStore()
{ {
...@@ -72,6 +74,9 @@ bool WebPreferencesStore::decode(CoreIPC::ArgumentDecoder* decoder, WebPreferenc ...@@ -72,6 +74,9 @@ bool WebPreferencesStore::decode(CoreIPC::ArgumentDecoder* decoder, WebPreferenc
if (hasAllowUniversalAccessFromFileURLsTestRunnerOverride) if (hasAllowUniversalAccessFromFileURLsTestRunnerOverride)
s.m_boolValues.set(WebPreferencesKey::allowUniversalAccessFromFileURLsKey(), allowUniversalAccessFromFileURLsTestRunnerOverride); s.m_boolValues.set(WebPreferencesKey::allowUniversalAccessFromFileURLsKey(), allowUniversalAccessFromFileURLsTestRunnerOverride);
if (hasAllowFileAccessFromFileURLsTestRunnerOverride)
s.m_boolValues.set(WebPreferencesKey::allowFileAccessFromFileURLsKey(), allowFileAccessFromFileURLsTestRunnerOverride);
return true; return true;
} }
...@@ -87,6 +92,12 @@ void WebPreferencesStore::overrideAllowUniversalAccessFromFileURLsForTestRunner( ...@@ -87,6 +92,12 @@ void WebPreferencesStore::overrideAllowUniversalAccessFromFileURLsForTestRunner(
allowUniversalAccessFromFileURLsTestRunnerOverride = enabled; allowUniversalAccessFromFileURLsTestRunnerOverride = enabled;
} }
void WebPreferencesStore::overrideAllowFileAccessFromFileURLsForTestRunner(bool enabled)
{
hasAllowFileAccessFromFileURLsTestRunnerOverride = true;
allowFileAccessFromFileURLsTestRunnerOverride = enabled;
}
void WebPreferencesStore::removeTestRunnerOverrides() void WebPreferencesStore::removeTestRunnerOverrides()
{ {
hasXSSAuditorEnabledTestRunnerOverride = false; hasXSSAuditorEnabledTestRunnerOverride = false;
......
...@@ -169,6 +169,7 @@ struct WebPreferencesStore { ...@@ -169,6 +169,7 @@ struct WebPreferencesStore {
static void overrideXSSAuditorEnabledForTestRunner(bool); static void overrideXSSAuditorEnabledForTestRunner(bool);
static void overrideAllowUniversalAccessFromFileURLsForTestRunner(bool); static void overrideAllowUniversalAccessFromFileURLsForTestRunner(bool);
static void overrideAllowFileAccessFromFileURLsForTestRunner(bool);
static void removeTestRunnerOverrides(); static void removeTestRunnerOverrides();
HashMap<String, String> m_stringValues; HashMap<String, String> m_stringValues;
......
...@@ -133,6 +133,11 @@ void WKBundleOverrideAllowUniversalAccessFromFileURLsForTestRunner(WKBundleRef b ...@@ -133,6 +133,11 @@ void WKBundleOverrideAllowUniversalAccessFromFileURLsForTestRunner(WKBundleRef b
toImpl(bundleRef)->overrideAllowUniversalAccessFromFileURLsForTestRunner(toImpl(pageGroupRef), enabled); 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) void WKBundleReportException(JSContextRef context, JSValueRef exception)
{ {
InjectedBundle::reportException(context, exception); InjectedBundle::reportException(context, exception);
......
...@@ -66,6 +66,7 @@ WK_EXPORT void WKBundleRemoveAllUserContent(WKBundleRef bundle, WKBundlePageGrou ...@@ -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. // 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 WKBundleOverrideXSSAuditorEnabledForTestRunner(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
WK_EXPORT void WKBundleOverrideAllowUniversalAccessFromFileURLsForTestRunner(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 WKBundleClearAllDatabases(WKBundleRef bundle);
WK_EXPORT void WKBundleSetDatabaseQuota(WKBundleRef bundle, uint64_t); WK_EXPORT void WKBundleSetDatabaseQuota(WKBundleRef bundle, uint64_t);
......
...@@ -120,6 +120,17 @@ void InjectedBundle::overrideAllowUniversalAccessFromFileURLsForTestRunner(WebPa ...@@ -120,6 +120,17 @@ void InjectedBundle::overrideAllowUniversalAccessFromFileURLsForTestRunner(WebPa
(*iter)->settings()->setAllowUniversalAccessFromFileURLs(enabled); (*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() void InjectedBundle::clearAllDatabases()
{ {
WebDatabaseManager::shared().deleteAllDatabases(); WebDatabaseManager::shared().deleteAllDatabases();
......
...@@ -91,6 +91,7 @@ public: ...@@ -91,6 +91,7 @@ public:
void activateMacFontAscentHack(); void activateMacFontAscentHack();
void overrideXSSAuditorEnabledForTestRunner(WebPageGroupProxy* pageGroup, bool enabled); void overrideXSSAuditorEnabledForTestRunner(WebPageGroupProxy* pageGroup, bool enabled);
void overrideAllowUniversalAccessFromFileURLsForTestRunner(WebPageGroupProxy*, bool); void overrideAllowUniversalAccessFromFileURLsForTestRunner(WebPageGroupProxy*, bool);
void setAllowFileAccessFromFileURLs(WebPageGroupProxy*, bool);
// UserContent API // UserContent API
void addUserScript(WebPageGroupProxy*, InjectedBundleScriptWorld*, const String& source, const String& url, ImmutableArray* whitelist, ImmutableArray* blacklist, WebCore::UserScriptInjectionTime, WebCore::UserContentInjectedFrames); 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> 2011-04-04 Keith Kyzivat <keith.kyzivat@nokia.com>
Reviewed by Csaba Osztrogonác. Reviewed by Csaba Osztrogonác.
......
...@@ -47,6 +47,7 @@ module WTR { ...@@ -47,6 +47,7 @@ module WTR {
void setCloseRemainingWindowsWhenComplete(in boolean value); void setCloseRemainingWindowsWhenComplete(in boolean value);
void setXSSAuditorEnabled(in boolean value); void setXSSAuditorEnabled(in boolean value);
void setAllowUniversalAccessFromFileURLs(in boolean value); void setAllowUniversalAccessFromFileURLs(in boolean value);
void setAllowFileAccessFromFileURLs(in boolean value);
// Special DOM functions. // Special DOM functions.
void clearBackForwardList(); void clearBackForwardList();
......
...@@ -318,6 +318,11 @@ void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled) ...@@ -318,6 +318,11 @@ void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled)
WKBundleOverrideAllowUniversalAccessFromFileURLsForTestRunner(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), 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() unsigned LayoutTestController::windowCount()
{ {
return InjectedBundle::shared().pageCount(); return InjectedBundle::shared().pageCount();
......
...@@ -75,6 +75,7 @@ public: ...@@ -75,6 +75,7 @@ public:
void setCloseRemainingWindowsWhenComplete(bool value) { m_shouldCloseExtraWindows = value; } void setCloseRemainingWindowsWhenComplete(bool value) { m_shouldCloseExtraWindows = value; }
void setXSSAuditorEnabled(bool); void setXSSAuditorEnabled(bool);
void setAllowUniversalAccessFromFileURLs(bool); void setAllowUniversalAccessFromFileURLs(bool);
void setAllowFileAccessFromFileURLs(bool);
// Special DOM functions. // Special DOM functions.
JSValueRef computedStyleIncludingVisitedInfo(JSValueRef element); 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