2
0
mirror of synced 2025-02-22 22:38:18 +00:00
mobile/exp/audio/audio_test.go
Burcu Dogan 1d641b5393 audio: move to exp/audio
Change-Id: I8640b1a38a292972db6dd00506e38c89470b2c15
Reviewed-on: https://go-review.googlesource.com/11311
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2015-06-21 18:18:56 +00:00

41 lines
980 B
Go

// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build darwin linux,!android
package audio
import (
"testing"
"time"
)
func TestNoOp(t *testing.T) {
var p *Player
if err := p.Play(); err != nil {
t.Errorf("no-op player failed to play: %v", err)
}
if err := p.Pause(); err != nil {
t.Errorf("no-op player failed to pause: %v", err)
}
if err := p.Stop(); err != nil {
t.Errorf("no-op player failed to stop: %v", err)
}
if c := p.Current(); c != 0 {
t.Errorf("no-op player returns a non-zero playback position: %v", c)
}
if tot := p.Total(); tot != 0 {
t.Errorf("no-op player returns a non-zero total: %v", tot)
}
if vol := p.Volume(); vol != 0 {
t.Errorf("no-op player returns a non-zero volume: %v", vol)
}
if s := p.State(); s != Unknown {
t.Errorf("playing state: %v", s)
}
p.SetVolume(0.1)
p.Seek(1 * time.Second)
p.Close()
}