chromium/content/test/data/generic_sensor/ambient_light_sensor_unavailable_test.html

<html>
  <head>
    <title>AmbientLight Generic Sensor test</title>
    <script type="text/javascript">
      function onAmbientLightReading() {
        fail();
      }

      function onSensorError() {
        pass();
      }

      function start() {
        sensor = new AmbientLightSensor();
        sensor.onreading = onAmbientLightReading;
        sensor.onerror = onSensorError;
        sensor.start();
      }

      function pass() {
        document.getElementById('status').innerHTML = 'PASS';
        document.location = '#pass';
      }

      function fail() {
        document.location = '#fail';
      }
    </script>
  </head>
  <body onLoad="start()">
    <div id="status">FAIL</div>
  </body>
</html>