dom/camera/test/test_camera_hardware_init_failure.html

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 <!DOCTYPE HTML>
     2 <html>
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=940424
     5 -->
     6 <head>
     7   <title>Bug 940424 - Test camera hardware init failure handling</title>
     8   <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
     9   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    10   <script type="text/javascript" src="camera_common.js"></script>
    11   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    12 </head>
    13 <body>
    14   <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=940424">Mozilla Bug 940424</a>
    15   <video id="viewfinder" width="200" height="200" autoplay></video>
    16   <img src="#" alt="This image is going to load" id="testimage"/>
    18 <script class="testbody" type="text/javascript;version=1.7">
    20 var whichCamera = navigator.mozCameras.getListOfCameras()[0];
    21 var initialConfig = {
    22   mode: 'picture',
    23   recorderProfile: 'cif',
    24   previewSize: {
    25     width: 352,
    26     height: 288
    27   }
    28 };
    30 function end() {
    31   CameraTest.end();
    32 }
    34 CameraTest.begin("hardware", function(test) {
    35   test.set("init-failure", function(type) {
    36     function onSuccess(camera, config) {
    37       ok(false, "onSuccess called incorrectly");
    38       camera.release();
    39       test.done(end);
    40     }
    41     function onError(error) {
    42       ok(true, "onError called correctly on init failure");
    43       test.done(end);
    44     }
    45     info("Running test: " + type);
    46     navigator.mozCameras.getCamera(whichCamera, initialConfig, onSuccess, onError);
    47   });
    48 });
    50 </script>
    51 </body>
    53 </html>

mercurial