OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <string> | 5 #include <string> |
6 | 6 |
7 // This has to be included first. | 7 // This has to be included first. |
8 // See http://code.google.com/p/googletest/issues/detail?id=371 | 8 // See http://code.google.com/p/googletest/issues/detail?id=371 |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 } // namespace | 347 } // namespace |
348 } // namespace content | 348 } // namespace content |
349 | 349 |
350 int main(int argc, char** argv) { | 350 int main(int argc, char** argv) { |
351 testing::InitGoogleTest(&argc, argv); // Removes gtest-specific args. | 351 testing::InitGoogleTest(&argc, argv); // Removes gtest-specific args. |
352 CommandLine::Init(argc, argv); | 352 CommandLine::Init(argc, argv); |
353 | 353 |
354 // Needed to enable DVLOG through --vmodule. | 354 // Needed to enable DVLOG through --vmodule. |
355 logging::LoggingSettings settings; | 355 logging::LoggingSettings settings; |
356 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; | 356 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; |
357 settings.dcheck_state = | |
358 logging::ENABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS; | |
359 CHECK(logging::InitLogging(settings)); | 357 CHECK(logging::InitLogging(settings)); |
360 | 358 |
361 // Process command line. | 359 // Process command line. |
362 CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 360 CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
363 CHECK(cmd_line); | 361 CHECK(cmd_line); |
364 | 362 |
365 CommandLine::SwitchMap switches = cmd_line->GetSwitches(); | 363 CommandLine::SwitchMap switches = cmd_line->GetSwitches(); |
366 for (CommandLine::SwitchMap::const_iterator it = switches.begin(); | 364 for (CommandLine::SwitchMap::const_iterator it = switches.begin(); |
367 it != switches.end(); | 365 it != switches.end(); |
368 ++it) { | 366 ++it) { |
369 if (it->first == "input_file") { | 367 if (it->first == "input_file") { |
370 content::g_input_file = base::FilePath(it->second); | 368 content::g_input_file = base::FilePath(it->second); |
371 continue; | 369 continue; |
372 } | 370 } |
373 if (it->first == "output_file") { | 371 if (it->first == "output_file") { |
374 content::g_output_file = base::FilePath(it->second); | 372 content::g_output_file = base::FilePath(it->second); |
375 continue; | 373 continue; |
376 } | 374 } |
377 if (it->first == "md5sum") { | 375 if (it->first == "md5sum") { |
378 content::g_md5sum = it->second; | 376 content::g_md5sum = it->second; |
379 continue; | 377 continue; |
380 } | 378 } |
381 if (it->first == "v" || it->first == "vmodule") | 379 if (it->first == "v" || it->first == "vmodule") |
382 continue; | 380 continue; |
383 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; | 381 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; |
384 } | 382 } |
385 | 383 |
386 return RUN_ALL_TESTS(); | 384 return RUN_ALL_TESTS(); |
387 } | 385 } |
OLD | NEW |