Bug 27512 - Test for QWebFrame::hasSetFocus() is trying to use a not defined resource.
Summary: Test for QWebFrame::hasSetFocus() is trying to use a not defined resource.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Qt (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-21 13:18 PDT by Andre Pedralho
Modified: 2009-07-28 06:04 PDT (History)
2 users (show)

See Also:


Attachments
Copied resources from qwebpage tests and added the references to the qwebframe.qrc. (2.31 KB, patch)
2009-07-21 13:38 PDT, Andre Pedralho
manyoso: review-
Details | Formatted Diff | Diff
Using setHtml methods to define the test web page instead of external resources. (2.70 KB, patch)
2009-07-24 07:48 PDT, Andre Pedralho
no flags Details | Formatted Diff | Diff
Using QSignalSpy to control whether a load finished signal has been emited instead of just wait for some miliseconds. (2.42 KB, patch)
2009-07-27 11:39 PDT, Andre Pedralho
hausmann: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andre Pedralho 2009-07-21 13:18:27 PDT
There is no frametest folder and qwebframe.qrc does not specify where to find it.

tst_qwebframe.cpp:
void tst_QWebFrame::hasSetFocus()
{
(...)
   QUrl url = QUrl("qrc:///frametest/iframe.html");
   _page->mainFrame()->load(url);
(...)
}

qwebframe.qrc:
<!DOCTYPE RCC><RCC version="1.0">
<qresource prefix="/">
<file>image.png</file>
<file>style.css</file>
</qresource>
</RCC>
Comment 1 Andre Pedralho 2009-07-21 13:38:14 PDT
Created attachment 33207 [details]
Copied resources from qwebpage tests and added the references to the qwebframe.qrc.
Comment 2 Antonio Gomes 2009-07-21 13:51:37 PDT
we are duping the resources used in qwebframe and qwebpage. should not we make them to share the resource ?
Comment 3 Adam Treat 2009-07-22 06:35:39 PDT
Comment on attachment 33207 [details]
Copied resources from qwebpage tests and added the references to the qwebframe.qrc.

As tonikitoo pointed out, we shouldn't dupe the resources, but rather share them.
Comment 4 Andre Pedralho 2009-07-22 11:06:42 PDT
(In reply to comment #3)
> (From update of attachment 33207 [details])
> As tonikitoo pointed out, we shouldn't dupe the resources, but rather share
> them.

Agree with that, however "the listed resource files must be located in the same directory as the .qrc file, or one of its subdirectories" according to the Qt  resources docs.

As there are two different directories to QWebFrame and to QWebPage tests the only way to share the resources would be to have a pool of resources in WebKit/qt/tests/'resources'/ with the qrc files related to both tests.

I mean:

ls WebKit/qt/tests/:
benchmarks  qwebelement  qwebframe (...) qwebpage  qwebview  RESOURCES tests.pro

ls WebKit/qt/tests/resources:
FRAMETEST image.png qwebframe.qrc style.css tst_qwebpage.qrc

IMHO, the best solution here is to create separated resources to each tests, maybe duplicating it.
Comment 5 Andre Pedralho 2009-07-23 06:06:21 PDT
Hausmann, we need your opinion to find the best solution here. Can you help us?
Comment 6 Simon Hausmann 2009-07-23 13:26:01 PDT
Hmmm, another option, potentially simpler, would be to replace the use of the resources for html with data urls. What do you think?
Comment 7 Antonio Gomes 2009-07-23 13:30:47 PDT
simon, he has done so for this renderContents removal patch (not uploaded yet) ... and it looks pretty nice. and it would work here too, imho

ps: we should "invalid" this one instead of mark as "fixed" ?
Comment 8 Andre Pedralho 2009-07-24 07:46:45 PDT
Reopening as the bug itself still there and might be fixed with the solution proposed in comment #6.
Comment 9 Andre Pedralho 2009-07-24 07:48:24 PDT
Created attachment 33445 [details]
Using setHtml methods to define the test web page instead of external resources.
Comment 10 Andre Pedralho 2009-07-27 11:39:18 PDT
Created attachment 33560 [details]
Using QSignalSpy to control whether a load finished signal has been emited instead of just wait for some miliseconds.

Marking old patch obsolete as per suggestions in IRC.
Comment 11 Simon Hausmann 2009-07-28 06:01:54 PDT
Comment on attachment 33560 [details]
Using QSignalSpy to control whether a load finished signal has been emited instead of just wait for some miliseconds.

r=me. Thanks
Comment 12 Simon Hausmann 2009-07-28 06:04:51 PDT
Landed in r46475