MediaRecoder: only throw exception from requestData() if state is inactive

Simple change to update to the Spec and FF implementation.

LayoutTest updated (note that we're still checking that requestData()
throws when the state==inactive).

BUG=673965

Review-Url: https://codereview.chromium.org/2571093002
Cr-Commit-Position: refs/heads/master@{#438407}
diff --git a/third_party/WebKit/LayoutTests/fast/mediarecorder/MediaRecorder-events-and-exceptions.html b/third_party/WebKit/LayoutTests/fast/mediarecorder/MediaRecorder-events-and-exceptions.html
index 65807771..e2047d4 100644
--- a/third_party/WebKit/LayoutTests/fast/mediarecorder/MediaRecorder-events-and-exceptions.html
+++ b/third_party/WebKit/LayoutTests/fast/mediarecorder/MediaRecorder-events-and-exceptions.html
@@ -42,8 +42,6 @@
 
 recorderOnPause = test.step_func(function() {
     assert_equals(recorder.state, "paused");
-    assert_throws("InvalidStateError", function() { recorder.requestData() },
-                  "cannot requestData() if recorder is |paused|");
     recorder.onpause = recorderOnUnexpectedEvent;
     recorder.onresume = recorderOnResume;
     recorder.resume();
diff --git a/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp b/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp
index a3ca3de..02a4f51 100644
--- a/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp
+++ b/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp
@@ -274,7 +274,7 @@
 }
 
 void MediaRecorder::requestData(ExceptionState& exceptionState) {
-  if (m_state != State::Recording) {
+  if (m_state == State::Inactive) {
     exceptionState.throwDOMException(
         InvalidStateError,
         "The MediaRecorder's state is '" + stateToString(m_state) + "'.");