Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(451)

Side by Side Diff: chrome/test/data/chrome_endure/deterministic.js

Issue 10803002: Run Chrome Endure tests with network simulation via Web Page Replay. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 (function () {
Nirnimesh 2012/07/18 19:41:18 license header? Add comments about this file.
fdeng1 2012/07/24 00:05:50 I added a license header. But I also I noticed tha
2 var orig_date = Date;
3 var random_count = 0;
4 var date_count = 0;
5 var random_seed = 0.462;
6 var time_seed = 3204251968254;
7 var random_count_threshold = 25;
8 var date_count_threshold = 25;
9 Math.random = function() {
10 random_count++;
11 if (random_count > random_count_threshold){
12 random_seed += 0.1;
13 random_count = 1;
14 }
15 return (random_seed % 1);
16 };
17 Date = function() {
18 if (this instanceof Date) {
19 date_count++;
20 if (date_count > date_count_threshold){
21 time_seed += 50;
22 date_count = 1;
23 }
24 switch (arguments.length) {
25 case 0: return new orig_date(time_seed);
26 case 1: return new orig_date(arguments[0]);
27 default: return new orig_date(arguments[0], arguments[1],
28 arguments.length >= 3 ? arguments[2] : 1,
29 arguments.length >= 4 ? arguments[3] : 0,
30 arguments.length >= 5 ? arguments[4] : 0,
31 arguments.length >= 6 ? arguments[5] : 0,
32 arguments.length >= 7 ? arguments[6] : 0);
33 }
34 }
35 return new Date().toString();
36 };
37 Date.__proto__ = orig_date;
38 Date.prototype.constructor = Date;
39 orig_date.now = function() {
40 return new Date().getTime();
41 };
42 })();
OLDNEW
« no previous file with comments | « no previous file | chrome/test/functional/perf_endure.py » ('j') | chrome/test/functional/perf_endure.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698