| 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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 if (parsed_command_line.HasSwitch(test_shell::kProfiler)) { | 279 if (parsed_command_line.HasSwitch(test_shell::kProfiler)) { |
| 280 WebScriptController::registerExtension( | 280 WebScriptController::registerExtension( |
| 281 extensions_v8::ProfilerExtension::Get()); | 281 extensions_v8::ProfilerExtension::Get()); |
| 282 } | 282 } |
| 283 | 283 |
| 284 if (parsed_command_line.HasSwitch(test_shell::kHeapProfiler)) { | 284 if (parsed_command_line.HasSwitch(test_shell::kHeapProfiler)) { |
| 285 WebScriptController::registerExtension( | 285 WebScriptController::registerExtension( |
| 286 extensions_v8::HeapProfilerExtension::Get()); | 286 extensions_v8::HeapProfilerExtension::Get()); |
| 287 } | 287 } |
| 288 | 288 |
| 289 if (parsed_command_line.HasSwitch(test_shell::kDartFlags)) { | |
| 290 webkit_glue::SetDartFlags( | |
| 291 parsed_command_line.GetSwitchValueASCII(test_shell::kDartFlags)); | |
| 292 } | |
| 293 | |
| 294 // Load and initialize the stats table. Attempt to construct a somewhat | 289 // Load and initialize the stats table. Attempt to construct a somewhat |
| 295 // unique name to isolate separate instances from each other. | 290 // unique name to isolate separate instances from each other. |
| 296 | 291 |
| 297 // truncate the random # to 32 bits for the benefit of Mac OS X, to | 292 // truncate the random # to 32 bits for the benefit of Mac OS X, to |
| 298 // avoid tripping over its maximum shared memory segment name length | 293 // avoid tripping over its maximum shared memory segment name length |
| 299 std::string stats_filename = kStatsFilePrefix + | 294 std::string stats_filename = kStatsFilePrefix + |
| 300 base::Uint64ToString(base::RandUint64() & 0xFFFFFFFFL); | 295 base::Uint64ToString(base::RandUint64() & 0xFFFFFFFFL); |
| 301 RemoveSharedMemoryFile(stats_filename); | 296 RemoveSharedMemoryFile(stats_filename); |
| 302 base::StatsTable *table = new base::StatsTable(stats_filename, | 297 base::StatsTable *table = new base::StatsTable(stats_filename, |
| 303 kStatsFileThreads, | 298 kStatsFileThreads, |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 TestShell::ShutdownTestShell(); | 336 TestShell::ShutdownTestShell(); |
| 342 TestShell::CleanupLogging(); | 337 TestShell::CleanupLogging(); |
| 343 | 338 |
| 344 // Tear down shared StatsTable; prevents unit_tests from leaking it. | 339 // Tear down shared StatsTable; prevents unit_tests from leaking it. |
| 345 base::StatsTable::set_current(NULL); | 340 base::StatsTable::set_current(NULL); |
| 346 delete table; | 341 delete table; |
| 347 RemoveSharedMemoryFile(stats_filename); | 342 RemoveSharedMemoryFile(stats_filename); |
| 348 | 343 |
| 349 return 0; | 344 return 0; |
| 350 } | 345 } |
| OLD | NEW |