Bug 133324 - Need an API test for bug #133193 (r169315)
Summary: Need an API test for bug #133193 (r169315)
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jon Honeycutt
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-27 14:16 PDT by Jon Honeycutt
Modified: 2014-05-28 12:21 PDT (History)
5 users (show)

See Also:


Attachments
Patch (14.85 KB, patch)
2014-05-27 15:17 PDT, Jon Honeycutt
aestes: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>