| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 <fstream> | 5 #include <fstream> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 | 66 |
| 67 // How many commands to run when testing a dialog box. | 67 // How many commands to run when testing a dialog box. |
| 68 const int kTestDialogActionsToRun = 7; | 68 const int kTestDialogActionsToRun = 7; |
| 69 | 69 |
| 70 void SilentRuntimeReportHandler(const std::string& str) { | 70 void SilentRuntimeReportHandler(const std::string& str) { |
| 71 } | 71 } |
| 72 | 72 |
| 73 FilePath GetInputFilePath() { | 73 FilePath GetInputFilePath() { |
| 74 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 74 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
| 75 if (parsed_command_line.HasSwitch(kInputFilePathSwitch)) { | 75 if (parsed_command_line.HasSwitch(kInputFilePathSwitch)) { |
| 76 return FilePath::FromWStringHack( | 76 return parsed_command_line.GetSwitchValuePath(kInputFilePathSwitch); |
| 77 parsed_command_line.GetSwitchValue(kInputFilePathSwitch)); | |
| 78 } else { | 77 } else { |
| 79 return FilePath(kDefaultInputFilePath); | 78 return FilePath(kDefaultInputFilePath); |
| 80 } | 79 } |
| 81 } | 80 } |
| 82 | 81 |
| 83 FilePath GetOutputFilePath() { | 82 FilePath GetOutputFilePath() { |
| 84 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 83 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
| 85 if (parsed_command_line.HasSwitch(kOutputFilePathSwitch)) { | 84 if (parsed_command_line.HasSwitch(kOutputFilePathSwitch)) { |
| 86 return FilePath::FromWStringHack( | 85 return parsed_command_line.GetSwitchValuePath(kOutputFilePathSwitch); |
| 87 parsed_command_line.GetSwitchValue(kOutputFilePathSwitch)); | |
| 88 } else { | 86 } else { |
| 89 return FilePath(kDefaultOutputFilePath); | 87 return FilePath(kDefaultOutputFilePath); |
| 90 } | 88 } |
| 91 } | 89 } |
| 92 | 90 |
| 93 } // namespace | 91 } // namespace |
| 94 | 92 |
| 95 // This subset of commands is used to test dialog boxes, which aren't likely | 93 // This subset of commands is used to test dialog boxes, which aren't likely |
| 96 // to respond to most other commands. | 94 // to respond to most other commands. |
| 97 const std::string kTestDialogPossibleActions[] = { | 95 const std::string kTestDialogPossibleActions[] = { |
| (...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 751 } | 749 } |
| 752 } | 750 } |
| 753 | 751 |
| 754 TEST_F(AutomatedUITest, TheOneAndOnlyTest) { | 752 TEST_F(AutomatedUITest, TheOneAndOnlyTest) { |
| 755 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 753 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
| 756 if (parsed_command_line.HasSwitch(kReproSwitch)) | 754 if (parsed_command_line.HasSwitch(kReproSwitch)) |
| 757 RunReproduction(); | 755 RunReproduction(); |
| 758 else | 756 else |
| 759 RunAutomatedUITest(); | 757 RunAutomatedUITest(); |
| 760 } | 758 } |
| OLD | NEW |