[Presentation API] Add layout test for connection.close() and fix test failures

Add layout test.

1-UA connection.close() hits NOTREACHED() in PresentationConnection::didChangeState(). Use PresentationConnection::didClose() instead.

BUG=697719

Review-Url: https://codereview.chromium.org/2730123003
Cr-Commit-Position: refs/heads/master@{#455225}
void PresentationConnectionProxy::OnMessage(
    PresentationConnectionMessage message,
    const OnMessageCallback& callback) {
  DCHECK(!callback.is_null());

  if (message.is_binary()) {
    source_connection_->didReceiveBinaryMessage(&(message.data->front()),
                                                message.data->size());
  } else {
    source_connection_->didReceiveTextMessage(
        blink::WebString::fromUTF8(*(message.message)));
  }

  callback.Run(true);
}

void PresentationConnectionProxy::OnMessage(
    PresentationConnectionMessage message,
    const OnMessageCallback& callback) {
  DCHECK(!callback.is_null());

  if (message.is_binary()) {
    source_connection_->didReceiveBinaryMessage(&(message.data->front()),
                                                message.data->size());
  } else {
    source_connection_->didReceiveTextMessage(
        blink::WebString::fromUTF8(*(message.message)));
  }

  callback.Run(true);
}
