Bug 137527

Summary: [iOS] LayoutTestRelay should detect EOF and properly signal underlying DRT/WKTR
Product: WebKit Reporter: David Farler <dfarler>
Component: Tools / TestsAssignee: David Farler <dfarler>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, dbates, ddkilzer, simon.fraser
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: iPhone / iPad   
OS: All   
Attachments:
Description Flags
Patch simon.fraser: review+

Description David Farler 2014-10-08 10:43:11 PDT
If the LayoutTestRelay receives an EOF from the test harness, it should do the following:

- make sure that it gets properly forwarded to DRT/WKTR. The only question is - does DRT/WKTR as an iOS app "exit 0" when it receives the EOF and exits the "test server loop"?
- exit 0
Comment 1 David Farler 2014-10-10 14:41:38 PDT
Created attachment 239650 [details]
Patch
Comment 2 WebKit Commit Bot 2014-10-10 14:43:34 PDT
Attachment 239650 [details] did not pass style-queue:


ERROR: Tools/LayoutTestRelay/LayoutTestRelay/LTRelayController.m:72:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Tools/LayoutTestRelay/LayoutTestRelay/LTRelayController.m:72:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 2 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 David Farler 2014-10-10 14:47:27 PDT
(In reply to comment #2)
> Attachment 239650 [details] did not pass style-queue:
> 
> 
> ERROR: Tools/LayoutTestRelay/LayoutTestRelay/LTRelayController.m:72:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
> ERROR: Tools/LayoutTestRelay/LayoutTestRelay/LTRelayController.m:72:  Extra space before ( in function call  [whitespace/parens] [4]
> Total errors found: 2 in 2 files
> 
> 
> If any of these errors are false positives, please file a bug against check-webkit-style.

Already filed a bug for this (Objective-C exceptions treated like functions). Thanks anyway, style bot.
Comment 4 Simon Fraser (smfr) 2014-10-10 14:57:02 PDT
Comment on attachment 239650 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=239650&action=review

> Tools/LayoutTestRelay/LayoutTestRelay/LTRelayController.m:71
> +                    NSData *data = [NSData dataWithBytes:buffer length:len];
> +                    [[[self relay] outputStream] write:[data bytes] maxLength:[data length]];

Why make an NSData just to hand off the bytes directly?
Comment 5 David Farler 2014-10-10 15:06:00 PDT
(In reply to comment #4)
> (From update of attachment 239650 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=239650&action=review
> 
> > Tools/LayoutTestRelay/LayoutTestRelay/LTRelayController.m:71
> > +                    NSData *data = [NSData dataWithBytes:buffer length:len];
> > +                    [[[self relay] outputStream] write:[data bytes] maxLength:[data length]];
> 
> Why make an NSData just to hand off the bytes directly?

Oh. For some reason I just had it in my mind that I needed to do that from a different API a long time ago. I'll forward the bytes on directly. I'll have another patch in just a minute.
Comment 6 David Farler 2014-10-10 17:03:40 PDT
Committed r174626: <http://trac.webkit.org/changeset/174626>