<!DOCTYPE html>
<html>
  <head>
    <title>
      waveshaper-364379.html
    </title>
    <script src="../../imported/w3c/web-platform-tests/resources/testharness.js"></script>
    <script src="../../resources/testharnessreport.js"></script>
    <script src="../resources/audit-util.js"></script>
    <script src="../resources/audit.js"></script>
  </head>
  <body>
    <script id="layout-test-code">
      let audit = Audit.createTaskRunner();

      audit.define({label: 'Test WaveShaperNode'}, (task, should) => {
        // Simplified test from crbug.com/364379
        let sampleRate = 44100;
        let context = new OfflineAudioContext(1, sampleRate, sampleRate);
        let waveShaper = context.createWaveShaper();
        context.oncomplete = () => {
          // If we get here, we passed the test from bug 364379.  Just say we
          // succeeded.
          should(true, 'WaveShaper successfully handled change in oversampling')
              .beTrue();
          task.done();
        };
        context.startRendering();
        waveShaper.connect(context.destination);
        waveShaper.oversample = '4x';
      });

      audit.run();
    </script>
  </body>
</html>
