~ubuntu-branches/ubuntu/raring/qtwebkit-source/raring-proposed

« back to all changes in this revision

Viewing changes to Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/perf_unittests.js

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2013-02-18 14:24:18 UTC
  • Revision ID: package-import@ubuntu.com-20130218142418-eon0jmjg3nj438uy
Tags: upstream-2.3
ImportĀ upstreamĀ versionĀ 2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2012 Google Inc. All rights reserved.
 
3
 *
 
4
 * Redistribution and use in source and binary forms, with or without
 
5
 * modification, are permitted provided that the following conditions
 
6
 * are met:
 
7
 * 1. Redistributions of source code must retain the above copyright
 
8
 *    notice, this list of conditions and the following disclaimer.
 
9
 * 2. Redistributions in binary form must reproduce the above copyright
 
10
 *    notice, this list of conditions and the following disclaimer in the
 
11
 *    documentation and/or other materials provided with the distribution.
 
12
 *
 
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 
14
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 
15
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 
16
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 
17
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 
18
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 
19
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 
20
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 
21
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 
22
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 
23
 * THE POSSIBILITY OF SUCH DAMAGE.
 
24
 */
 
25
 
 
26
(function () {
 
27
 
 
28
module('ui.perf');
 
29
 
 
30
var kDummyPerfGraphData = {
 
31
    "dummy_perf_test_1": [
 
32
        {
 
33
            "builder": "Mac10.6 Perf",
 
34
            "url": "http://dummyurl1"
 
35
        }
 
36
    ],
 
37
    "dummy_perf_test_2": [
 
38
        {
 
39
            "builder": "Mac10.6 Perf",
 
40
            "url": "http://dummyurl2"
 
41
        },
 
42
        {
 
43
            "builder": "Linux Perf",
 
44
            "url": "http://dummyurl3"
 
45
        }
 
46
    ]
 
47
};
 
48
 
 
49
asyncTest("View", 7, function() {
 
50
    var oldPerfBuilders = builders.perfBuilders;
 
51
    builders.perfBuilders = function(callback) {
 
52
        setTimeout(function() { callback(kDummyPerfGraphData) }, 0);
 
53
    }
 
54
 
 
55
    var view = new ui.perf.View();
 
56
 
 
57
    setTimeout(function() {
 
58
        equal(view.outerHTML, '<div id="perf-view">' +
 
59
            '<ol class="notifications">' +
 
60
                '<li style="opacity: 0; ">' +
 
61
                    '<div class="how"></div><div class="what">Loading list of perf dashboards...</div>' +
 
62
                '</li>' +
 
63
            '</ol>' +
 
64
            '<div class="title-bar">' +
 
65
                '<select><option>dummy_perf_test_1</option><option>dummy_perf_test_2</option></select>' +
 
66
                '<ul class="actions"><li><button class="action previous">\u25C0</button></li><li><button class="action next">\u25B6</button></li></ul>' +
 
67
                '<select><option value="http://dummyurl1">Mac10.6 Perf</option></select>' +
 
68
                '<a class="pop-out" target="_blank" href="http://dummyurl1">Pop out</a>' +
 
69
            '</div>' +
 
70
            '<iframe src="http://dummyurl1"></iframe>' +
 
71
        '</div>');
 
72
 
 
73
        view._nextGraph();
 
74
 
 
75
        equal(view.outerHTML, '<div id="perf-view">' +
 
76
            '<ol class="notifications">' +
 
77
                '<li style="opacity: 0; ">' +
 
78
                    '<div class="how"></div><div class="what">Loading list of perf dashboards...</div>' +
 
79
                '</li>' +
 
80
            '</ol>' +
 
81
            '<div class="title-bar">' +
 
82
                '<select><option>dummy_perf_test_1</option><option>dummy_perf_test_2</option></select>' +
 
83
                '<ul class="actions"><li><button class="action previous">\u25C0</button></li><li><button class="action next">\u25B6</button></li></ul>' +
 
84
                '<a class="pop-out" target="_blank" href="http://dummyurl2">Pop out</a>' +
 
85
                '<select><option value="http://dummyurl2">Mac10.6 Perf</option><option value="http://dummyurl3">Linux Perf</option></select>' +
 
86
            '</div>' +
 
87
            '<iframe src="http://dummyurl2"></iframe>' +
 
88
        '</div>');
 
89
 
 
90
        view._nextGraph();
 
91
 
 
92
        equal(view.outerHTML, '<div id="perf-view">' +
 
93
            '<ol class="notifications">' +
 
94
                '<li style="opacity: 0; ">' +
 
95
                    '<div class="how"></div><div class="what">Loading list of perf dashboards...</div>' +
 
96
                '</li>' +
 
97
            '</ol>' +
 
98
            '<div class="title-bar">' +
 
99
                '<select><option>dummy_perf_test_1</option><option>dummy_perf_test_2</option></select>' +
 
100
                '<ul class="actions"><li><button class="action previous">\u25C0</button></li><li><button class="action next">\u25B6</button></li></ul>' +
 
101
                '<a class="pop-out" target="_blank" href="http://dummyurl3">Pop out</a>' +
 
102
                '<select><option value="http://dummyurl2">Mac10.6 Perf</option><option value="http://dummyurl3">Linux Perf</option></select>' +
 
103
            '</div>' +
 
104
            '<iframe src="http://dummyurl3"></iframe>' +
 
105
        '</div>');
 
106
 
 
107
        view._nextGraph();
 
108
 
 
109
        equal(view.outerHTML, '<div id="perf-view">' +
 
110
            '<ol class="notifications">' +
 
111
                '<li style="opacity: 0; ">' +
 
112
                    '<div class="how"></div><div class="what">Loading list of perf dashboards...</div>' +
 
113
                '</li>' +
 
114
            '</ol>' +
 
115
            '<div class="title-bar">' +
 
116
                '<select><option>dummy_perf_test_1</option><option>dummy_perf_test_2</option></select>' +
 
117
                '<ul class="actions"><li><button class="action previous">\u25C0</button></li><li><button class="action next">\u25B6</button></li></ul>' +
 
118
                '<a class="pop-out" target="_blank" href="http://dummyurl3">Pop out</a>' +
 
119
                '<select><option value="http://dummyurl2">Mac10.6 Perf</option><option value="http://dummyurl3">Linux Perf</option></select>' +
 
120
            '</div>' +
 
121
            '<iframe src="http://dummyurl3"></iframe>' +
 
122
        '</div>');
 
123
 
 
124
        view._previousGraph();
 
125
 
 
126
        equal(view.outerHTML, '<div id="perf-view">' +
 
127
            '<ol class="notifications">' +
 
128
                '<li style="opacity: 0; ">' +
 
129
                    '<div class="how"></div><div class="what">Loading list of perf dashboards...</div>' +
 
130
                '</li>' +
 
131
            '</ol>' +
 
132
            '<div class="title-bar">' +
 
133
                '<select><option>dummy_perf_test_1</option><option>dummy_perf_test_2</option></select>' +
 
134
                '<ul class="actions"><li><button class="action previous">\u25C0</button></li><li><button class="action next">\u25B6</button></li></ul>' +
 
135
                '<a class="pop-out" target="_blank" href="http://dummyurl2">Pop out</a>' +
 
136
                '<select><option value="http://dummyurl2">Mac10.6 Perf</option><option value="http://dummyurl3">Linux Perf</option></select>' +
 
137
            '</div>' +
 
138
            '<iframe src="http://dummyurl2"></iframe>' +
 
139
        '</div>');
 
140
 
 
141
        view._previousGraph();
 
142
 
 
143
        equal(view.outerHTML, '<div id="perf-view">' +
 
144
            '<ol class="notifications">' +
 
145
                '<li style="opacity: 0; ">' +
 
146
                    '<div class="how"></div><div class="what">Loading list of perf dashboards...</div>' +
 
147
                '</li>' +
 
148
            '</ol>' +
 
149
            '<div class="title-bar">' +
 
150
                '<select><option>dummy_perf_test_1</option><option>dummy_perf_test_2</option></select>' +
 
151
                '<ul class="actions"><li><button class="action previous">\u25C0</button></li><li><button class="action next">\u25B6</button></li></ul>' +
 
152
                '<a class="pop-out" target="_blank" href="http://dummyurl1">Pop out</a>' +
 
153
                '<select><option value="http://dummyurl1">Mac10.6 Perf</option></select>' +
 
154
            '</div>' +
 
155
            '<iframe src="http://dummyurl1"></iframe>' +
 
156
        '</div>');
 
157
 
 
158
        view._previousGraph();
 
159
 
 
160
        equal(view.outerHTML, '<div id="perf-view">' +
 
161
            '<ol class="notifications">' +
 
162
                '<li style="opacity: 0; ">' +
 
163
                    '<div class="how"></div><div class="what">Loading list of perf dashboards...</div>' +
 
164
                '</li>' +
 
165
            '</ol>' +
 
166
            '<div class="title-bar">' +
 
167
                '<select><option>dummy_perf_test_1</option><option>dummy_perf_test_2</option></select>' +
 
168
                '<ul class="actions"><li><button class="action previous">\u25C0</button></li><li><button class="action next">\u25B6</button></li></ul>' +
 
169
                '<a class="pop-out" target="_blank" href="http://dummyurl1">Pop out</a>' +
 
170
                '<select><option value="http://dummyurl1">Mac10.6 Perf</option></select>' +
 
171
            '</div>' +
 
172
            '<iframe src="http://dummyurl1"></iframe>' +
 
173
        '</div>');
 
174
 
 
175
        builders.perfBuilders = oldPerfBuilders;
 
176
        start();
 
177
    }, 0);
 
178
});
 
179
 
 
180
})();