| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 grid.addResults(['http://example.com/layout-test-results/foo-bar-crash-log.t
xt']); | 120 grid.addResults(['http://example.com/layout-test-results/foo-bar-crash-log.t
xt']); |
| 121 equal(grid.innerHTML, '<iframe class="text-result" src="http://example.com/l
ayout-test-results/foo-bar-crash-log.txt"></iframe>'); | 121 equal(grid.innerHTML, '<iframe class="text-result" src="http://example.com/l
ayout-test-results/foo-bar-crash-log.txt"></iframe>'); |
| 122 }); | 122 }); |
| 123 | 123 |
| 124 test("results.ResultsGrid (empty)", 1, function() { | 124 test("results.ResultsGrid (empty)", 1, function() { |
| 125 var grid = new ui.results.ResultsGrid() | 125 var grid = new ui.results.ResultsGrid() |
| 126 grid.addResults([]); | 126 grid.addResults([]); |
| 127 equal(grid.innerHTML, 'No results to display.'); | 127 equal(grid.innerHTML, 'No results to display.'); |
| 128 }); | 128 }); |
| 129 | 129 |
| 130 test("time", 6, function() { | |
| 131 var time = new ui.RelativeTime(); | |
| 132 equal(time.tagName, 'TIME'); | |
| 133 equal(time.className, 'relative'); | |
| 134 deepEqual(Object.getOwnPropertyNames(time.__proto__).sort(), [ | |
| 135 'date', | |
| 136 'init', | |
| 137 'setDate', | |
| 138 'update', | |
| 139 ]); | |
| 140 equal(time.outerHTML, '<time class="relative"></time>'); | |
| 141 var tenMinutesAgo = new Date(); | |
| 142 tenMinutesAgo.setMinutes(tenMinutesAgo.getMinutes() - 10); | |
| 143 time.setDate(tenMinutesAgo); | |
| 144 equal(time.outerHTML, '<time class="relative">10 minutes ago</time>'); | |
| 145 equal(time.date().getTime(), tenMinutesAgo.getTime()); | |
| 146 }); | |
| 147 | |
| 148 test("StatusArea", 3, function() { | 130 test("StatusArea", 3, function() { |
| 149 var statusArea = new ui.StatusArea(); | 131 var statusArea = new ui.StatusArea(); |
| 150 var id = statusArea.newId(); | 132 var id = statusArea.newId(); |
| 151 statusArea.addMessage(id, 'First Message'); | 133 statusArea.addMessage(id, 'First Message'); |
| 152 statusArea.addMessage(id, 'Second Message'); | 134 statusArea.addMessage(id, 'Second Message'); |
| 153 equal(statusArea.outerHTML, | 135 equal(statusArea.outerHTML, |
| 154 '<div class="status processing" style="visibility: visible;">' + | 136 '<div class="status processing" style="visibility: visible;">' + |
| 155 '<ul class="actions"><li><button class="action">Close</button></li><
/ul>' + | 137 '<ul class="actions"><li><button class="action">Close</button></li><
/ul>' + |
| 156 '<progress class="process-text">Processing...</progress>' + | 138 '<progress class="process-text">Processing...</progress>' + |
| 157 '<div id="status-content-1" class="status-content">' + | 139 '<div id="status-content-1" class="status-content">' + |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 '</table>' + | 379 '</table>' + |
| 398 '</details>' + | 380 '</details>' + |
| 399 ', trunk is at <a href="http://src.chromium.org/viewvc/blink?vie
w=rev&revision=555">555</a>' + | 381 ', trunk is at <a href="http://src.chromium.org/viewvc/blink?vie
w=rev&revision=555">555</a>' + |
| 400 '<br>' + | 382 '<br>' + |
| 401 '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>'); | 383 '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>'); |
| 402 start(); | 384 start(); |
| 403 }); | 385 }); |
| 404 }); | 386 }); |
| 405 | 387 |
| 406 })(); | 388 })(); |
| OLD | NEW |