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

Side by Side Diff: tools/test-runtime.dart

Issue 12387010: Add --csp flag to test.dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix comment and update test-runtime.dart. Created 7 years, 9 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
« no previous file with comments | « tools/test.dart ('k') | tools/testing/dart/http_server.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env dart 1 #!/usr/bin/env dart
2 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 2 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
3 // for details. All rights reserved. Use of this source code is governed by a 3 // for details. All rights reserved. Use of this source code is governed by a
4 // BSD-style license that can be found in the LICENSE file. 4 // BSD-style license that can be found in the LICENSE file.
5 5
6 // TODO(ager): Get rid of this version of test.dart when we don't have 6 // TODO(ager): Get rid of this version of test.dart when we don't have
7 // to worry about the special runtime checkout anymore. 7 // to worry about the special runtime checkout anymore.
8 // This file is identical to test.dart with test suites in the 8 // This file is identical to test.dart with test suites in the
9 // directories samples, client, compiler, and utils removed. 9 // directories samples, client, compiler, and utils removed.
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 if (configurations == null) return; 43 if (configurations == null) return;
44 44
45 // Extract global options from first configuration. 45 // Extract global options from first configuration.
46 var firstConf = configurations[0]; 46 var firstConf = configurations[0];
47 Map<String, RegExp> selectors = firstConf['selectors']; 47 Map<String, RegExp> selectors = firstConf['selectors'];
48 var maxProcesses = firstConf['tasks']; 48 var maxProcesses = firstConf['tasks'];
49 var progressIndicator = firstConf['progress']; 49 var progressIndicator = firstConf['progress'];
50 var verbose = firstConf['verbose']; 50 var verbose = firstConf['verbose'];
51 var printTiming = firstConf['time']; 51 var printTiming = firstConf['time'];
52 var listTests = firstConf['list']; 52 var listTests = firstConf['list'];
53 var useContentSecurityPolicy = firstConf['csp'];
53 54
54 if (!firstConf['append_logs']) { 55 if (!firstConf['append_logs']) {
55 var file = new File(TestUtils.flakyFileName()); 56 var file = new File(TestUtils.flakyFileName());
56 if (file.existsSync()) { 57 if (file.existsSync()) {
57 file.deleteSync(); 58 file.deleteSync();
58 } 59 }
59 } 60 }
60 // Print the configurations being run by this execution of 61 // Print the configurations being run by this execution of
61 // test.dart. However, don't do it if the silent progress indicator 62 // test.dart. However, don't do it if the silent progress indicator
62 // is used. This is only needed because of the junit tests. 63 // is used. This is only needed because of the junit tests.
(...skipping 10 matching lines...) Expand all
73 } 74 }
74 75
75 var runningBrowserTests = configurations.any((config) { 76 var runningBrowserTests = configurations.any((config) {
76 return TestUtils.isBrowserRuntime(config['runtime']); 77 return TestUtils.isBrowserRuntime(config['runtime']);
77 }); 78 });
78 79
79 var testSuites = new List<TestSuite>(); 80 var testSuites = new List<TestSuite>();
80 for (var conf in configurations) { 81 for (var conf in configurations) {
81 if (!listTests && runningBrowserTests) { 82 if (!listTests && runningBrowserTests) {
82 // Start global http servers that serve the entire dart repo. 83 // Start global http servers that serve the entire dart repo.
83 // The http server is available on window.location.port, and a second 84 // The http server is available on window.location.port, and a second
84 // server for cross-domain tests can be found by calling 85 // server for cross-domain tests can be found by calling
85 // getCrossOriginPortNumber(). 86 // getCrossOriginPortNumber().
86 var servers = new TestingServers(new Path(TestUtils.buildDir(conf))); 87 var servers = new TestingServers(new Path(TestUtils.buildDir(conf)),
88 useContentSecurityPolicy);
87 servers.startServers('127.0.0.1'); 89 servers.startServers('127.0.0.1');
88 conf['_servers_'] = servers; 90 conf['_servers_'] = servers;
89 } 91 }
90 92
91 if (selectors.containsKey('co19')) { 93 if (selectors.containsKey('co19')) {
92 testSuites.add(new Co19TestSuite(conf)); 94 testSuites.add(new Co19TestSuite(conf));
93 } 95 }
94 96
95 if (conf['runtime'] == 'vm' && selectors.containsKey('vm')) { 97 if (conf['runtime'] == 'vm' && selectors.containsKey('vm')) {
96 // vm tests contain both cc tests (added here) and dart tests (added in 98 // vm tests contain both cc tests (added here) and dart tests (added in
(...skipping 25 matching lines...) Expand all
122 maxProcesses, 124 maxProcesses,
123 maxBrowserProcesses, 125 maxBrowserProcesses,
124 progressIndicator, 126 progressIndicator,
125 startTime, 127 startTime,
126 printTiming, 128 printTiming,
127 testSuites, 129 testSuites,
128 allTestsFinished, 130 allTestsFinished,
129 verbose, 131 verbose,
130 listTests); 132 listTests);
131 } 133 }
OLDNEW
« no previous file with comments | « tools/test.dart ('k') | tools/testing/dart/http_server.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698