Changeset 204188 in webkit
- Timestamp:
- Aug 5, 2016 1:19:51 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r204135 r204188 1 2016-08-05 Dan Bernstein <mitz@apple.com> 2 3 [Cocoa] WKRemoteObjectCoder doesn’t handle NSRange 4 https://bugs.webkit.org/show_bug.cgi?id=160589 5 6 Reviewed by Tim Horton. 7 8 * Shared/API/Cocoa/WKRemoteObjectCoder.mm: 9 (encodeInvocationArguments): Encode NSRange by wrapping in an NSValue. 10 (decodeInvocationArguments): Decode wrapped NSRange. 11 1 12 2016-08-04 Chris Dumez <cdumez@apple.com> 2 13 -
trunk/Source/WebKit2/Shared/API/Cocoa/WKRemoteObjectCoder.mm
r202242 r204188 206 206 } 207 207 208 // struct 209 case '{': 210 if (!strcmp(type, @encode(NSRange))) { 211 NSRange value; 212 [invocation getArgument:&value atIndex:i]; 213 214 encodeToObjectStream(encoder, [NSValue valueWithRange:value]); 215 break; 216 } 217 FALLTHROUGH; 218 208 219 default: 209 220 [NSException raise:NSInvalidArgumentException format:@"Unsupported invocation argument type '%s'", type]; … … 538 549 break; 539 550 } 551 552 // struct 553 case '{': 554 if (!strcmp(type, @encode(NSRange))) { 555 NSRange value = [decodeObjectFromObjectStream(decoder, { [NSValue class] }) rangeValue]; 556 [invocation setArgument:&value atIndex:i]; 557 break; 558 } 559 FALLTHROUGH; 540 560 541 561 default: -
trunk/Tools/ChangeLog
r204183 r204188 1 2016-08-05 Dan Bernstein <mitz@apple.com> 2 3 [Cocoa] WKRemoteObjectCoder doesn’t handle NSRange 4 https://bugs.webkit.org/show_bug.cgi?id=160589 5 6 Reviewed by Tim Horton. 7 8 * TestWebKitAPI/Tests/WebKit2Cocoa/RemoteObjectRegistry.h: 9 (remoteObjectInterface): Fixed a mistake in the set of allowed classes in one of the reply 10 blocks, which wasn’t caught because the test wasn’t run correctly. 11 * TestWebKitAPI/Tests/WebKit2Cocoa/RemoteObjectRegistry.mm: 12 (TEST): Fixed the -selectionAndClickInformationForClickAtPoint:completionHandler: test, and 13 added a test that sends over an NSRange. 14 * TestWebKitAPI/Tests/WebKit2Cocoa/RemoteObjectRegistryPlugIn.mm: 15 (-[RemoteObjectRegistryPlugIn takeRange:completionHandler:]): Added. Calls the completion 16 handler with the range‘s location and length. 17 1 18 2016-08-05 Enrica Casucci <enrica@apple.com> 2 19 -
trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/RemoteObjectRegistry.h
r192319 r204188 35 35 - (void)sayHello:(NSString *)hello completionHandler:(void (^)(NSString *))completionHandler; 36 36 - (void)selectionAndClickInformationForClickAtPoint:(NSValue *)pointValue completionHandler:(void (^)(NSDictionary *))completionHandler; 37 - (void)takeRange:(NSRange)range completionHandler:(void (^)(NSUInteger location, NSUInteger length))completionHandler; 37 38 38 39 @end … … 42 43 _WKRemoteObjectInterface *interface = [_WKRemoteObjectInterface remoteObjectInterfaceWithProtocol:@protocol(RemoteObjectProtocol)]; 43 44 44 [interface setClasses:[NSSet setWithObjects:[NSDictionary class], [NS URL class], nil] forSelector:@selector(selectionAndClickInformationForClickAtPoint:completionHandler:) argumentIndex:0 ofReply:YES];45 [interface setClasses:[NSSet setWithObjects:[NSDictionary class], [NSString class], [NSURL class], nil] forSelector:@selector(selectionAndClickInformationForClickAtPoint:completionHandler:) argumentIndex:0 ofReply:YES]; 45 46 46 47 return interface; -
trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/RemoteObjectRegistry.mm
r192319 r204188 67 67 isDone = true; 68 68 }]; 69 TestWebKitAPI::Util::run(&isDone); 69 70 70 71 isDone = false; 71 72 [object selectionAndClickInformationForClickAtPoint:[NSValue valueWithPoint:NSMakePoint(12, 34)] completionHandler:^(NSDictionary *result) { 73 EXPECT_TRUE([result isEqual:@{ @"URL": [NSURL URLWithString:@"http://www.webkit.org/"] }]); 74 isDone = true; 75 }]; 76 TestWebKitAPI::Util::run(&isDone); 77 78 isDone = false; 79 [object takeRange:NSMakeRange(345, 123) completionHandler:^(NSUInteger location, NSUInteger length) { 80 EXPECT_EQ(345U, location); 81 EXPECT_EQ(123U, length); 72 82 isDone = true; 73 83 }]; -
trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/RemoteObjectRegistryPlugIn.mm
r192319 r204188 77 77 } 78 78 79 - (void)takeRange:(NSRange)range completionHandler:(void (^)(NSUInteger location, NSUInteger length))completionHandler 80 { 81 completionHandler(range.location, range.length); 82 } 83 79 84 @end 80 85
Note: See TracChangeset
for help on using the changeset viewer.