Bug 31509

Summary: [Qt] Implement error pages handling support to DRT.
Product: WebKit Reporter: Antonio Gomes <tonikitoo>
Component: Tools / TestsAssignee: Antonio Gomes <tonikitoo>
Status: RESOLVED FIXED    
Severity: Normal Keywords: Qt
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Bug Depends on:    
Bug Blocks: 30573    
Attachments:
Description Flags
(landed in r51037) patch 0.1 none

Description Antonio Gomes 2009-11-14 15:06:03 PST
It turns out that none of the current DRT implementations (mac, win, gtk and qt) support "error pages" when an unsuccessful load happens. IMO, such feature could make DRTs to act more like a real browser, and then is a good thing to have, and give tests more accurate.

I got dumbs-up on IRC for moving forward on that implementation (see below), and I am making it for the QT DRT in advance.

(...)
<tonikitoo> (well, darin showed no objection based on the lack of a better suggestion for my problem)
<tonikitoo> my plan:
<tonikitoo> 1) make sure my FrameLoader patch does not break current gtk, mac and win tests.
<tonikitoo> 2) put my specific test in other DRT Skipped list for now (mac, gtk and win).
<tonikitoo> 3) and file follow up bugs to these ports to implement support for error pages in their DRT's
<tonikitoo> ap,aroben: what do you think ?
<aroben> tonikitoo: that sounds pretty good to me
<ap> tonikitoo: you don't have access to Mac or Windows, do you? it would be nice to implement this for at least one platform where Safari works
<ap> tonikitoo: otherwise, sounds good
(...)

<ap> tonikitoo: I'm not sure why you want this to be configurable. isn't it always good for DRT to show error pages?
<ap> tonikitoo: making DRT behave more like a real browser is certainly good
(...)



patch coming ...
Comment 1 Antonio Gomes 2009-11-14 15:11:15 PST
Created attachment 43231 [details]
(landed in r51037) patch 0.1

patch implements error page handling support to Qt's DRT, when an unsuccessful load happends.

feature is OFF by default (so same behavior as current in all DRT), but can be enabled by called

'layoutTestController.handleErrorPages();'

from layout test JS sourcecode.

please comments are welcome about namings here
Comment 2 Kenneth Rohde Christiansen 2009-11-15 07:25:34 PST
Comment on attachment 43231 [details]
(landed in r51037) patch 0.1


> +    QWebPage::ErrorPageExtensionReturn* errorPage = static_cast<QWebPage::ErrorPageExtensionReturn*>(output);
> +
> +    errorPage->content = QString("data:text/html,<body/>").toUtf8();

Wouldn't it make sense to actually print the error code?
Comment 3 Antonio Gomes 2009-11-15 09:08:48 PST
(In reply to comment #2)
> (From update of attachment 43231 [details])
> 
> > +    QWebPage::ErrorPageExtensionReturn* errorPage = static_cast<QWebPage::ErrorPageExtensionReturn*>(output);
> > +
> > +    errorPage->content = QString("data:text/html,<body/>").toUtf8();
> 
> Wouldn't it make sense to actually print the error code?

I think we could although error codes can be platform dependent too. we can improve it later, also.

thx kenneth.
Comment 4 Antonio Gomes 2009-11-16 07:44:33 PST
r51037
Comment 5 Antonio Gomes 2009-11-16 08:17:32 PST
> <tonikitoo> 3) and file follow up bugs to these ports to implement support for
> error pages in their DRT's
> <tonikitoo> ap,aroben: what do you think ?
> <aroben> tonikitoo: that sounds pretty good to me
> (...)

FYI, filed follow up bugs for win, gtk and mac's implementations of error pages support into their DRTs:

* MAC -> https://bugs.webkit.org/show_bug.cgi?id=31555
* GTK -> https://bugs.webkit.org/show_bug.cgi?id=31556
* WIN -> https://bugs.webkit.org/show_bug.cgi?id=31557