Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: LayoutTests/paint/invalidation/spv2/resources/convert.sh

Issue 1302183007: Convert some text-based-repaint tests for spv2 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 #!/bin/bash
2
pdr. 2015/09/02 05:25:48 This is a little rough to check in. WDYT about jus
3 if [ "$#" != "1" ]; then
4 echo "Convert a text-based-repaint test into a spv2 paint invalidation test. "
5 echo "Usage: convert.sh <relative-path-of-repaint-test-under-LayoutTests"
6 echo "Need to manually edit the generated -expected.html."
7 exit 1
8 fi
9
10 cd `dirname $0`/../../../..
11
12 newfile=`echo $1 | sed 's#.*/#paint/invalidation/spv2/#'`
13 echo New file: $newfile
14
15 expectedtxt=`echo $1 | sed 's/\.html/-expected.txt/'`
16 expectedtxt=`ls $expectedtxt* platform/{win,linux,mac}/$expectedtxt 2>/dev/null | head -1`
17 if [ ! -f "$expectedtxt" ]; then
18 echo "No -expected.txt for the test"
19 exit 1
20 fi
21
22 indent=`grep 'repaintTest()' $1|sed 's/\(^ *\).*$/\1/'`
23 expectedobj=/tmp/expected-paint-invalidation-objects
24 grep '^ *"[^"]*",\?$' $expectedtxt | sed "s/^ */$indent /;s/\$/,/;s/,,\$/,/" >$expectedobj
25 testdir=`dirname $1`
26
27 sed "s#\\([(='\"]\\)\\([-_\\.a-zA-Z0-9/]*resources/\)#\\1../../../$testdir/\\2#
28 / repaintTest()/ {
29 i\\${indent}window.expectedPaintInvalidationObjects = [
30 h
31 r $expectedobj
32 g
33 N
34 i\\${indent}];
35 }
36 s/ repaintTest()/ paintInvalidationTest()/
37 s/runRepaintTest/runPaintInvalidationTest/
38 s/finishRepaintTest/finishPaintInvalidationTest/
39 s/src=.*\/text-based-repaint.js/src=\"resources\/paint-invalidation-test.js /
40 1i\<\!-- Based on $1 --\>
41 " $1 > $newfile
42
43 expected=`echo $newfile | sed 's/\.html/-expected.html/'`
44 echo Expected: $expected
45 sed "s#\\([(='\"]\\)\\([-_\\.a-zA-Z0-9/]*resources/\)#\\1../../../$testdir/\\2#
46 s/ onload=.runRepaintTest();\\?.//
47 /text-based-repaint.js/d
48 " $1 > $expected
49
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698