Add BenchmarkRunner patches with WebDriver support for each testing plan
[WebKit.git] / Tools / Scripts / webkitpy / benchmark_runner / data / patches / webdriver / ContentAnimation.patch
1 diff --git a/css-accelerated-animation.html b/css-accelerated-animation.html
2 index 51ab3178addd49b3d9a19b03479d59be6aabf00b..fd637bc420c751b695afa84cc05ec9b25800f1ad 100644
3 --- a/css-accelerated-animation.html
4 +++ b/css-accelerated-animation.html
5 @@ -185,9 +185,42 @@
6          function setupAnimation()
7          {
8              makeParticles();
9 +
10 +            window.setTimeout(function() {
11 +                location.hash = 'done';
12 +            }, 10000)
13 +        }
14 +
15 +        function hashChanged()
16 +        {
17 +            if (location.hash === '#submit')
18 +                submitResults();
19 +        }
20 +
21 +        function submitResults()
22 +        {
23 +            var results = {
24 +                'content-animation' : {
25 +                    'metrics' : {
26 +                        'FrameRate' : ['Arithmetic']
27 +                    },
28 +                    'tests' : {
29 +                        'css-accelerated-animation' : {
30 +                            'metrics' : {
31 +                                'FrameRate' : {
32 +                                    'current' : ['<native_framerate>'] // <native_framerate> is replaced by a framerate computed in native code
33 +                                }
34 +                            }
35 +                        }
36 +                    }
37 +                }
38 +            };
39 +            var resultsString = JSON.stringify(results);
40 +            window.webdriver_results = resultsString;
41          }
42  
43          window.addEventListener('load', setupAnimation, false);
44 +        window.addEventListener("hashchange", hashChanged, false);
45      </script>
46  </head>
47  <body>
48 diff --git a/css-animation.html b/css-animation.html
49 index adae19cb018ed1ca93fd6b4cda80002348482fc3..8f1e29933faa13586dbf97b7874024854fbf2147 100644
50 --- a/css-animation.html
51 +++ b/css-animation.html
52 @@ -167,9 +167,42 @@
53          function setupAnimation()
54          {
55              makeParticles();
56 +            
57 +            window.setTimeout(function() {
58 +                location.hash = 'done';
59 +            }, 10000)
60 +        }
61 +        
62 +        function hashChanged()
63 +        {
64 +            if (location.hash === '#submit')
65 +                submitResults();
66 +        }
67 +
68 +        function submitResults()
69 +        {
70 +            var results = {
71 +                'content-animation' : {
72 +                    'metrics' : {
73 +                        'FrameRate' : ['Arithmetic']
74 +                    },
75 +                    'tests' : {
76 +                        'css-animation' : {
77 +                            'metrics' : {
78 +                                'FrameRate' : {
79 +                                    'current' : ['<native_framerate>'] // <native_framerate> is replaced by a framerate computed in native code
80 +                                }
81 +                            }
82 +                        }
83 +                    }
84 +                }
85 +            };
86 +            var resultsString = JSON.stringify(results);
87 +            window.webdriver_results = resultsString;
88          }
89          
90          window.addEventListener('load', setupAnimation, false);
91 +        window.addEventListener("hashchange", hashChanged, false);
92      </script>
93  </head>
94  <body>
95 diff --git a/raf-animation.html b/raf-animation.html
96 index 09e72f222fcafdfa054a2d5a37b1dcc9eca096ca..dbf18e72de9880c28d9fbf9fa156b4949bb6a6cf 100644
97 --- a/raf-animation.html
98 +++ b/raf-animation.html
99 @@ -195,9 +195,42 @@
100          {
101              makeParticles();
102              animate();
103 +
104 +            window.setTimeout(function() {
105 +                location.hash = 'done';
106 +            }, 10000)
107 +        }
108 +
109 +        function hashChanged()
110 +        {
111 +            if (location.hash === '#submit')
112 +                submitResults();
113 +        }
114 +
115 +        function submitResults()
116 +        {
117 +            var results = {
118 +                'content-animation' : {
119 +                    'metrics' : {
120 +                        'FrameRate' : ['Arithmetic']
121 +                    },
122 +                    'tests' : {
123 +                        'raf-animation' : {
124 +                            'metrics' : {
125 +                                'FrameRate' : {
126 +                                    'current' : ['<native_framerate>'] // <native_framerate> is replaced by a framerate computed in native code
127 +                                }
128 +                            }
129 +                        }
130 +                    }
131 +                }
132 +            };
133 +            var resultsString = JSON.stringify(results);
134 +            window.webdriver_results = resultsString;
135          }
136          
137          window.addEventListener('load', setupAnimation, false);
138 +        window.addEventListener("hashchange", hashChanged, false);
139      </script>
140  </head>
141  <body>
142 diff --git a/svg-animation.html b/svg-animation.html
143 index c286d50cc7e0e6d64e1b6fbd2beb3642fe90e958..fb21d522ca200021d452595cbfed3db252c80929 100644
144 --- a/svg-animation.html
145 +++ b/svg-animation.html
146 @@ -150,9 +150,42 @@
147          function setupAnimation()
148          {
149              makeParticles();
150 +
151 +            window.setTimeout(function() {
152 +                location.hash = 'done';
153 +            }, 10000)
154 +        }
155 +
156 +        function hashChanged()
157 +        {
158 +            if (location.hash === '#submit')
159 +                submitResults();
160 +        }
161 +
162 +        function submitResults()
163 +        {
164 +            var results = {
165 +                'content-animation' : {
166 +                    'metrics' : {
167 +                        'FrameRate' : ['Arithmetic']
168 +                    },
169 +                    'tests' : {
170 +                        'svg-animation' : {
171 +                            'metrics' : {
172 +                                'FrameRate' : {
173 +                                    'current' : ['<native_framerate>'] // <native_framerate> is replaced by a framerate computed in native code
174 +                                }
175 +                            }
176 +                        }
177 +                    }
178 +                }
179 +            };
180 +            var resultsString = JSON.stringify(results);
181 +            window.webdriver_results = resultsString;
182          }
183          
184          window.addEventListener('load', setupAnimation, false);
185 +        window.addEventListener("hashchange", hashChanged, false);
186      </script>
187  </head>
188  <body>