Add appropriate enum types for string attributes.

Also, setting invalid values for channelCountMode, channelInterpretation, and oversample should not signal errors.  
Using these enum types seems to prevent reaching the code that signals the exceptions so remove that code too.

Updated dom-exceptions test to verify that exceptions are not signaled and that the values are not changed.

BUG=371412

Review URL: https://codereview.chromium.org/279473004

git-svn-id: svn://svn.chromium.org/blink/trunk@174031 bbb929c8-8fbe-4397-9dbb-9b2b20218538
diff --git a/third_party/WebKit/LayoutTests/webaudio/dom-exceptions.html b/third_party/WebKit/LayoutTests/webaudio/dom-exceptions.html
index db8ef15..df28183 100644
--- a/third_party/WebKit/LayoutTests/webaudio/dom-exceptions.html
+++ b/third_party/WebKit/LayoutTests/webaudio/dom-exceptions.html
@@ -104,9 +104,18 @@
     // Invalid channel count: NotSupportedError
     shouldThrow("node.channelCount = 99");
     // Invalid mode or interpretation (unspecified error)
-    mode = "fancy";
-    shouldThrow("node.channelCountMode = mode");
-    shouldThrow("node.channelInterpretation = mode");
+    currentMode = node.channelCountMode;
+    currentInterpretation = node.channelInterpretation;
+    shouldNotThrow("node.channelCountMode = 'fancy'");
+    if (node.channelCountMode == currentMode)
+      testPassed("Invalid channelCountMode value did not change mode");
+    else
+      testFailed("node.channelCountMode incorrectly changed to invalid value " + node.channelCountMode);  
+    shouldNotThrow("node.channelInterpretation = mode");
+    if (node.channelInterpretation == currentInterpretation)
+      testPassed("Invalid channelInterpration value did not change mode");
+    else
+      testFailed("node.channelInterpretation incorrectly changed to invalid value " + node.channelInterpreation);  
 
     // Destination: IndexSizeError
     shouldThrow("context.destination.channelCount = 99");
@@ -126,7 +135,12 @@
 
     // WaveShaper types
     node = context.createWaveShaper();
-    shouldThrow("node.oversample = '9x'");
+    currentOversample = node.oversample;
+    shouldNotThrow("node.oversample = '9x'");
+    if (node.oversample == currentOversample)
+      testPassed("Invalid oversample value did not change node.oversample");
+    else
+      testFailed("node.oversample incorrectly changed to invalid value " + node.oversample);
 
     // Start/stop for AudioBufferSourceNodes
     buffer = context.createBuffer(1,1, context.sampleRate);