camera-app

* Test plan for component: camera-app

Dependents/Clients

  • Gallery app, Messaging app

Test Plan

This test plan is not supposed to be complete; use it to guide your manual testing so they dont miss big functional areas that are part in the component; also this should be used as guideline to inspire the exploratory testing which should be adapted smartly based on the real content of a MP

  • Install latest (trusty-proposed) image on phone
  • Install freshly build MPs that are needed for landing
  • Ensure that all AP tests pass on the device.
  • Test taking multiple pictures using the Camera and then ensuring photos are displayed in the gallery view (accessible by swiping to the right)
  • Test both front and back cameras (verify that controls do not disappear when switching from front to back camera)
  • Test taking pictures in portrait and landscape mode
  • Test focus works by tapping on the viewfinder
  • Test zooming (a 2 fingers pinch gesture triggers it)
  • Test that the camera can be launched from the gallery
  • Test that pictures taken with HDR enabled have dark and bright areas showing details
  • Test that pictures taken with geolocation enabled have GPS related XMP tags in them:
    1. Launch dummy GPS provider on phone: sudo service ubuntu-location-service stop && sudo /usr/bin/ubuntu-location-serviced --bus system --provider dummy::Provider --dummy::Provider::ReferenceLocationLat=48.857503 --dummy::Provider::ReferenceLocationLon=2.295072 --dummy::Provider::ReferenceHorizontalAccuracy=1

    2. Launch the camera app and enable geolocation in the options overlay
    3. Verify that the geolocation icon in the hint bar is colored white
    4. Take a picture
    5. Check that the GPS tags are in the metadata of the picture's file: exiv2 -p a MYPIC.jpg
  • Test that pictures taken with geolocation enabled but not enough precision don not have GPS related XMP tags in them:
    1. Launch dummy GPS provider on phone: sudo service ubuntu-location-service stop && sudo /usr/bin/ubuntu-location-serviced --bus system --provider dummy::Provider --dummy::Provider::ReferenceLocationLat=48.857503 --dummy::Provider::ReferenceLocationLon=2.295072 --dummy::Provider::ReferenceHorizontalAccuracy=2000

    2. Launch the camera app and enable geolocation in the options overlay
    3. Verify that the geolocation icon in the hint bar is colored red
    4. Take a picture
    5. Check that there is no GPS tags are in the metadata of the picture's file: exiv2 -p a MYPIC.jpg
  • Test recording video in portrait and landscape mode, play video in mediaplayer-app making sure video orientation is correct
  • Test that taking a picture with orientation lock on results in a normal (not stretched picture):
    1. Turn device in portrait orientation
    2. Open system settings and activate "Rotation Lock"
    3. Turn device in landscape orientation
    4. Take picture in that orientation, the resulting picture should have a landscape orientation and not be stretched/squashed
  • Make sure that recording also captures clear-sounding audio
  • Play some music in the music-app and then test recording making sure that audio recording still works as expected
  • Start recording then switch away from the app. When you return to the app the recording should have stopped cleanly and the camera should be still usable, ready to record a new video.
  • Insert an SD card into the phone, activate setting 'Save to SD card' from the bottom edge and take pictures and videos, they should be saved in the SD card
  • Set the self timer delay to 5 seconds, shoot a photo and verify that a countdown from 5 to 0 is displayed and a photo is taken after that delay.
  • Test Selection Mode
    • Open Photo Roll view
    • press and hold on a photo to select it
    • click anywhere on the photo (not on the selection box) to open it fullscreen with header visible
    • verify you can swipe through the pictures
    • verify you can click on the checkmark on the toolbar to select that picture, or on x to deselect the picture if it was already selected.
    • verify that when returning to the Photo Roll view the expected pictures are selected
    • the same test can be performed when in content-picking mode (i.e. selecting picture from camera to use as background in system-settings)
  • Test editing
    • If the package qtdeclarative5-ubuntu-ui-extras0.2 is installed on the system, then editing functionality will be available from the action menu when opening a picture. If that package is not installed, the action will not be available. The click package is dynamic so camera-app will function either way.
    • If editing enabled, test the following:
      • open photo and click the edit menu
      • verify that the revert button (bottom right) is not active if no edit has been made
      • verify the crop function works correctly
      • verify the rotate function works correctly
      • verify that the stack of edits can be undo/redo by using the icons on the toolbar
      • verify that the revert button (bottom right) will revert all edits
      • leave edit mode by pressing back button and verify changes to the picture are displayed in the PhotoRoll grid view

  • Test that aspect ratio setting works:
    1. Make sure photo mode is active
    2. Open bottom edge options
    3. Check that an aspect ratio option button is present
    4. Tap on the aspect ratio button
    5. At most two possible aspect ratios should appear, one of them highlighted; on arale one should read 5:3 and the other 4:3
    6. On arale if 5:3 is selected, the whole screen should be filled by the viewfinder, if 4:3 is selected, only the top part of the screen should be filled by the viewfinder
    7. Switch to the other camera and start again at step 1.
  • Test that it is possible to disable the shutter sound:
    1. Open bottom edge when in photo mode
    2. Check shutter sound button is present
    3. Select no sound
    4. Take a picture and verify no shutter sound is played
    5. Repeat 1 and 2, then select the shutter sound option
    6. Take a picture and verify that the shutter sound is played

Test Flash

Before performing any of these tests, the appplication settings file: adb shell "rm -rf /home/phablet/.config/com.ubuntu.camera/"

A. Switching recording mode - is flash set properly?

  1. ensure you are in picture mode
  2. set flash mode to force flash < shoot < ensure flash fires

  3. switch mode to video recording < verify torch is off while recording

  4. turn torch on < verify torch is on when recording

  5. switch mode to picture < shoot < ensure flash fires

  6. switch mode to video recording < verify torch is on while recording

B. Switching camera - is flash set properly? https://bugs.launchpad.net/camera-app/+bug/1479638

  1. ensure the current camera is the back-facing camera
  2. set flash mode to force flash < shoot < ensure flash fires

  3. switch to the front-facing camera
  4. switch to the back-facing camera < shoot < ensure flash fires

C. Suspend app then resume app - is flash set properly? https://bugs.launchpad.net/camera-app/+bug/1517450

  1. ensure you are in recording mode
  2. set flash mode to torch < ensure torch is on

  3. switch away from the app then go back to the app
  4. ensure torch is on

D. Video recording light and focusing interact properly? https://bugs.launchpad.net/canonical-devices-system-image/+bug/1424740

  1. switch to video recording
  2. set focus mode to torch < ensure torch is on while recording

  3. tap to focus < ensure torch is on while recording

E. Correct flash mode at startup

  1. run the app < ensure you are in picture mode and flash is set to auto

  2. cover the camera with your hand as to make the picture dark and shoot < ensure flash fires

  3. switch to video recording mode < ensure torch is off

  4. record and ensure torch is off while recording

F. Correct flash mode at startup - with settings

  1. turn flash to forced flash
  2. switch to recording mode < turn torch on

  3. restart the app
  4. ensure you are in picture mode and flash is set to forced flash
  5. shoot < ensure flash does fire

  6. switch to video recording mode < ensure torch is on

  7. record and ensure torch is on while recording

Stress Testing

Create a library of thousands of photos to do performance testing. Helper script to duplicate a given photo 2000 times:

  • On internal disk

for n in $(seq -w 2000); do cp <reference_picture>.jpg ~/Pictures/com.ubuntu.camera/picture_${n}.jpg; done
  • On SD card

for n in $(seq -w 2000); do cp <reference_picture>.jpg /media/phablet/<someId>/Pictures/com.ubuntu.camera/picture_${n}.jpg; done

Several stories need testing in this scenario:

  1. Opening up the app should not show any sort of lag or freeze and the photo roll should have a loading message
  2. Deleting all the 2000 photos from the photo roll should be relatively quick, no more than 2-3 seconds
  3. Taking a picture should be as quick as if there were very few photos in the library; no more than 1 second once focused and without flash

Thumbnails

  1. Open camera-app and take a picture in portrait mode using the back camera.
  2. Swipe to the left to view the image in the photo roll. Make sure the image has the expected aspect ratio (compare this image to what the camera-app's viewfinder shows live)
  3. In the upper right hand corner, tap the thumbnail view icon (a square with several smalls squares in a grid within it)
  4. Make sure the thumbnail has the same expected aspect ratio as the full image.
  5. On an Ubuntu desktop machine, navigate to Pictures/com.ubuntu.camera (device MTP) in Nautilus. Make sure that the thumbnail icon has the same expected aspect ratio as the full image and the thumbnail in photo roll on the device.

Repeat the same steps above for a landscape image. Repeat the same steps above for the front camera in both portrait and landscape.

  1. Run camera-app
  2. Swipe to reveal the photo roll. Switch to gallery/grid mode
  3. Open a shell to the device and run "top"
  4. Verify that camera-app is not continuously using CPU (it might sometimes appear in the list for a few milliseconds, but it should not stay in the list permanently)

Video Recording

Portrait

  1. Open camera-app and switch to video recording mode for the back camera
  2. Hold the camera in portrait mode
  3. Tap the recording button and move the phone left to right, then top to bottom
  4. Tap the recording button to stop recording
  5. Swipe to the left in the viewfinder until the just recorded video is visible
  6. Tap the video to begin playback, make sure that the video orientation is in portrait if you hold the phone in portrait (should be full screen). Make sure that the video switches to landscape when rotating the phone's orientation to landscape. Make sure that the recorded movements (i.e. left to right, top to bottom) show as expected and are not mirrored.

90 Degree Landscape

  1. Open camera-app and switch to video recording mode for the back camera
  2. Hold the camera in landscape mode (i.e. start in portrait, rotate 90 degrees counter clockwise)
  3. Tap the recording button and move the phone left to right, then top to bottom
  4. Tap the recording button to stop recording
  5. Swipe to the left in the viewfinder until the just recorded video is visible
  6. Tap the video to begin playback, make sure that the video orientation is in portrait if you hold the phone in portrait. Make sure that the video switches to landscape when rotating the phone's orientation to landscape (should be full screen). Make sure that the recorded movements (i.e. left to right, top to bottom) show as expected and are not mirrored.

180 Degree Portrait

  1. Open camera-app and switch to video recording mode for the back camera
  2. Hold the camera in portrait mode
  3. Tap the recording button and move the phone left to right, then top to bottom
  4. Tap the recording button to stop recording
  5. Swipe to the left in the viewfinder until the just recorded video is visible
  6. Tap the video to begin playback, make sure that the video orientation is in portrait if you hold the phone in portrait (should be full screen). Make sure that the video switches to landscape when rotating the phone's orientation to landscape. Make sure that the recorded movements (i.e. left to right, top to bottom) show as expected and are not mirrored.

270 Degree Landscape

  1. Open camera-app and switch to video recording mode for the back camera
  2. Hold the camera in landscape mode (i.e. start in portrait, rotate 90 degrees counter clockwise)
  3. Tap the recording button and move the phone left to right, then top to bottom
  4. Tap the recording button to stop recording
  5. Swipe to the left in the viewfinder until the just recorded video is visible
  6. Tap the video to begin playback, make sure that the video orientation is in portrait if you hold the phone in portrait. Make sure that the video switches to landscape when rotating the phone's orientation to landscape (should be full screen). Make sure that the recorded movements (i.e. left to right, top to bottom) show as expected and are not mirrored.

Repeat all 4 orientations for the front camera.

Video Scope Thumbnail

  1. Start a new video recording
  2. Stop video recording
  3. Swipe out of the camera-app and over to the video scope
  4. Make sure the video that you just recorded shows a thumbnail in the scope.

Low disk space The camera-app will warn the user if free disk space falls below 200MB but still allow video recording/photo taking until 50MB or less are available. Not recording/photos will be allowed when under the 50MB threshold and existing recordings in progress will stop when the threshold is hit.

  1. Use the following command to reduce your disk space to less than 200MB but greater than 50MB. df -kh command will show how much space you have available in your /home partition.

fallocate -l <amount>M|G testfile.txt
  1. Launch the camera-app and verify warning displayed but camera controls still functional
  2. Start recording a video. Monitor available disk space by using 'df -kh'. When 50MB threshold reached, verify video recording is stopped and a message is displayed to the user.
  3. Verify camera recording controls are disabled
  4. Swipe to the photo roll. Verify you can play back your video.
  5. Now delete the video using the UI
  6. Return to the viewfinder and verify camera recording controls are enabled.

Trust Prompt

To begin each section below, execute the following to reset the camera trust store state:

rm -rf ~/.local/share/PulseAudio
rm -rf ~/.local/share/CameraService
restart cameraservice-trust-stored
restart pulseaudio-trust-stored

Still Image

  1. Start the camera-app, it should ask if the camera-app can access the camera.
  2. Press deny - it should block the camera-app from being able to use the camera. The preview window should be black and the image capture button should be disabled.
  3. Ensure that a dialog informing of the missing permissions appears as soon as the previous dialog is closed.
  4. Press the "Edit permissions" button on the dialog.
  5. Ensure that System Settings->Security & Privacy screen appears.

  6. Go to other app access->Camera - tick the checkbox for camera so that it is enabled.

  7. Switch back to camera-app and verify that no permissions pupup is displayed, the preview window is capturing live data from the camera and that the image capture button is enabled.
  8. Take a picture and verify that it's valid by swiping right to left into the photo roll.

Video Recording

  1. Start the camera-app, it should ask if the camera-app can access the camera.
  2. Press deny - it should block the camera-app from being able to use the camera. The preview window should be black and the recording button should be disabled.
  3. Ensure that a dialog informing of the missing permissions appears as soon as the previous dialog has closed.
  4. Press the "Edit permissions" button on the dialog.
  5. Ensure that System Settings->Security & Privacy screen appears.

  6. Go to other app access->Camera - tick the checkbox for camera so that it is enabled.

  7. Switch back to camera-app and verify that the preview window is capturing live data from the camera and that the image capture button is enabled.
  8. Start recording, camera-app should ask if the camera-app can access the microphone.
  9. Press deny - it should allow you to still record a valid video but without any audio
  10. Record a video without audio and swipe right to left to the video in the photo roll once finished recording. Verify that this video plays successfully and has no audio.
  11. Restart camera-app, and enter System Settings->Security & Privacy->Other app access->Mic - tick the checkbox for camera so that mic access is enabled.

  12. Record a video and swipe right to left to the video in the photo roll once finished recording. Verify that this video plays successfully and has audio.
  13. Repeat steps 6-9 again but this time wait > 30s before pressing deny or allow on the trust prompt. Verify that everything works as expected like noted above.

Front Camera

  • Repeat Still Image and Video Record sections above using the front camera.

Take pictures when requested by other apps

Without camera running

  1. Ensure camera-app is not running
  2. Run messaging app
  3. Create a new message and press the "camera" button at the side of the input field
  4. Choose camera as source
  5. Ensure that camera app is launched, switched to photo capture, and that the button to switch to video recording is disabled
  6. Press the shutter button to take a picture. Ensure the review panel appears.
  7. Press the center "checkmark" button and verify that the picture is correctly sent to messaging app

With camera running

  1. Launch camera app
  2. Switch to video recording
  3. Run messaging app
  4. Create a new message and press the "camera" button at the side of the input field
  5. Choose camera as source
  6. Ensure that camera app is launched, switched to photo capture, and that the button to switch to video recording is disabled
  7. Press the shutter button to take a picture. Ensure the review panel appears.
  8. Press the center "checkmark" button and verify that the picture is correctly sent to messaging app

Read only SD card

Prepare a fake SD card file system to be mounted

  dd if=/dev/zero of=fatimage bs=1M count=210
  mkfs.vfat -F 32 -v fatimage

Mount it where camera-app expects it and ensure the Pictures directory is present (normally ciborium creates it when mounting the card)

  sudo mkdir -p /media/phablet/sd
  sudo mount -t vfat -o loop,uid=phablet,gid=phablet fatimage /media/phablet/sd
  mkdir /media/phablet/sd/Pictures

Now perform the following test:

  1. Run camera
  2. Open the options menu and verify that the "SD" icon is present
  3. Click on it and select "Save to SD card"
  4. Verify that no alert messages appear
  5. Shoot a picture and verify that it is present in /media/phablet/sd/Pictures/
  6. sudo mount -t vfat -o remount,ro,loop,uid=phablet,gid=phablet fatimage /media/phablet/sd
  7. Open the options menu and select "SD"
  8. Click on "Save internally" then again on "Save to SD card"
  9. Verify that a dialog appears notifying that "External storage not writeable"

When done:

   sudo umount /media/phablet/sd
   sudo rm -rf /media/phablet

Device Specific Testing

Arale

* Flickering header on top of share popover:

  1. Swipe right to photo roll
  2. Open menu and tap on 'Share'
  3. Share popover should be cover the photo roll entirely and the photo roll header should not be visible

Process/Merges/TestPlan/camera-app (last edited 2016-02-25 13:53:49 by uriboni)