+++ /dev/null
-<html>
-<head>
-<script>
- /* Helper functions */
- function print(message) {
- var paragraph = document.createElement("p");
- paragraph.appendChild(document.createTextNode(message));
- document.getElementById("console").appendChild(paragraph);
- }
-
- /* Evaluator -- use for evaluating an expression in a funny way */
- var Evaluator = new Object();
-
- Evaluator.evaluateAfterBackForwardNavigation = function(expression)
- {
- /* onload doesn't fire after a back/forward navigation, but timers get restored.
- * So, to execute a script after the back/forward navigation has completed,
- * we set a timer.
- */
- Evaluator.interval = window.setInterval("Evaluator.evaluate(" + expression + ")", 1000);
- window.location.href = "resources/go-back.html";
- }
-
- Evaluator.evaluate = function(expression)
- {
- window.clearInterval(Evaluator.interval);
- eval(expression);
- }
-
- /* Test */
-
- var Test = new Object();
-
- Test.didReceiveCallback = false;
-
- Test.callback = function()
- {
- Test.didReceiveCallback = true;
- print('callback received from plugin');
- }
-
- Test.continueAfterBackForwardNavigation = function()
- {
- print("----- AFTER back/forward navigation: -----");
-
- try {
- var plugin = document.embeds["testPlugin"];
- if (plugin.property)
- print("plugin.property is '" + plugin.property + "'");
-
- // Netscape plugins seem to be able to call window-level functions only
- window.callback = Test.callback;
- if (plugin.testCallback)
- plugin.testCallback("callback");
- delete window.callback;
-
- if (plugin.property && Test.didReceiveCallback)
- print ("PASS");
- else
- print("FAIL");
- }
- catch (e) {
- print("FAIL");
- }
-
- if (window.layoutTestController) {
- layoutTestController.notifyDone();
- }
- }
-
- Test.run = function()
- {
- if (window.layoutTestController) {
- layoutTestController.dumpAsText();
- layoutTestController.waitUntilDone();
- }
-
- Evaluator.evaluateAfterBackForwardNavigation('Test.continueAfterBackForwardNavigation()');
- }
-</script>
-</head>
-<body onload="Test.run()">
-<p>Bug: <a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=6318">REGRESSION: Repro crash in JS called from Flash on bdash.net.nz</a></p>
-<p>If this test passes, you will see a PASS messge below.</p>
-<hr>
-<embed name="testPlugin" width="0" height="0" src="" type="application/x-webkit-test-netscape"></embed>
-<div id="console"></div>
-</body>
-</html>
#import <WebKit/WebFrameView.h>
#import <WebKit/WebPreferences.h>
#import <WebKit/WebView.h>
-#import <WebKit/WebPluginDatabase.h>
#import <Carbon/Carbon.h> // for GetCurrentEventTime()
#import <ApplicationServices/ApplicationServices.h> // for CMSetDefaultProfileBySpace
localPasteboard = [NSPasteboard pasteboardWithUniqueName];
WebView *webView = [[WebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)];
- NSWindow *window = [[NSWindow alloc] initWithContentRect:NSZeroRect
- styleMask:NSBorderlessWindowMask
- backing:NSBackingStoreNonretained
- defer:YES];
- [window setContentView:webView];
-
- NSString *pwd = [[NSString stringWithCString:argv[0]] stringByDeletingLastPathComponent];
- [WebPluginDatabase setAdditionalWebPlugInPaths:[NSArray arrayWithObject:pwd]];
- [[WebPluginDatabase installedPlugins] refresh];
-
WaitUntilDoneDelegate *delegate = [[WaitUntilDoneDelegate alloc] init];
EditingDelegate *editingDelegate = [[EditingDelegate alloc] init];
[webView setFrameLoadDelegate:delegate];
[webView setUIDelegate:nil];
[webView release];
- [window release];
[delegate release];
[editingDelegate release];