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

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: tests; also mutedCause is a part of the tab object and capture mutedCause changed to just 'capture' Created 5 years, 7 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 var freqs = [200, 500, 1800];
2 var curTestIdx = 0;
3 if (!this.audioContext) {
4 this.audioContext = new AudioContext();
5 this.gainNode = this.audioContext.createGain();
6 this.gainNode.gain.value = 0.5;
7 this.gainNode.connect(this.audioContext.destination);
8 }
9 if (!this.oscillator ||
10 this.oscillator.frequency.value != freqs[curTestIdx]) {
11 // Note: We recreate the oscillator each time because this switches the
12 // audio frequency immediately. Re-using the same oscillator tends to take
13 // several hundred milliseconds to ramp-up/down the frequency.
14 if (this.oscillator) {
15 this.oscillator.stop();
16 this.oscillator.disconnect();
17 }
18 this.oscillator = this.audioContext.createOscillator();
19 this.oscillator.type = OscillatorNode.SINE;
20 this.oscillator.frequency.value = freqs[curTestIdx];
21 this.oscillator.connect(this.gainNode);
22 this.oscillator.start();
23 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698