Changeset 84165 in webkit


Ignore:
Timestamp:
Apr 18, 2011 12:04:33 PM (13 years ago)
Author:
ojan@chromium.org
Message:

2011-04-18 Ojan Vafai <ojan@chromium.org>

Reviewed by Eric Seidel.

add labels to results html page
https://bugs.webkit.org/show_bug.cgi?id=58803

-fix iframe size to be the size of the png results
-fix a bunch of aesthetic nits
-fix some incorrectly styled code

  • Scripts/webkitpy/layout_tests/layout_package/json_results.html:
Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r84160 r84165  
     12011-04-18  Ojan Vafai  <ojan@chromium.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        add labels to results html page
     6        https://bugs.webkit.org/show_bug.cgi?id=58803
     7
     8        -fix iframe size to be the size of the png results
     9        -fix a bunch of aesthetic nits
     10        -fix some incorrectly styled code
     11
     12        * Scripts/webkitpy/layout_tests/layout_package/json_results.html:
     13
    1142011-04-18  Chang Shu  <cshu@webkit.org>
    215
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/json_results.html

    r84086 r84165  
    11<!DocType html>
    22<style>
     3body {
     4    margin: 4px;
     5}
     6
     7body > p:first-of-type {
     8    margin-top: 0;
     9}
     10
    311tr:first-of-type:hover {
    412    opacity: 0.7
     
    3139
    3240.results-row iframe {
    33     width: 600px;
    34     height: 400px;
     41    width: 800px;
     42    height: 600px;
    3543}
    3644
    3745#options {
    3846    position: absolute;
    39     top: 0;
    40     right: 0;
     47    top: 4px;
     48    right: 4px;
    4149}
    4250
     
    5765    left: 1px;
    5866}
     67
     68.result-container {
     69    display: inline-block;
     70    border: 1px solid gray;
     71}
     72
     73.result-container iframe, .result-container img {
     74    border: 0;
     75    border-top: 1px solid lightgray;
     76}
     77
     78.label {
     79    padding-left: 3px;
     80    font-weight: bold;
     81    font-size: small;
     82}
    5983</style>
    6084
     
    103127function appendResultIframe(src, parent)
    104128{
    105     // FIXME: label the iframes appropriately
    106     var result = document.createElement('iframe');
    107     result.src = src;
    108     parent.appendChild(result);
     129    // FIXME: use IMG tags for pixel results.
     130    var layoutTestsIndex = src.indexOf('LayoutTests');
     131    var name;
     132    if (layoutTestsIndex != -1) {
     133        var hasTrac = src.indexOf('trac.webkit.org') != -1;
     134        var prefix = hasTrac ? 'trac.webkit.org/.../' : '';
     135        name = prefix + src.substring(layoutTestsIndex + 'LayoutTests/'.length);
     136    } else {
     137        var lastDashIndex = src.lastIndexOf('-pretty');
     138        if (lastDashIndex == -1)
     139            lastDashIndex = src.lastIndexOf('-');
     140        name = src.substring(lastDashIndex + 1);
     141    }
     142
     143    var container = document.createElement('div');
     144    container.className = 'result-container';
     145    container.innerHTML = '<div class=label>' + name + '</div><iframe src="' + src + '?format=txt"></iframe>';
     146    parent.appendChild(container);
    109147}
    110148
     
    150188function testLink(test)
    151189{
    152     var test_base_path;
     190    var basePath;
    153191    if (results.layout_tests_dir && location.toString().indexOf('file://') == 0)
    154         test_base_path = results.layout_tests_dir + '/';
     192        basePath = results.layout_tests_dir + '/';
    155193    else
    156         test_base_path = 'http://trac.webkit.org/browser/trunk/LayoutTests/';
     194        basePath = 'http://trac.webkit.org/browser/trunk/LayoutTests/';
    157195    return '<span class=expand-button onclick="expandExpectations(event)"><span class=expand-button-text>+</span></span>' +
    158         '<a class=test-link href="' + test_base_path + test + '">' + test + '</a>';
    159 }
    160 
    161 function resultLink(test_prefix, suffix, contents)
    162 {
    163     return '<a class=result-link href="' + test_prefix + suffix + '">' + contents + '</a> ';
     196        '<a class=test-link href="' + basePath + test + '">' + test + '</a>';
     197}
     198
     199function resultLink(testPrefix, suffix, contents)
     200{
     201    return '<a class=result-link href="' + testPrefix + suffix + '">' + contents + '</a> ';
    164202}
    165203
     
    244282}
    245283
     284// FIXME: We need to append image results here as well?
    246285if (newTests.length)
    247286    appendTestList(newTests, 'Tests that had no expected results (probably new):', 'new-tests-table', '-actual.txt', 'result');
Note: See TracChangeset for help on using the changeset viewer.