Chromium doesn't display XML reports as generated by Checkbox

Bug #1026614 reported by Daniel Manrique on 2012-07-19
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Checkbox
High
Daniel Manrique
checkbox (Ubuntu)
Undecided
Unassigned
Precise
Undecided
Unassigned

Bug Description

[Impact]

When trying to open the checkbox-generated submission.xml file with chromium (either configured as default browser or by clicking on "view report" from within checkbox), the browser opens but displays nothing.

Given the rate of adoption for Chromium, and the fact that it overrides Firefox as the default browser when installed (which IMHO is wrong, but that' not something we can really fix on our side), it'd be good to try to ensure our XML files can be at least opened on Chromium.

This problem was fixed in the development version by using the --allow-file-access-from-files switch so that chromium agrees to load file:// resources.

[Test case]

Steps to reproduce:
- Either run checkbox and complete some tests to generate a submission.xml file (usually in ~/.cache/checkbox), or download the attached submission.xml file.
- chromium-browser submission.xml

Or to test everything within checkbox (this is valuable to test the fix):
- Ensure chromium is configured as the default browser systemwide: go to system settings -> details and configure chromium as the default browser, also update-alternatives --config x-www-growser and update-alternatives --config gnome-www-browser
- Run checkbox
- Deselect all tests
- Select a couple of quick tests (audio, input devices)
- Complete the run
- When checkbox gives the choice to view the report, click on "view report"

Expected result:
- Chromium starts and renders the XML file, at the very least showing the text, even if not formatted.

Actual result:
- Blank page, nothing is shown.

[Regression potential]
There's little potential for a regression, since all the resources loaded are local and considered safe. The switch in question is meant to avoid malicious files to be loaded on a machine, but files generated by checkbox are all benign and just XSLT information is loaded.

Related branches

Daniel Manrique (roadmr) wrote :
Daniel Manrique (roadmr) wrote :

Awesome, I triaged my own bug :)
The problem is when reading the xslt file, which in the submission.xml file is referenced through a file:// url. Chromium doesn't like this :(

//By default, file:// URIs cannot read other file:// URIs. This is an
// override for developers who need the old behavior for testing.

Running it like this works:

chromium-browser --allow-file-access-from-files submission.xml

The simplistic way to solve this would be adding this command-line parameter to the browser invocation command in checkbox/user_interface.py if the browser turns out to be chrome or chromium-browser. I still need to read up on why this isn't enabled by default and whether we will incur users' wrath if we turn this on.

Changed in checkbox:
status: New → Triaged
importance: Undecided → High
milestone: none → 0.14.x
Daniel Manrique (roadmr) on 2012-07-23
Changed in checkbox:
assignee: nobody → Daniel Manrique (roadmr)
status: Triaged → In Progress
Daniel Manrique (roadmr) on 2012-07-24
Changed in checkbox:
status: In Progress → Fix Committed
Changed in checkbox:
status: Fix Committed → Fix Released
Daniel Manrique (roadmr) on 2012-10-01
description: updated
Changed in checkbox (Ubuntu):
status: New → Fix Released

Hello Daniel, or anyone else affected,

Accepted checkbox into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/checkbox/0.13.8 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please change the bug tag from verification-needed to verification-done. If it does not, change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in checkbox (Ubuntu Precise):
status: New → Fix Committed
tags: added: verification-needed
Daniel Manrique (roadmr) wrote :

Hi! To test this, I installed chromium-browser on a virtual machine with checkbox 0.13.7. I configured it to be the default browser everywhere as indicated in the test case. I then launched checkbox-qt, deselected all tests, selected only the audio tests, and started the test run.

I ran through all the audio test cases, basically just clicking "yes" on each one. When the run finished I clicked on "view report" button. Firefox showed the report despite my earlier configuration :)

Since this is a test VM, I outright removed firefox, closed and relaunched checkbox, and repeated the process. Chromium-browser doesn't even launch because of an error on checkbox/user_interface.py, reads:

subprocess.Popen(sudo_prefix + [preferred_browser % url], shell=True)

should read:

subprocess.Popen(sudo_prefix + [preferred_browser, url], shell=True)

This line is a "fallback" when the browser is neither firefox (or relatives) or epiphany. Chromium will hit the fallback which is incorrect. So this basically uncovered an unrelated bug.

Then I installed checkbox 0.13.8 to see what the behavior is. I did the same process as above. The browser still didn't open.

I did some digging and it turns out that, for instance, firefox returns simply "firefox", but in this case chromium is returning "/usr/bin/chromium-browser". Since the regular expression we use to set the chromium-specific "quirk" does not specify the extra /usr/bin/ component:

browser = re.match("(chromium-browser[^\s]*)", preferred_browser)

This means that chromium again falls on the "fallback" which continues to have a syntax error and does not start at all.

I guess if we found a way to get the preferred application function we're using to return a relative binary name, things would work as expected. But since it looks like that would require black magic, I have to say that this fix does not work as expected (and indeed, the fix as present in trunk is suspect and would bear some closer review), so I will mark this bug as verification-failed.

tags: added: verification-failed
removed: verification-needed
Steve Langasek (vorlon) wrote :

Hello Daniel, or anyone else affected,

Accepted checkbox into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/checkbox/0.13.9 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please change the bug tag from verification-needed to verification-done. If it does not, change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: removed: verification-failed
tags: added: verification-needed
Daniel Manrique (roadmr) wrote :

Here's how I tested the updated fix:

- sudo apt-get install chromium-browser firefox-
- chromium is installed and firefox got removed, to avoid it interfering with the test.
- Launched checkbox (at this time 0.13.7 is installed).
- Selected only the audio tests
- Ran through them quickly by selecting "yes" in every test.
- At the end, clicked "View report".
- Nothing happens :( (this is however expected; it's the problem we're trying to fix).
- Closed checkbox
- Installed checkbox 0.13.9 from -proposed.
- Launched checkbox (at this time 0.13.9 is installed).
- Selected only the audio tests
- Ran through them quickly by selecting "yes" in every test.
- At the end, clicked "View report".
- This time, chromium launched and correctly showed the report, without me having to do anything additional.

Based on this, the fix seems to work for Checkbox 0.13.9 (note it didn't work for 0.13.8 so it got superseded).

Marking verification-done.

tags: added: verification-done
removed: verification-needed

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package checkbox - 0.13.9

---------------
checkbox (0.13.9) precise-proposed; urgency=low

  * Updated fix for bug #1026614 which was missing some code.
  * Removed bad fix for bug 990133.

checkbox (0.13.8) precise-proposed; urgency=low

  * New upstream release (LP: #1061198)

  [Marc Tardif]
  * checkbox/dispatcher.py: Updated license to GPLv3 to be consistent with
    rest of Checkbox files (LP: #1049881)

  [Sylvain Pineau]
  * qt/frontend/qtfront.ui: Fixed the test purpose widget size to allow two
    lines of description (LP: #1032255)
  * scripts/camera_test, jobs/camera.txt.in: Added a 10s timeout to the camera
    still test (LP: #990133)

  [Daniel Manrique]
  * jobs/audio.txt.in: replaced gconfaudiosink by autoaudiosink (LP: #978895)
  * Instruct Chromium browser to accept file:// URLs so it can correctly
    open the checkbox submission.xml report (LP: #1026614)
  * scripts/network_check: InvalidURL exception is caught and handled more
    cleanly (LP: #751701)
  * Set the correct user (root) for fwts-wakealarm test (LP: #1004102)
  * Set correct user (root) for usb/storage-preinserted, so it works correctly
    on servers (LP: #1004131)

  [Nathan Williams]
  * scripts/network_check: Fixed exception handling in the absence of zenity
    (LP: #988260)
 -- Daniel Manrique <email address hidden> Tue, 20 Nov 2012 16:31:02 -0500

Changed in checkbox (Ubuntu Precise):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers