OLD | NEW |
1 # -*- python -*- | 1 # -*- python -*- |
2 # Copyright (c) 2011 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2011 The Native Client Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 # Test startup time for loading a basic PPAPI nexe in the browser. | 6 # Test startup time for loading a basic PPAPI nexe in the browser. |
7 | 7 |
8 Import('env') | 8 Import('env') |
9 | 9 |
10 # Pull in the ppapi_test_example as a "barebones" PPAPI startup example. | 10 # Pull in the ppapi_test_example as a "barebones" PPAPI startup example. |
11 # Hope it does not change to do more than just the barebones. | 11 # Hope it does not change to do more than just the barebones. |
12 # We must make a separate build though, to get a different nexe "key" | 12 # We must make a separate build though, to get a different nexe "key" |
13 # for the env.Publish() / env.ExtractPublishedFiles() magic. | 13 # for the env.Publish() / env.ExtractPublishedFiles() magic. |
14 nexe = 'browser_startup_time_%s.nexe' % env.get('TARGET_FULLARCH') | 14 nexe_name = 'browser_startup_time_${TARGET_FULLARCH}' |
15 | 15 |
16 # Build object file separately to prevent crud left in the source directory. | 16 # Build object file separately to prevent crud left in the source directory. |
17 browser_startup_obj = env.ComponentObject( | 17 browser_startup_obj = env.ComponentObject( |
18 'pnacl_test_example', | 18 'pnacl_test_example', |
19 '${SCONSTRUCT_DIR}/tests/ppapi_test_example/ppapi_test_example.cc') | 19 '${SCONSTRUCT_DIR}/tests/ppapi_test_example/ppapi_test_example.cc') |
20 | 20 |
21 browser_startup_nexe = env.ComponentProgram( | 21 browser_startup_nexe = env.ComponentProgram( |
22 nexe, | 22 nexe_name, |
23 [browser_startup_obj], | 23 [browser_startup_obj], |
24 EXTRA_LIBS=['${PPAPI_LIBS}', | 24 EXTRA_LIBS=['${PPAPI_LIBS}', |
25 'ppapi_test_lib', | 25 'ppapi_test_lib', |
26 'platform', # for CHECK | 26 'platform', # for CHECK |
27 'pthread', | 27 'pthread', |
28 'gio', | 28 'gio', |
29 ]) | 29 ]) |
30 | 30 |
31 # Borrow the smoke tests. | 31 # Borrow the smoke tests. |
32 borrowed_files = [env.File('${STAGING_DIR}/ppapi_test_example.js')] | 32 borrowed_files = [env.File('${STAGING_DIR}/ppapi_test_example.js')] |
33 | 33 |
34 env.Publish(nexe, 'run', | 34 env.Publish(nexe_name, 'run', |
35 ['browser_startup_time.html', | 35 ['browser_startup_time.html', |
36 'browser_startup_time.nmf', | 36 'browser_startup_time.nmf', |
37 'browser_startup_time.js']) | 37 'browser_startup_time.js']) |
38 | 38 |
39 test_name = 'browser_startup_time.out' | 39 test_name = 'browser_startup_time.out' |
40 output_processor = ['${PYTHON}', | 40 output_processor = ['${PYTHON}', |
41 str(env.File( | 41 str(env.File( |
42 '${SCONSTRUCT_DIR}/tools/process_perf_output.py')), | 42 '${SCONSTRUCT_DIR}/tools/process_perf_output.py')), |
43 test_name, | 43 test_name, |
44 env.GetPerfEnvDescription()] | 44 env.GetPerfEnvDescription()] |
45 | 45 |
46 node = env.PPAPIBrowserTester( | 46 node = env.PPAPIBrowserTester( |
47 test_name, | 47 test_name, |
48 url='browser_startup_time.html', | 48 url='browser_startup_time.html', |
49 files=env.ExtractPublishedFiles(nexe) + borrowed_files, | 49 files=env.ExtractPublishedFiles(nexe_name) + borrowed_files, |
50 args=['--enable_experimental_js'], | 50 args=['--enable_experimental_js'], |
51 process_output=output_processor, | 51 process_output=output_processor, |
52 # Assume verbosity level of 1 will give us NaClLogs for sel_ldr times. | 52 # Assume verbosity level of 1 will give us NaClLogs for sel_ldr times. |
53 log_verbosity=1) | 53 log_verbosity=1) |
54 | 54 |
55 # TODO(jvoung): use a single test suite when either | 55 # TODO(jvoung): use a single test suite when either |
56 # (a) performance_tests are always run, or | 56 # (a) performance_tests are always run, or |
57 # (b) we have decided to just fold this test into chrome_browser_tests. | 57 # (b) we have decided to just fold this test into chrome_browser_tests. |
58 test_suites = ['chrome_browser_tests', 'performance_tests'] | 58 test_suites = ['chrome_browser_tests', 'performance_tests'] |
59 env.AddNodeToTestSuite(node, | 59 env.AddNodeToTestSuite(node, |
60 test_suites, | 60 test_suites, |
61 'run_browser_startup_time_test', | 61 'run_browser_startup_time_test', |
62 # This test relies on NACLLOG, which must be able to | 62 # This test relies on NACLLOG, which must be able to |
63 # open a file. This won't work with the outer sandbox | 63 # open a file. This won't work with the outer sandbox |
64 # which is enabled in some cases. | 64 # which is enabled in some cases. |
65 is_broken=env.PPAPIBrowserTesterIsBroken() or | 65 is_broken=env.PPAPIBrowserTesterIsBroken() or |
66 env.Bit('disable_dynamic_plugin_loading')) | 66 env.Bit('disable_dynamic_plugin_loading')) |
67 | 67 |
68 # Also check the size of this nexe. | 68 # Also check the size of this nexe. |
69 node = env.FileSizeTest('browser_startup_size.out', | 69 node = env.FileSizeTest('browser_startup_size.out', |
70 nexe) | 70 browser_startup_nexe) |
71 env.AddNodeToTestSuite(node, | 71 env.AddNodeToTestSuite(node, |
72 test_suites, | 72 test_suites, |
73 'run_browser_startup_size_test') | 73 'run_browser_startup_size_test') |
OLD | NEW |