Reviewed by ggaren.
authorggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Aug 2006 18:48:52 +0000 (18:48 +0000)
committerggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Aug 2006 18:48:52 +0000 (18:48 +0000)
        - Verification of exceptions thrown in a plugin.  Test for bug 10114.
        * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
        * DumpRenderTree/ObjCPlugin.m:
        (+[ObjCPlugin isSelectorExcludedFromWebScript:]):
        (+[ObjCPlugin webScriptNameForSelector:]):
        (-[ObjCPlugin throwIfArgumentIsNotHello:]):

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

WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj
WebKitTools/DumpRenderTree/ObjCPlugin.m

index 1ae53444cc15cb192811b53adcd217a30ca51b17..6d582e1470a17cc74594f92870ed416e58239bac 100644 (file)
@@ -1,3 +1,14 @@
+2006-08-29  waylonis  <waylonis@google.com>
+
+        Reviewed by ggaren.
+
+        - Verification of exceptions thrown in a plugin.  Test for bug 10114.
+        * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
+        * DumpRenderTree/ObjCPlugin.m:
+        (+[ObjCPlugin isSelectorExcludedFromWebScript:]):
+        (+[ObjCPlugin webScriptNameForSelector:]):
+        (-[ObjCPlugin throwIfArgumentIsNotHello:]):
+
 2006-08-30  Nikolas Zimmermann  <zimmermann@kde.org>
 
         Reviewed by Tim H.
 2006-08-30  Nikolas Zimmermann  <zimmermann@kde.org>
 
         Reviewed by Tim H.
index 44a37356c5fd00e7eaeb8ed3cf6099bcc7e8e3d2..cce13b69e99ca3ee063250b07b80a706151d29fe 100644 (file)
                22181BD009DC8C4B008342E8 /* ObjCPluginFunction.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = ObjCPluginFunction.m; sourceTree = "<group>"; };
                32A70AAB03705E1F00C91783 /* DumpRenderTreePrefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DumpRenderTreePrefix.h; sourceTree = "<group>"; };
                9335435F03D75502008635CE /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = WebKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
                22181BD009DC8C4B008342E8 /* ObjCPluginFunction.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = ObjCPluginFunction.m; sourceTree = "<group>"; };
                32A70AAB03705E1F00C91783 /* DumpRenderTreePrefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DumpRenderTreePrefix.h; sourceTree = "<group>"; };
                9335435F03D75502008635CE /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = WebKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
-               9340995408540CAF007F3BC8 /* DumpRenderTree */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = DumpRenderTree; sourceTree = BUILT_PRODUCTS_DIR; };
+               9340995408540CAF007F3BC8 /* DumpRenderTree */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = DumpRenderTree; sourceTree = BUILT_PRODUCTS_DIR; };
                93442CF408F8BA4900BFE8CA /* TextInputController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextInputController.h; sourceTree = "<group>"; };
                93442CF508F8BA4900BFE8CA /* TextInputController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TextInputController.m; sourceTree = "<group>"; };
                A803FCB709CAAAB0009B2A37 /* EventSendingController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = EventSendingController.h; sourceTree = "<group>"; };
                93442CF408F8BA4900BFE8CA /* TextInputController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextInputController.h; sourceTree = "<group>"; };
                93442CF508F8BA4900BFE8CA /* TextInputController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TextInputController.m; sourceTree = "<group>"; };
                A803FCB709CAAAB0009B2A37 /* EventSendingController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = EventSendingController.h; sourceTree = "<group>"; };
index a68aa7ef248591bc8f6b0f021bedb9da748ce747..0f66aaaeca14a64dbd09cab85446f85e1674e4d8 100644 (file)
@@ -26,6 +26,7 @@
 
 #import "ObjCPlugin.h"
 #import <objc/objc-runtime.h>
 
 #import "ObjCPlugin.h"
 #import <objc/objc-runtime.h>
+#import <WebKit/WebKit.h>
 
 
 // === NSObject category to expose almost everything to JavaScript ===
 
 
 // === NSObject category to expose almost everything to JavaScript ===
@@ -139,6 +140,9 @@ static BOOL _allowsScriptsFullAccess = NO;
     if (aSelector == @selector(echo:))
         return NO;
 
     if (aSelector == @selector(echo:))
         return NO;
 
+    if (aSelector == @selector(throwIfArgumentIsNotHello:))
+      return NO;
+
     return YES;
 }
 
     return YES;
 }
 
@@ -146,7 +150,10 @@ static BOOL _allowsScriptsFullAccess = NO;
 {
     if (aSelector == @selector(echo:))
         return @"echo";
 {
     if (aSelector == @selector(echo:))
         return @"echo";
-  
+
+    if (aSelector == @selector(throwIfArgumentIsNotHello:))
+      return @"throwIfArgumentIsNotHello";
+
     return nil;
 }
 
     return nil;
 }
 
@@ -166,4 +173,10 @@ static BOOL _allowsScriptsFullAccess = NO;
     return obj;
 }
 
     return obj;
 }
 
+- (void)throwIfArgumentIsNotHello:(NSString *)str 
+{
+    if (![str isEqualToString:@"Hello"]) 
+        [WebScriptObject throwException:[NSString stringWithFormat:@"%@ != Hello", str]];
+}
+
 @end
 @end