| Index: content/browser/resources/media/new/gen_logs.js
|
| diff --git a/content/browser/resources/media/new/gen_logs.js b/content/browser/resources/media/new/gen_logs.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..d2eca42d55296330bb79a9efe7ca96d61da99cef
|
| --- /dev/null
|
| +++ b/content/browser/resources/media/new/gen_logs.js
|
| @@ -0,0 +1,99 @@
|
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +
|
| +(function () {
|
| + "use strict";
|
| +
|
| + media.onPlayerOpen(1, 0);
|
| + media.onPlayerOpen(2, 0);
|
| +
|
| + var interval = 1;
|
| +
|
| +
|
| + media.onPlayerProperty(1, new Date().getTime(), 'name',
|
| + "MMy Named Pllayer 1y Named Player 1");
|
| + media.onPlayerProperty(2, new Date().getTime(), 'name',
|
| + "My Named Player 2");
|
| +
|
| + media.onPlayerProperty(1, new Date().getTime(), 'total_bytes', "1000");
|
| + media.onPlayerProperty(2, new Date().getTime(), 'total_bytes', "1000");
|
| +
|
| + var spammer = function (toSpam) {
|
| + function spamming() {
|
| + media.onPlayerPropertyNoRecord(1, new Date().getTime(), toSpam,
|
| + Math.random() * 1000);
|
| + media.onPlayerPropertyNoRecord(2, new Date().getTime(), toSpam,
|
| + Math.random() * 1000);
|
| + }
|
| +
|
| + return function () {
|
| + return setInterval(spamming, interval);
|
| + };
|
| + };
|
| +
|
| + var spamFPS = spammer('fps');
|
| + var spamBitrate = spammer('bitrate');
|
| + var spamBuffer_start = spammer('buffer_start');
|
| + var spamBuffer_current = spammer('buffer_current');
|
| + var spamBuffer_end = spammer('buffer_end');
|
| +
|
| + this.fpsTt = spamFPS();
|
| + this.bitTt = spamBitrate();
|
| + this.spamBuffer_start = spamBuffer_start();
|
| + this.spamBuffer_current = spamBuffer_current();
|
| + this.spamBuffer_end = spamBuffer_end();
|
| +
|
| + this.stop = function () {
|
| + clearInterval(this.fpsTt);
|
| + clearInterval(this.bitTt);
|
| + clearInterval(this.spamBuffer_start);
|
| + clearInterval(this.spamBuffer_current);
|
| + clearInterval(this.spamBuffer_end);
|
| + };
|
| +
|
| + var first = function () {
|
| + media.onMediaEvent({
|
| + renderer: 5,
|
| + player: 10,
|
| + ticksMillis: 0
|
| + });
|
| +
|
| + media.addAudioStream({
|
| + id: "media1",
|
| + status: "created",
|
| + playing: true
|
| + });
|
| + };
|
| + var second = function () {
|
| + media.onMediaEvent({
|
| + renderer: 5,
|
| + player: 10,
|
| + ticksMillis: 100,
|
| + params: {
|
| + test: 5
|
| + }
|
| + });
|
| +
|
| + media.addAudioStream({
|
| + id: "media1",
|
| + status: "created",
|
| + playing: false
|
| + });
|
| + };
|
| + var last = function () {
|
| + media.onRendererTerminated(5);
|
| +
|
| + media.addAudioStream({
|
| + id: "media1",
|
| + status: "closed",
|
| + playing: true
|
| + });
|
| + };
|
| +
|
| + setTimeout(first, 1000);
|
| + setTimeout(second, 5000);
|
| + setTimeout(last, 9000);
|
| +
|
| +}.bind(this)());
|
|
|