Disable CFURLCache in WebKit2
[WebKit-https.git] / Websites / perf.webkit.org / unit-tests / resources / mock-v3-models.js
1 'use strict';
2
3 var MockModels = {
4     inject: function () {
5         beforeEach(function () {
6             AnalysisTask._fetchAllPromise = null;
7             AnalysisTask.clearStaticMap();
8             CommitLog.clearStaticMap();
9             Metric.clearStaticMap();
10             Platform.clearStaticMap();
11             Repository.clearStaticMap();
12             CommitSet.clearStaticMap();
13             Test.clearStaticMap();
14             TestGroup.clearStaticMap();
15             BuildRequest.clearStaticMap();
16             Triggerable.clearStaticMap();
17             TriggerableConfiguration.clearStaticMap();
18             UploadedFile.clearStaticMap();
19             MeasurementSet._setMap = null;
20
21             MockModels.osx = Repository.ensureSingleton(9, {name: 'OS X'});
22             MockModels.ios = Repository.ensureSingleton(22, {name: 'iOS'});
23             MockModels.webkit = Repository.ensureSingleton(11, {name: 'WebKit', url: 'http://trac.webkit.org/changeset/$1'});
24             MockModels.ownedWebkit = Repository.ensureSingleton(191, {name: 'WebKit', url: 'http://trac.webkit.org/changeset/$1', owner: 9});
25             MockModels.sharedRepository = Repository.ensureSingleton(16, {name: 'Shared'});
26             MockModels.ownerRepository = Repository.ensureSingleton(111, {name: 'Owner Repository'});
27             MockModels.ownedRepository = Repository.ensureSingleton(112, {name: 'Owned Repository', owner: 111});
28             MockModels.webkitGit = Repository.ensureSingleton(17, {name: 'WebKit-Git'});
29             MockModels.builder = new Builder(176, {name: 'WebKit Perf Builder', buildUrl: 'http://build.webkit.org/builders/$builderName/$buildTag'});
30
31             MockModels.someTest = Test.ensureSingleton(1, {name: 'Some test'});
32             MockModels.someMetric = Metric.ensureSingleton(2884, {name: 'Some metric', test: MockModels.someTest});
33             MockModels.somePlatform = Platform.ensureSingleton(65, {name: 'Some platform', metrics: [MockModels.someMetric],
34                 lastModifiedByMetric: {'2884': 5000, '1158': 5000}});
35
36             MockModels.speedometer = Test.ensureSingleton(1928, {name: 'Speedometer'});
37             MockModels.jetstream = Test.ensureSingleton(1886, {name: 'JetStream'});
38             MockModels.dromaeo = Test.ensureSingleton(2022, {name: 'Dromaeo'});
39             MockModels.domcore = Test.ensureSingleton(2023, {name: 'DOM Core Tests', parentId: 2022});
40
41             MockModels.iphone = Platform.ensureSingleton(12, {name: 'iPhone', metrics: []});
42             MockModels.ipad = Platform.ensureSingleton(13, {name: 'iPad', metrics: []});
43             MockModels.iOS10iPhone = Platform.ensureSingleton(14, {name: 'iOS 10 iPhone', metrics: []});
44
45             MockModels.plt = Test.ensureSingleton(844, {name: 'Page Load Test'});
46             MockModels.iPadPLT = Test.ensureSingleton(1444, {name: 'PLT-iPad'});
47             MockModels.iPhonePLT = Test.ensureSingleton(1500, {name: 'PLT-iPhone'});
48             MockModels.pltMean = Metric.ensureSingleton(1158, {name: 'Time', aggregator: 'Arithmetic', test: MockModels.plt});
49             MockModels.elCapitan = Platform.ensureSingleton(31, {name: 'El Capitan', metrics: [MockModels.pltMean]});
50
51             MockModels.osRepositoryGroup = new TriggerableRepositoryGroup(31, {
52                 name: 'ios',
53                 repositories: [{repository: MockModels.ios}]
54             });
55             MockModels.svnRepositoryGroup = new TriggerableRepositoryGroup(32, {
56                 name: 'ios-svn-webkit',
57                 repositories: [{repository: MockModels.ios}, {repository: MockModels.webkit, acceptsPatch: true}, {repository: MockModels.sharedRepository}],
58                 acceptsCustomRoots: true,
59             });
60             MockModels.gitRepositoryGroup = new TriggerableRepositoryGroup(33, {
61                 name: 'ios-git-webkit',
62                 repositories: [{repository: MockModels.ios}, {repository: MockModels.webkitGit}, {repository: MockModels.sharedRepository}]
63             });
64             MockModels.svnRepositoryWithOwnedRepositoryGroup = new TriggerableRepositoryGroup(34, {
65                 name: 'ios-svn-webkit-with-owned-commit',
66                 repositories: [{repository: MockModels.ios}, {repository: MockModels.webkit, acceptsPatch: true}, {repository: MockModels.ownerRepository}],
67                 acceptsCustomRoots: true,
68             });
69             MockModels.ownerRepositoryGroup = new TriggerableRepositoryGroup(35, {
70                 name: 'owner-repository',
71                 repositories: [{repository: MockModels.ownerRepository}],
72                 acceptsCustomRoots: true
73             });
74             MockModels.triggerable = new Triggerable(3, {name: 'build-webkit',
75                 repositoryGroups: [MockModels.osRepositoryGroup, MockModels.svnRepositoryGroup, MockModels.gitRepositoryGroup, MockModels.svnRepositoryWithOwnedRepositoryGroup, MockModels.ownerRepositoryGroup],
76                 configurations: [{test: MockModels.iPhonePLT, platform: MockModels.iphone, supportedRepetitionTypes: ['alternating', 'sequential']}]});
77
78             MockModels.someTriggableConfiguration = TriggerableConfiguration.findByTestAndPlatform(MockModels.iPhonePLT, MockModels.iphone);
79         });
80     }
81 }
82
83 if (typeof module != 'undefined')
84     module.exports.MockModels = MockModels;