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

Side by Side Diff: third_party/tcmalloc/chromium/src/gmail-send-self-test

Issue 7865021: Deep-Memory-Profiler (DMP) implementation (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fixed bugs Created 9 years, 2 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
3 # Account setting that will be used in the testing.
4 # Any account with keyboard-shortcuts enabled can be used.
5 account=chromememorytest
6 password=bigmemory
7
8 chrome=$(pwd)/out/Debug/chrome # chrome binary
9 outdir=$(pwd)/o$$ # output directory
10 heapdir=$outdir/heap/ # where to dump logs
11 datadir=$outdir/data/ # for user data
12 dumptime=30 # seconds between dumps
13
14 ctrl() {
15 if [ -z "$2" ]
16 then
17 xte <<EOF
18 keydown Control_L
19 str $1
20 keyup Control_L
21 EOF
22 else
23 [ "x$1" == "xshift" ] || exit 7
24 xte <<EOF
25 keydown Control_L
26 usleep 150000
27 keydown Shift_L
28 usleep 150000
29 str $2
30 keyup Shift_L
31 keyup Control_L
32 EOF
33 fi
34 }
35
36 body() {
37 sleep 1
38 for j in `seq 1 50`;do
39 xte "str test-word$j "
40 done
41 xte "key Return"
42 xte "key Return"
43 xte "str John"
44 }
45
46 purge_memory() {
47 sleep 1
48
49 xte <<EOF
50 keydown Shift_L
51 usleep 150000
52 key Escape
53 usleep 150000
54 keyup Shift_L
55 EOF
56
57 sleep 1
58 xte "key Tab"
59 sleep 1
60 xte "key Tab"
61 sleep 1
62 xte "key Tab"
63 sleep 1
64 xte "key Return"
65 sleep 1
66 ctrl w
67 sleep 3
68 }
69
70 data0=$(for i in `seq 1 100`; do echo -n $i; done)
71 data1=$(sed "s/1/ a /g" <<<$data0)
72 data2=$(sed "s/3/ c /g" <<<$data1)
73
74 mkdir $outdir || exit 3
75 mkdir $heapdir || exit 3
76 echo Writing output to $outdir
77
78 echo initial chrome start
79 $chrome --no-sandbox --user-data-dir=$datadir >& /dev/null &
80
81 # Dismiss "which search engine?" choice
82 sleep 2
83 xte "key Tab"
84 xte "key Return"
85 sleep 5
86
87 ctrl l
88 ctrl w
89 sleep 1
90 ctrl shift q
91
92 echo chrome start
93 sleep 5
94 HEAPPROFILE=$heapdir/hprof HEAP_PROFILE_MMAP=true HEAP_PROFILE_TIME_INTERVAL=$du mptime $chrome --no-sandbox --user-data-dir=$datadir --password-store=basic --pu rge-memory-button www.gmail.com >& $outdir/browser-output &
95 #$chrome --no-sandbox --user-data-dir=$datadir --password-store=basic --purge-me mory-button www.gmail.com >& $outdir/browser-output &
96
97
98 # Must log in with username/password (necessary cookie ain't there, for whatever reason)
99 sleep 10
100
101 xte "str $account"
102 sleep 1
103 xte "key Tab"
104 sleep 1
105 xte "str $password"
106 sleep 1
107 xte "key Return"
108
109 sleep 25
110
111 cd $outdir || exit 5
112
113 for i in $(seq 1 100); do
114 echo $i
115
116 #if [ $((i % 20)) -eq 1 ]
117 #then
118 # sleep 300
119 #fi
120
121 xte "str uc" && sleep 5
122 xte "str ${account}@gmail.com," && sleep 4
123
124 if [ $((i % 10)) -eq 1 ]
125 then
126
127 # Here we click purge-memory button
128 ctrl t && sleep 2
129 purge_memory
130 ctrl w && sleep 2
131
132 # Save about:memory
133 ctrl t && xte "str about:memory" && xte "key Return" && sleep 4
134 import -window root screenshot${i}.png
135 ctrl s && sleep 2 && xte "str `pwd`/am$i" && xte "key Return" && sleep 3
136 ctrl w && sleep 4
137
138 nice top -b -n 1 > top$i &
139
140 # Save about:tcmalloc
141 ctrl t && xte "str about:tcmalloc" && xte "key Return" && sleep 4
142 ctrl r && sleep 4 # reload because about:tcmalloc gives stale info othe rwise!
143 ctrl s && sleep 2 && xte "str `pwd`/at$i" && xte "key Return" && sleep 3
144 ctrl w && sleep 4
145
146 # Save inbox
147 ctrl t && xte "str mail.google.com/mail/u/0/?ui=html&zy=a" && xte "key Retur n" && sleep 8
148 ctrl s && sleep 2 && xte "str `pwd`/inbox$i" && xte "key Return" && sleep 3
149 ctrl w && sleep 4
150
151 fi
152
153 xte "key Tab" && sleep 4
154 xte "str super duper subject $i" && sleep 4
155 xte "key Tab" && body && sleep 15 && xte "key Tab"
156 xte "key Return" && sleep 6
157 xte "str kk" && sleep 4 && xte "key Return" && sleep 4
158 xte "str kk" && sleep 4
159
160 done
161
162 ctrl shift q
OLDNEW
« no previous file with comments | « third_party/tcmalloc/chromium/src/dmprof ('k') | third_party/tcmalloc/chromium/src/heap-profile-table.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698