[banshee/stable-2.6] MediaEngineTests: make TearDown more robust



commit 700f367f7c13ab62e890f05a6aef91cac991feae
Author: Andrés G. Aragoneses <knocte gmail com>
Date:   Sat Feb 1 01:28:02 2014 +0100

    MediaEngineTests: make TearDown more robust
    
    If you added a test that ended up being on Idle state at the end
    of its execution, the TestFixtureTearDown could fail because
    when you Dispose() or Pause() a service that is in Idle state, the
    event Paused never arrives.
    
    Fix that by playing a track before calling Dispose() in the TearDown.

 .../Banshee.Services/Banshee.MediaEngine/Tests.cs  |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/Core/Banshee.Services/Banshee.MediaEngine/Tests.cs 
b/src/Core/Banshee.Services/Banshee.MediaEngine/Tests.cs
index cdce4a0..9f74b07 100644
--- a/src/Core/Banshee.Services/Banshee.MediaEngine/Tests.cs
+++ b/src/Core/Banshee.Services/Banshee.MediaEngine/Tests.cs
@@ -480,7 +480,14 @@ namespace Banshee.MediaEngine
         {
             try {
 
-                AssertTransition (() => service.Dispose (), PlayerState.Paused, PlayerState.Idle);
+                var a_valid_track1 = "A_boy.ogg";
+                var a_valid_uri = new SafeUri (Paths.Combine (TestsDir, "data", a_valid_track1));
+                WaitUntil (PlayerState.Playing, () => {
+                    service.Open (a_valid_uri);
+                    service.Play ();
+                });
+
+                AssertTransition (service.Dispose, PlayerState.Paused, PlayerState.Idle);
 
             } finally {
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]