Separate RemoveID test cases.
authorannacc@chromium.org <annacc@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Jun 2012 18:52:11 +0000 (18:52 +0000)
committerannacc@chromium.org <annacc@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Jun 2012 18:52:11 +0000 (18:52 +0000)
https://bugs.webkit.org/show_bug.cgi?id=88798

Reviewed by Eric Carlson.

* http/tests/media/media-source/video-media-source-add-and-remove-ids-expected.txt:
* http/tests/media/media-source/video-media-source-add-and-remove-ids.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@120097 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/http/tests/media/media-source/video-media-source-add-and-remove-ids-expected.txt
LayoutTests/http/tests/media/media-source/video-media-source-add-and-remove-ids.html

index 94977b2..bbba742 100644 (file)
@@ -1,3 +1,13 @@
+2012-06-12  Anna Cavender  <annacc@chromium.org>
+
+        Separate RemoveID test cases.
+        https://bugs.webkit.org/show_bug.cgi?id=88798
+
+        Reviewed by Eric Carlson.
+
+        * http/tests/media/media-source/video-media-source-add-and-remove-ids-expected.txt:
+        * http/tests/media/media-source/video-media-source-add-and-remove-ids.html:
+
 2012-06-12  Brady Eidson  <beidson@apple.com>
 
         <rdar://problem/11593686> and https://bugs.webkit.org/show_bug.cgi?id=88683
index be98cb6..c085911 100644 (file)
@@ -20,17 +20,35 @@ Test reaching sourceID limit.
 Test that SourceIDs can't be added while in the ended state.
 Got expected exception Error: INVALID_STATE_ERR: DOM Exception 11
 
-running testRemoveIdFailureCases
+running testRemoveEmptyId
 EVENT(loadstart)
 EVENT(webkitsourceopen)
 Test empty ID case
 Got expected exception Error: INVALID_ACCESS_ERR: DOM Exception 15
+
+running testRemoveNonexistentId
+EVENT(loadstart)
+EVENT(webkitsourceopen)
 Test removing an ID that was never added.
 Got expected exception Error: SYNTAX_ERR: DOM Exception 12
+
+running testRemoveAgain
+EVENT(loadstart)
+EVENT(webkitsourceopen)
+Test removing an ID that was already removed.
 Got expected exception Error: SYNTAX_ERR: DOM Exception 12
-Test adding the same ID again.
+
+running testRemoveIdAfterEnded
+EVENT(loadstart)
+EVENT(webkitsourceopen)
 Test that an ID can be removed while in the ended state.
 
+running testAddIdAfterRemoving
+EVENT(loadstart)
+EVENT(webkitsourceopen)
+Test that an ID can be added again after it is removed.
+Unexpected exception: Error: QUOTA_EXCEEDED_ERR: DOM Exception 22
+
 running testAppendFailureCases
 EVENT(loadstart)
 EVENT(webkitsourceopen)
index 429ebc2..82379f5 100644 (file)
                 runNextTestCase();
             }
 
-            function testRemoveIdFailureCases(runNextTestCase, videoTag)
+            function testRemoveEmptyId(runNextTestCase, videoTag)
             {
                 consoleWrite("Test empty ID case");
                 expectExceptionOnRemoveId(videoTag, "", DOMException.INVALID_ACCESS_ERR);
 
+                runNextTestCase();
+            }
+
+            function testRemoveNonexistentId(runNextTestCase, videoTag)
+            {
                 consoleWrite("Test removing an ID that was never added.");
                 expectExceptionOnRemoveId(videoTag, "345", DOMException.SYNTAX_ERR);
 
+                runNextTestCase();
+            }
+
+            function testRemoveAgain(runNextTestCase, videoTag)
+            {
+                consoleWrite("Test removing an ID that was already removed.");
                 videoTag.webkitSourceAddId("123", defaultSourceMimetype);
                 videoTag.webkitSourceRemoveId("123");
                 expectExceptionOnRemoveId(videoTag, "123", DOMException.SYNTAX_ERR);
 
-                consoleWrite("Test adding the same ID again.");
-                videoTag.webkitSourceAddId("123", defaultSourceMimetype);
+                runNextTestCase();
+            }
 
+            function testRemoveIdAfterEnded(runNextTestCase, videoTag)
+            {
                 consoleWrite("Test that an ID can be removed while in the ended state.");
+                videoTag.webkitSourceAddId("123", defaultSourceMimetype);
                 videoTag.webkitSourceEndOfStream(videoTag.EOS_NO_ERROR);
                 videoTag.webkitSourceRemoveId("123");
 
                 runNextTestCase();
             }
 
+            function testAddIdAfterRemoving(runNextTestCase, videoTag)
+            {
+                consoleWrite("Test that an ID can be added again after it is removed.");
+                videoTag.webkitSourceAddId("123", defaultSourceMimetype);
+                videoTag.webkitSourceRemoveId("123");
+
+                try {
+                    videoTag.webkitSourceAddId("123", defaultSourceMimetype);
+                } catch (e) {
+                    consoleWrite("Unexpected exception: " + e);
+                }
+
+                runNextTestCase();
+            }
+
             function testAppendFailureCases(runNextTestCase, videoTag)
             {
                 var initSegment = segmentHelper.initSegment;
 
                     var testCases = [
                         testAddIdFailureCases,
-                        testRemoveIdFailureCases,
+                        testRemoveEmptyId,
+                        testRemoveNonexistentId,
+                        testRemoveAgain,
+                        testRemoveIdAfterEnded,
+                        testAddIdAfterRemoving,
                         testAppendFailureCases,
                     ];