DescriptionAdded support for layout render tests. These use expected values for the text render output from DumpRenderTree. When running a test in DRT the testrunner will see if there is a file with a .render extension in the same directory as the test file and with the same base file name. If so it will do additional checks of the rendered layout.
Here is a simple example test:
#library('sample');
#import('dart:html');
#import('pkg:unittest/unittest.dart');
main() {
group('foo', () {
test('test 1', () {
document.body.nodes.add(new Element.html("<p>Test 1</p>"));
});
test('test 2', () {
document.body.nodes.add(new Element.html("<p>Test 2</p>"));
});
});
}
And a sample matching .render file:
[foo test 1]
RenderBlock {P} at (0,0) size 284x20
RenderText {#text} at (0,0) size 38x19
text run at (0,0) width 38: "Test 1"
[foo test 2]
RenderBlock {P} at (0,0) size 284x20
RenderText {#text} at (0,0) size 38x19
text run at (0,0) width 38: "Test 2"
Note that the render content is only the content inside the <body> element, not including the body element itself.
testrunner can generate render files itself if you use the --generate-renders flag.
Also in this change - rename Configuration.log to trace, to avoid clash with the math log() function.
Committed: https://code.google.com/p/dart/source/detail?r=11994
Patch Set 1 #
Total comments: 18
Patch Set 2 : #Patch Set 3 : #Patch Set 4 : #Patch Set 5 : #Patch Set 6 : #
Messages
Total messages: 4 (0 generated)
|