Bug 72031 - [Qt] Skip tests when no network is present
Summary: [Qt] Skip tests when no network is present
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Qt (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P3 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-10 08:53 PST by Bruno Abinader (history only)
Modified: 2012-02-10 06:16 PST (History)
2 users (show)

See Also:


Attachments
Proposed patch (verifies for network connection - if not, skip the test). (4.24 KB, patch)
2011-11-10 08:56 PST, Bruno Abinader (history only)
webkit-ews: commit-queue-
Details | Formatted Diff | Diff
Updated patch with fixes mentioned by build bot. (4.20 KB, patch)
2011-11-10 09:09 PST, Bruno Abinader (history only)
no flags Details | Formatted Diff | Diff
Updated patch with missing m_manager class member. (4.31 KB, patch)
2011-11-10 09:11 PST, Bruno Abinader (history only)
webkit-ews: commit-queue-
Details | Formatted Diff | Diff
Updated patch which fixes method signature typo. (4.31 KB, patch)
2011-11-10 09:30 PST, Bruno Abinader (history only)
hausmann: review-
hausmann: commit-queue-
Details | Formatted Diff | Diff
Updated patch with memory allocation changes reviewed by Simon. (3.36 KB, patch)
2011-11-11 01:10 PST, Bruno Abinader (history only)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bruno Abinader (history only) 2011-11-10 08:53:13 PST
Some benchmark tests requires network connection (they fetch data from external URL's) and so they fail if no network is present. These tests should be skipped instead.

These are the tests that are currently failing when no network is present:

- tst_Loading::load
- tst_Painting::paint
Comment 1 Bruno Abinader (history only) 2011-11-10 08:56:30 PST
Created attachment 114512 [details]
Proposed patch (verifies for network connection - if not, skip the test).

Proposed patch that verifies if a network connection is present, otherwise skip the tests.
Comment 2 WebKit Review Bot 2011-11-10 08:58:39 PST
Attachment 114512 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebKit/qt/ChangeLog', u'Source/WebK..." exit_code: 1

Source/WebKit/qt/tests/benchmarks/painting/tst_painting.cpp:22:  Alphabetical sorting problem.  [build/include_order] [4]
Source/WebKit/qt/tests/benchmarks/painting/tst_painting.cpp:112:  One line control clauses should not use braces.  [whitespace/braces] [4]
Source/WebKit/qt/tests/benchmarks/loading/tst_loading.cpp:22:  Alphabetical sorting problem.  [build/include_order] [4]
Source/WebKit/qt/tests/benchmarks/loading/tst_loading.cpp:113:  One line control clauses should not use braces.  [whitespace/braces] [4]
Total errors found: 4 in 3 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Early Warning System Bot 2011-11-10 09:08:59 PST
Comment on attachment 114512 [details]
Proposed patch (verifies for network connection - if not, skip the test).

Attachment 114512 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/10394359
Comment 4 Bruno Abinader (history only) 2011-11-10 09:09:14 PST
Created attachment 114516 [details]
Updated patch with fixes mentioned by build bot.

Fixed issues found by style check.
Comment 5 Bruno Abinader (history only) 2011-11-10 09:11:59 PST
Created attachment 114517 [details]
Updated patch with missing m_manager class member.

Added missing m_manager class member (oops!).
Comment 6 Early Warning System Bot 2011-11-10 09:28:26 PST
Comment on attachment 114517 [details]
Updated patch with missing m_manager class member.

Attachment 114517 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/10395359
Comment 7 Bruno Abinader (history only) 2011-11-10 09:30:52 PST
Created attachment 114520 [details]
Updated patch which fixes method signature typo.

Fixed method signature typo (oops!).
Comment 8 Simon Hausmann 2011-11-10 13:56:31 PST
Comment on attachment 114520 [details]
Updated patch which fixes method signature typo.

I think your patch looks good in general, but I also think that you can simplify it: Just allocate a QNetworkConfigurationManager instance directly as member variable. Then you don't need to allocate it on the heap and you don't need to deal with it in initTestCase().

QNetworkConfigurationManager itself is a pretty lightweight class that just forwards signals for the actual private singleton. There's no need to allocate it on the heap :)
Comment 9 Bruno Abinader (history only) 2011-11-11 01:10:59 PST
Created attachment 114644 [details]
Updated patch with memory allocation changes reviewed by Simon.

Good point Simon, I always tend to allocate objects on the heap while doing unit tests so I can delete them on a specific moment if needed. But in this case, as you said, it is not needed at all.
Comment 10 Simon Hausmann 2011-11-11 03:35:33 PST
Comment on attachment 114644 [details]
Updated patch with memory allocation changes reviewed by Simon.

r=me
Comment 11 WebKit Review Bot 2011-11-11 17:38:20 PST
Comment on attachment 114644 [details]
Updated patch with memory allocation changes reviewed by Simon.

Clearing flags on attachment: 114644

Committed r100053: <http://trac.webkit.org/changeset/100053>
Comment 12 WebKit Review Bot 2011-11-11 17:38:24 PST
All reviewed patches have been landed.  Closing bug.