#import "PixelDumpSupport.h"
#import "PolicyDelegate.h"
#import "ResourceLoadDelegate.h"
+#import "StorageTrackerDelegate.h"
#import "UIDelegate.h"
#import "WebArchiveDumpSupport.h"
#import "WorkQueue.h"
#import <WebKit/WebPreferencesPrivate.h>
#import <WebKit/WebPreferenceKeysPrivate.h>
#import <WebKit/WebResourceLoadDelegate.h>
+#import <WebKit/WebStorageManagerPrivate.h>
#import <WebKit/WebTypesInternal.h>
#import <WebKit/WebViewPrivate.h>
#import <getopt.h>
static ResourceLoadDelegate *resourceLoadDelegate;
static HistoryDelegate *historyDelegate;
PolicyDelegate *policyDelegate;
+StorageTrackerDelegate *storageDelegate;
static int dumpPixels;
static int threaded;
[WebView registerURLSchemeAsLocal:@"feedsearch"];
[webView setContinuousSpellCheckingEnabled:YES];
+ [webView setGrammarCheckingEnabled:YES];
+ [webView setInteractiveFormValidationEnabled:YES];
+ [webView setValidationMessageTimerMagnification:-1];
// To make things like certain NSViews, dragging, and plug-ins work, put the WebView a window, but put it off-screen so you don't see it.
// Put it at -10000, -10000 in "flipped coordinates", since WebCore and the DOM use flipped coordinates.
NSString *path = libraryPathForDumpRenderTree();
[defaults setObject:[path stringByAppendingPathComponent:@"Databases"] forKey:WebDatabaseDirectoryDefaultsKey];
+ [defaults setObject:[path stringByAppendingPathComponent:@"LocalStorage"] forKey:WebStorageDirectoryDefaultsKey];
[defaults setObject:[path stringByAppendingPathComponent:@"LocalCache"] forKey:WebKitLocalCacheDefaultsKey];
WebPreferences *preferences = [WebPreferences standardPreferences];
[preferences setOfflineWebApplicationCacheEnabled:YES];
[preferences setDeveloperExtrasEnabled:NO];
[preferences setLoadsImagesAutomatically:YES];
+ [preferences setLoadsSiteIconsIgnoringImageLoadingPreference:NO];
[preferences setFrameFlatteningEnabled:NO];
[preferences setSpatialNavigationEnabled:NO];
[preferences setEditingBehavior:WebKitEditingMacBehavior];
// So, turn it off for now, but we might want to turn it back on some day.
[preferences setUsesPageCache:NO];
[preferences setAcceleratedCompositingEnabled:YES];
+#if USE(CA) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+ [preferences setCanvasUsesAcceleratedDrawing:YES];
+ [preferences setAcceleratedDrawingEnabled:NO];
+#endif
[preferences setWebGLEnabled:NO];
[preferences setUsePreHTML5ParserQuirks:NO];
[preferences setAsynchronousSpellCheckingEnabled:NO];
resourceLoadDelegate = [[ResourceLoadDelegate alloc] init];
policyDelegate = [[PolicyDelegate alloc] init];
historyDelegate = [[HistoryDelegate alloc] init];
+ storageDelegate = [[StorageTrackerDelegate alloc] init];
}
// ObjC++ doens't seem to let me pass NSObject*& sadly.
releaseAndZero(&resourceLoadDelegate);
releaseAndZero(&uiDelegate);
releaseAndZero(&policyDelegate);
+ releaseAndZero(&storageDelegate);
}
static void initializeGlobalsFromCommandLineOptions(int argc, const char *argv[])
return [[item1 target] caseInsensitiveCompare:[item2 target]];
}
+static NSData *dumpAudio()
+{
+ const char *encodedAudioData = gLayoutTestController->encodedAudioData().c_str();
+
+ NSData *data = [NSData dataWithBytes:encodedAudioData length:gLayoutTestController->encodedAudioData().length()];
+ return data;
+}
+
static void dumpHistoryItem(WebHistoryItem *item, int indent, BOOL current)
{
int start = 0;
gLayoutTestController->setDumpAsText(true);
gLayoutTestController->setGeneratePixelResults(false);
}
- if (gLayoutTestController->dumpAsText()) {
+ if (gLayoutTestController->dumpAsAudio()) {
+ resultData = dumpAudio();
+ resultMimeType = @"audio/wav";
+ } else if (gLayoutTestController->dumpAsText()) {
resultString = dumpFramesAsText(mainFrame);
} else if (gLayoutTestController->dumpAsPDF()) {
resultData = dumpFrameAsPDF(mainFrame);
printf("Content-Type: %s\n", [resultMimeType UTF8String]);
+ if (gLayoutTestController->dumpAsAudio())
+ printf("Content-Transfer-Encoding: base64\n");
+
if (resultData) {
fwrite([resultData bytes], 1, [resultData length], stdout);
[(EditingDelegate *)[webView editingDelegate] setAcceptsEditing:YES];
[webView makeTextStandardSize:nil];
[webView resetPageZoom:nil];
+ [webView _scaleWebView:1.0 atOrigin:NSZeroPoint];
[webView setTabKeyCyclesThroughElements:YES];
[webView setPolicyDelegate:nil];
[policyDelegate setPermissive:NO];