Fix broadcast-stream code, add tests for it

R=mcampione@google.com

Review URL: https://chromiumcodereview.appspot.com/134923002