OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 onebar.select('expected'); | 67 onebar.select('expected'); |
68 equal(window.location.hash, '#expected'); | 68 equal(window.location.hash, '#expected'); |
69 onebar.select('unexpected'); | 69 onebar.select('unexpected'); |
70 equal(window.location.hash, '#unexpected'); | 70 equal(window.location.hash, '#unexpected'); |
71 | 71 |
72 $(onebar).detach(); | 72 $(onebar).detach(); |
73 }); | 73 }); |
74 | 74 |
75 // FIXME: These three results.* tests should be moved ot ui/results_unittests.js
. | 75 // FIXME: These three results.* tests should be moved ot ui/results_unittests.js
. |
76 test("results.ResultsGrid", 1, function() { | 76 test("results.ResultsGrid", 5, function() { |
77 var grid = new ui.results.ResultsGrid() | 77 var grid = new ui.results.ResultsGrid() |
78 grid.addResults([ | 78 grid.addResults([ |
79 'http://example.com/layout-test-results/foo-bar-diff.txt', | 79 'http://example.com/layout-test-results/foo-bar-diff.txt', |
80 'http://example.com/layout-test-results/foo-bar-expected.png', | 80 'http://example.com/layout-test-results/foo-bar-expected.png', |
81 'http://example.com/layout-test-results/foo-bar-actual.png', | 81 'http://example.com/layout-test-results/foo-bar-actual.png', |
82 'http://example.com/layout-test-results/foo-bar-diff.png', | 82 'http://example.com/layout-test-results/foo-bar-diff.png', |
83 ]); | 83 ]); |
84 equal(grid.innerHTML, | 84 |
85 '<div class="comparison">' + | 85 var comparisons = grid.querySelectorAll('results-comparison'); |
86 '<div>' + | 86 equal(comparisons.length, 2); |
87 '<h2>Expected</h2>' + | 87 |
88 '<div class="results-container expected">' + | 88 equal(comparisons[0].type, 'text'); |
89 '<img class="image-result" src="http://example.com/layout-te
st-results/foo-bar-expected.png">' + | 89 deepEqual(comparisons[0].urlsByKind, { |
90 '</div>' + | 90 "diff": "http://example.com/layout-test-results/foo-bar-diff.txt" |
91 '</div>' + | 91 }); |
92 '<div>' + | 92 |
93 '<h2>Actual</h2>' + | 93 equal(comparisons[1].type, 'image'); |
94 '<div class="results-container actual">' + | 94 deepEqual(comparisons[1].urlsByKind, { |
95 '<img class="image-result" src="http://example.com/layout-te
st-results/foo-bar-actual.png">' + | 95 "expected": "http://example.com/layout-test-results/foo-bar-expected.png
", |
96 '</div>' + | 96 "actual": "http://example.com/layout-test-results/foo-bar-actual.png", |
97 '</div>' + | 97 "diff": "http://example.com/layout-test-results/foo-bar-diff.png" |
98 '<div>' + | 98 }); |
99 '<h2>Diff</h2>' + | |
100 '<div class="results-container diff">' + | |
101 '<img class="image-result" src="http://example.com/layout-te
st-results/foo-bar-diff.png">' + | |
102 '</div>' + | |
103 '</div>' + | |
104 '</div>' + | |
105 '<div class="comparison">' + | |
106 '<div>' + | |
107 '<h2>Expected</h2>' + | |
108 '<div class="results-container expected"></div>' + | |
109 '</div>' + | |
110 '<div>' + | |
111 '<h2>Actual</h2>' + | |
112 '<div class="results-container actual"></div>' + | |
113 '</div>' + | |
114 '<div>' + | |
115 '<h2>Diff</h2>' + | |
116 '<div class="results-container diff">' + | |
117 '<iframe class="text-result" src="http://example.com/layout-
test-results/foo-bar-diff.txt"></iframe>' + | |
118 '</div>' + | |
119 '</div>' + | |
120 '</div>'); | |
121 }); | 99 }); |
122 | 100 |
123 test("results.ResultsGrid (crashlog)", 1, function() { | 101 test("results.ResultsGrid (crashlog)", 1, function() { |
124 var grid = new ui.results.ResultsGrid() | 102 var grid = new ui.results.ResultsGrid() |
125 grid.addResults(['http://example.com/layout-test-results/foo-bar-crash-log.t
xt']); | 103 grid.addResults(['http://example.com/layout-test-results/foo-bar-crash-log.t
xt']); |
126 equal(grid.innerHTML, '<iframe class="text-result" src="http://example.com/l
ayout-test-results/foo-bar-crash-log.txt"></iframe>'); | 104 equal(grid.innerHTML, '<iframe src="http://example.com/layout-test-results/f
oo-bar-crash-log.txt" '+ |
| 105 'style="border: 0px; width: 100%; height: 400px;"></iframe>'); |
127 }); | 106 }); |
128 | 107 |
129 test("results.ResultsGrid (empty)", 1, function() { | 108 test("results.ResultsGrid (empty)", 1, function() { |
130 var grid = new ui.results.ResultsGrid() | 109 var grid = new ui.results.ResultsGrid() |
131 grid.addResults([]); | 110 grid.addResults([]); |
132 equal(grid.innerHTML, 'No results to display.'); | 111 equal(grid.innerHTML, 'No results to display.'); |
133 }); | 112 }); |
134 | 113 |
135 test("StatusArea", 3, function() { | 114 test("StatusArea", 3, function() { |
136 var statusArea = new ui.StatusArea(); | 115 var statusArea = new ui.StatusArea(); |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 '</table>' + | 372 '</table>' + |
394 '</details>' + | 373 '</details>' + |
395 ', trunk is at <a href="http://src.chromium.org/viewvc/blink?vie
w=rev&revision=555">555</a>' + | 374 ', trunk is at <a href="http://src.chromium.org/viewvc/blink?vie
w=rev&revision=555">555</a>' + |
396 '<br>' + | 375 '<br>' + |
397 'Last roll is to <a href="http://src.chromium.org/viewvc/blink?v
iew=rev&revision=440">440</a><span class="critical">(115 revisions behind)</
span>, current autoroll <a href="https://codereview.chromium.org/1000">440:550</
a>'); | 376 'Last roll is to <a href="http://src.chromium.org/viewvc/blink?v
iew=rev&revision=440">440</a><span class="critical">(115 revisions behind)</
span>, current autoroll <a href="https://codereview.chromium.org/1000">440:550</
a>'); |
398 start(); | 377 start(); |
399 }); | 378 }); |
400 }); | 379 }); |
401 | 380 |
402 })(); | 381 })(); |
OLD | NEW |