autopilot sees two instances of QQuickWindow

Bug #1248620 reported by Olivier Tilloy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Autopilot Qt Support
New
Low
Unassigned
webbrowser-app (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Around the same time as the transition to autopilot 1.4, a test in webbrowser-app’s test suite started failing reliably on otto (and sometimes on mako too).

See https://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/466/testReport/junit/webbrowser_app.tests.test_title/TestWindowTitle/test_window_title/ for the failure log.

The problem is that the test does this:

    window = self.app.select_single("QQuickWindow")

and this raised the following exception:

    ValueError: More than one item was returned for query

It appears autopilot is seeing two instances of QQuickWindow (as evidenced by replacing select_single by select_many and printing out the output). The first one is the actual application’s window. The second one is not visible, its dimensions are 0×0, it has no children, but its parent is the same as the real window (the webbrowser-app object).

I have never been able to reproduce the error locally, so I have no clue where this window comes from, but this looks to me like a bug in autopilot-qt. Please re-assign accordingly if it’s not.

Revision history for this message
Olivier Tilloy (osomon) wrote :

Attaching the full test output (the one linked to in the description) for the record.

Revision history for this message
Olivier Tilloy (osomon) wrote :

Until this is properly fixed, I worked around the issue in the test itself by replacing:

    window = self.app.select_single("QQuickWindow")

with:

    windows = self.app.select_many("QQuickWindow")
    window = [w for w in windows if w.visible][0]

Not particularly clean code, but it does the trick…

Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote :

Hi,

A better workaround would be this:

window = self.app.select_single("QQuickWindow", visible=True)

It looks nicer, and the filtering will be done on the server-side, so it will be faster too.

Regarding the issue itself, I'm not sure why this would have started happening. My suspicion is that this is an internal Qt change, but I'll try and look into it when I get some time - although so far this is the only bug report of this kind, so it's likely a rather low priority item.

Changed in autopilot-qt:
importance: Undecided → Low
Revision history for this message
Olivier Tilloy (osomon) wrote :

Indeed that’s a much cleaner and readable workaround. I submitted https://code.launchpad.net/~osomon/webbrowser-app/cleaner-workaround-1248620/+merge/194455 to update it. Thanks!

Revision history for this message
Olivier Tilloy (osomon) wrote :

Not a bug in webbrowser-app. It was worked around in its tests though.

Changed in webbrowser-app (Ubuntu):
status: New → Invalid
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package webbrowser-app - 0.23+14.04.20140115.1-0ubuntu1

---------------
webbrowser-app (0.23+14.04.20140115.1-0ubuntu1) trusty; urgency=medium

  [ Olivier Tilloy ]
  * Bump version to 0.23 in preparation for the next major release.
  * Split the app into two executables: webbrowser-app and webapp-
    container.
  * Cleaner workaround for bug #1248620. Thanks Thomi for the
    suggestion!. (LP: #1248620)
  * Update the link to the list of overrides for B2G.
  * Add ignore rules for generated ninja files.
  * Use the local test server everywhere instead of writing temporary
    html pages on disk.
  * Fix FTBFS with Qt 5.2. (LP: #1258038)
  * Ensure the test server is up and responding before starting the
    tests, and use standard logging everywhere.
  * Re-execute web application in the dedicated container (compatibility
    mode for legacy webapps).

  [ Omer Akram ]
  * move the close button of the running activity to the left.

  [ Alexandre Abreu ]
  * Further separate the two webbrowser-app & webapp-container projects.
    (LP: #1246935)
  * Restrict url webapps pattern replacement depending on which part is
    being affected. (LP: #1240685)
  * Fix back forward hud actions.

  [ daker ]
  * Fix for uppercase urls. (LP: #1244329)
  * Fixed UA string for huffpost.com. (LP: #1223937)

  [ Timo Jyrinki ]
  * libqt5v8-5-private-dev will be dropped from Qt 5.2. qtdeclarate-
    private-dev 5.0.2 now depends on it until then.

  [ Adnane Belmadiaf ]
  * Change the default homepage to start.ubuntu.com. (LP: #1250995)
  * Fixed UA string for huffpost.com. (LP: #1223937)

  [ David Barth ]
  * Make sure we are redirected to the mobile version automatically, by
    presenting a mobile user-agent string on the /whole/ youtube domain
    (not just m.youtube.com). The string is also changed to the simpler
    ua string used for facebook.com. It gives the same UI, but avoids
    being seen as an Apple browser, which itself prevents rtsp/3gp
    content to be served to our browser. We (barely) support html5 video
    now.
  * Re-execute web application in the dedicated container (compatibility
    mode for legacy webapps).

  [ Ubuntu daily release ]
  * Automatic snapshot from revision 435
 -- Ubuntu daily release <email address hidden> Wed, 15 Jan 2014 19:37:19 +0000

Changed in webbrowser-app (Ubuntu):
status: Invalid → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.