Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(165)

Side by Side Diff: chrome/test/data/extensions/api_test/tabs/basics/sinewave.js

Issue 987583004: Add audible, muted to Tab, c.t.query, c.t.update, and c.t.onUpdated where relevant (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@patch1
Patch Set: header file order fixed Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 var freqs = [200, 500, 1800];
6 var curTestIdx = 0;
7 if (!this.audioContext) {
8 this.audioContext = new AudioContext();
9 this.gainNode = this.audioContext.createGain();
10 this.gainNode.gain.value = 0.5;
11 this.gainNode.connect(this.audioContext.destination);
12 }
13 if (!this.oscillator ||
14 this.oscillator.frequency.value != freqs[curTestIdx]) {
15 // Note: We recreate the oscillator each time because this switches the
16 // audio frequency immediately. Re-using the same oscillator tends to take
17 // several hundred milliseconds to ramp-up/down the frequency.
18 if (this.oscillator) {
19 this.oscillator.stop();
20 this.oscillator.disconnect();
21 }
22 this.oscillator = this.audioContext.createOscillator();
23 this.oscillator.type = OscillatorNode.SINE;
24 this.oscillator.frequency.value = freqs[curTestIdx];
25 this.oscillator.connect(this.gainNode);
26 this.oscillator.start();
27 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698