Bug 133324

Summary: Need an API test for bug #133193 (r169315)
Product: WebKit Reporter: Jon Honeycutt <jhoneycutt>
Component: Tools / TestsAssignee: Jon Honeycutt <jhoneycutt>
Status: RESOLVED FIXED    
Severity: Normal CC: aestes, ap, beidson, ddkilzer, sam
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch aestes: review+

Description Jon Honeycutt 2014-05-27 14:16:46 PDT
Need an API test for bug #133193 (r169315).
Comment 1 Jon Honeycutt 2014-05-27 15:17:23 PDT
Created attachment 232151 [details]
Patch
Comment 2 Andy Estes 2014-05-28 08:04:33 PDT
Comment on attachment 232151 [details]
Patch

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

r=me, but the StopLoadingDuringDidFailProvisionalLoadTestDone message seems superfluous.

> Tools/TestWebKitAPI/Tests/WebKit2/StopLoadingDuringDidFailProvisionalLoad.cpp:41
> +static void didReceiveMessageFromInjectedBundle(WKContextRef context, WKStringRef messageName, WKTypeRef messageBody, const void* clientInfo)
> +{
> +    if (WKStringIsEqualToUTF8CString(messageName, "StopLoadingDuringDidFailProvisionalLoadTestDone"))
> +        receivedMessageFromBundle = true;
> +}

I'm not sure I understand the purpose of the StopLoadingDuringDidFailProvisionalLoadTestDone message.

> Tools/TestWebKitAPI/Tests/WebKit2/StopLoadingDuringDidFailProvisionalLoad.cpp:48
> +    injectedBundleClient.base.version = 0;

You already memset the entire struct to 0.

> Tools/TestWebKitAPI/Tests/WebKit2/StopLoadingDuringDidFailProvisionalLoad.cpp:57
> +    ASSERT(receivedMessageFromBundle);

You should use EXPECT_TRUE() instead.

> Tools/TestWebKitAPI/Tests/WebKit2/StopLoadingDuringDidFailProvisionalLoad.cpp:70
> +    loaderClient.base.version = 0;

You already memset the entire struct to 0.
Comment 3 Jon Honeycutt 2014-05-28 10:46:58 PDT
(In reply to comment #2)
> (From update of attachment 232151 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=232151&action=review
> 
> r=me, but the StopLoadingDuringDidFailProvisionalLoadTestDone message seems superfluous.
> 
> > Tools/TestWebKitAPI/Tests/WebKit2/StopLoadingDuringDidFailProvisionalLoad.cpp:41
> > +static void didReceiveMessageFromInjectedBundle(WKContextRef context, WKStringRef messageName, WKTypeRef messageBody, const void* clientInfo)
> > +{
> > +    if (WKStringIsEqualToUTF8CString(messageName, "StopLoadingDuringDidFailProvisionalLoadTestDone"))
> > +        receivedMessageFromBundle = true;
> > +}
> 
> I'm not sure I understand the purpose of the StopLoadingDuringDidFailProvisionalLoadTestDone message.


It's there to ensure that the injected bundle loaded and that it called 'stop loading' during the 'did fail provisional load' callback before the UI process received notice of the failed load.

> 
> > Tools/TestWebKitAPI/Tests/WebKit2/StopLoadingDuringDidFailProvisionalLoad.cpp:48
> > +    injectedBundleClient.base.version = 0;
> 
> You already memset the entire struct to 0.

Fixed.

> 
> > Tools/TestWebKitAPI/Tests/WebKit2/StopLoadingDuringDidFailProvisionalLoad.cpp:57
> > +    ASSERT(receivedMessageFromBundle);
> 
> You should use EXPECT_TRUE() instead.

Fixed.

> 
> > Tools/TestWebKitAPI/Tests/WebKit2/StopLoadingDuringDidFailProvisionalLoad.cpp:70
> > +    loaderClient.base.version = 0;
> 
> You already memset the entire struct to 0.

Fixed.
Comment 4 Jon Honeycutt 2014-05-28 12:21:51 PDT
Committed r169429: <http://trac.webkit.org/changeset/169429>