dom/base/test/test_noWebAudioNotification.html
author Nicholas Nethercote <nnethercote@mozilla.com>
Mon, 05 Oct 2015 16:59:32 -0700
changeset 301715 3897da20e42dec0bcf73987af1eaac4f8ce950b8
parent 292870 877fd93742d290cb4efb045d248d838103184117
child 403759 322fde2d53bf49266dbc293321e6b36a4c789c12
permissions -rw-r--r--
Bug 1211324 (part 3) - Remove GraphicsFilter::FILTER_FAST and replace it with FILTER_BEST. r=mattwoodrow. This may sound like an odd change but it's what the current code effectively already does due to the way ToFilter() and ThebesFilter() are defined.

<!DOCTYPE HTML>
<html>
<head>
  <title>Test for video controller in windows</title>
  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<pre id="test">
</pre>

<script type="application/javascript">

SimpleTest.waitForExplicitFinish();
SimpleTest.requestFlakyTimeout("Testing an event not happening");

var observer = {
  observe: function(subject, topic, data) {
    ok(false, "should not receive audio-playback notification!");
  }
};

var observerService = SpecialPowers.Cc["@mozilla.org/observer-service;1"]
                                   .getService(SpecialPowers.Ci.nsIObserverService);

var ac;

var tests = [
  function() {
    observerService.addObserver(observer, "audio-playback", false);
    ok(true, "Observer set");
    runTest();
  },

  function() {
    ac = new AudioContext();
    setTimeout(runTest, 100);
  },

  function() {
    observerService.removeObserver(observer, "audio-playback");
    ok(true, "Observer removed");
    runTest();
  }
];

function runTest() {
  if (!tests.length) {
    SimpleTest.finish();
    return;
  }

  var test = tests.shift();
  test();
}

runTest();

</script>
</body>
</html>