| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/keyboard_codes.h" | 9 #include "app/keyboard_codes.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 std::string action_string = | 146 std::string action_string = |
| 147 parsed_command_line.GetSwitchValueASCII(kReproSwitch); | 147 parsed_command_line.GetSwitchValueASCII(kReproSwitch); |
| 148 | 148 |
| 149 int64 num_reproductions = 1; | 149 int64 num_reproductions = 1; |
| 150 if (parsed_command_line.HasSwitch(kReproRepeatSwitch)) { | 150 if (parsed_command_line.HasSwitch(kReproRepeatSwitch)) { |
| 151 base::StringToInt64( | 151 base::StringToInt64( |
| 152 parsed_command_line.GetSwitchValueASCII(kReproRepeatSwitch), | 152 parsed_command_line.GetSwitchValueASCII(kReproRepeatSwitch), |
| 153 &num_reproductions); | 153 &num_reproductions); |
| 154 } | 154 } |
| 155 std::vector<std::string> actions; | 155 std::vector<std::string> actions; |
| 156 SplitString(action_string, ',', &actions); | 156 base::SplitString(action_string, ',', &actions); |
| 157 bool did_crash = false; | 157 bool did_crash = false; |
| 158 bool command_complete = false; | 158 bool command_complete = false; |
| 159 | 159 |
| 160 for (int64 i = 0; i < num_reproductions && !did_crash; ++i) { | 160 for (int64 i = 0; i < num_reproductions && !did_crash; ++i) { |
| 161 bool did_teardown = false; | 161 bool did_teardown = false; |
| 162 xml_writer_.StartElement("Executed"); | 162 xml_writer_.StartElement("Executed"); |
| 163 for (size_t j = 0; j < actions.size(); ++j) { | 163 for (size_t j = 0; j < actions.size(); ++j) { |
| 164 DoAction(actions[j]); | 164 DoAction(actions[j]); |
| 165 if (DidCrash(true)) { | 165 if (DidCrash(true)) { |
| 166 did_crash = true; | 166 did_crash = true; |
| (...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 745 } | 745 } |
| 746 } | 746 } |
| 747 | 747 |
| 748 TEST_F(AutomatedUITest, TheOneAndOnlyTest) { | 748 TEST_F(AutomatedUITest, TheOneAndOnlyTest) { |
| 749 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 749 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
| 750 if (parsed_command_line.HasSwitch(kReproSwitch)) | 750 if (parsed_command_line.HasSwitch(kReproSwitch)) |
| 751 RunReproduction(); | 751 RunReproduction(); |
| 752 else | 752 else |
| 753 RunAutomatedUITest(); | 753 RunAutomatedUITest(); |
| 754 } | 754 } |
| OLD | NEW |