2 # Copyright 2013 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
6 """Records or runs web-page-replay data for InstantExtendedManualTests.*.
9 $ cd src/chrome/test/data/search/tools/
10 $ sudo instant_extended_manual_tests.py record \
11 ../../../../../third_party/webpagereplay/replay.py \
12 ../../../../../out/Debug/interactive_ui_tests \
15 This will create the archive.wpr file against the lastest google.com GWS.
16 The tests then can be isolated from the live site by replaying this captured
19 This archive.wpr file should be re-recorded and checked into the repo whenever
20 new manual tests are created.
28 print 'Usage: sudo python instant_extended_manual_tests.py (record|run) \\'
29 print ' <path/to/replay> <path/to/ui_tests> <path/to/data>'
32 def ReplayTests(replay_path
, test_path
, data_path
, arg
=None):
33 # Start up web-page-replay.
35 p
= subprocess
.Popen([replay_path
, data_path
])
37 p
= subprocess
.Popen([replay_path
, arg
, data_path
])
39 # Run the tests within the mock server.
40 return_value
= subprocess
.call(
42 '--gtest_filter=InstantExtendedManualTest.*',
44 '--enable-benchmarking',
45 '--enable-stats-table',
46 '--ignore-certificate-errors'])
48 # Shut down web-page-replay and save the recorded session to |data_path|.
49 p
.send_signal(signal
.SIGINT
)
54 if len(sys
.argv
) != 5:
57 if sys
.argv
[1] == 'record':
58 return ReplayTests(sys
.argv
[2], sys
.argv
[3], sys
.argv
[4], '--record')
60 if sys
.argv
[1] == 'run':
61 return ReplayTests(sys
.argv
[2], sys
.argv
[3], sys
.argv
[4])
65 if __name__
== '__main__':