OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/at_exit.h" | 5 #include "base/at_exit.h" |
6 #include "base/basictypes.h" | 6 #include "base/basictypes.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/environment.h" | 9 #include "base/environment.h" |
10 #include "base/event_recorder.h" | 10 #include "base/event_recorder.h" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 // Initialize WebKit for this scope. | 151 // Initialize WebKit for this scope. |
152 TestShellWebKitInit test_shell_webkit_init(layout_test_mode); | 152 TestShellWebKitInit test_shell_webkit_init(layout_test_mode); |
153 | 153 |
154 // Suppress abort message in v8 library in debugging mode (but not | 154 // Suppress abort message in v8 library in debugging mode (but not |
155 // actually under a debugger). V8 calls abort() when it hits | 155 // actually under a debugger). V8 calls abort() when it hits |
156 // assertion errors. | 156 // assertion errors. |
157 if (suppress_error_dialogs) { | 157 if (suppress_error_dialogs) { |
158 platform.SuppressErrorReporting(); | 158 platform.SuppressErrorReporting(); |
159 } | 159 } |
160 | 160 |
| 161 if (parsed_command_line.HasSwitch(test_shell::kEnableTracing)) |
| 162 base::debug::TraceLog::StartTracing(); |
| 163 |
161 net::HttpCache::Mode cache_mode = net::HttpCache::NORMAL; | 164 net::HttpCache::Mode cache_mode = net::HttpCache::NORMAL; |
162 | 165 |
163 // This is a special mode where JS helps the browser implement | 166 // This is a special mode where JS helps the browser implement |
164 // playback/record mode. Generally, in this mode, some functions | 167 // playback/record mode. Generally, in this mode, some functions |
165 // of client-side randomness are removed. For example, in | 168 // of client-side randomness are removed. For example, in |
166 // this mode Math.random() and Date.getTime() may not return | 169 // this mode Math.random() and Date.getTime() may not return |
167 // values which vary. | 170 // values which vary. |
168 bool playback_mode = | 171 bool playback_mode = |
169 parsed_command_line.HasSwitch(test_shell::kPlaybackMode); | 172 parsed_command_line.HasSwitch(test_shell::kPlaybackMode); |
170 bool record_mode = | 173 bool record_mode = |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 TestShell::ShutdownTestShell(); | 346 TestShell::ShutdownTestShell(); |
344 TestShell::CleanupLogging(); | 347 TestShell::CleanupLogging(); |
345 | 348 |
346 // Tear down shared StatsTable; prevents unit_tests from leaking it. | 349 // Tear down shared StatsTable; prevents unit_tests from leaking it. |
347 base::StatsTable::set_current(NULL); | 350 base::StatsTable::set_current(NULL); |
348 delete table; | 351 delete table; |
349 RemoveSharedMemoryFile(stats_filename); | 352 RemoveSharedMemoryFile(stats_filename); |
350 | 353 |
351 return 0; | 354 return 0; |
352 } | 355 } |
OLD | NEW |