| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/environment.h" | 10 #include "base/environment.h" |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 } | 498 } |
| 499 | 499 |
| 500 return did_complete_action; | 500 return did_complete_action; |
| 501 } | 501 } |
| 502 | 502 |
| 503 bool AutomatedUITest::ChangeEncoding() { | 503 bool AutomatedUITest::ChangeEncoding() { |
| 504 // Get the encoding list that is used to populate the UI (encoding menu) | 504 // Get the encoding list that is used to populate the UI (encoding menu) |
| 505 std::string cur_locale = g_browser_process->GetApplicationLocale(); | 505 std::string cur_locale = g_browser_process->GetApplicationLocale(); |
| 506 const std::vector<CharacterEncoding::EncodingInfo>* encodings = | 506 const std::vector<CharacterEncoding::EncodingInfo>* encodings = |
| 507 CharacterEncoding::GetCurrentDisplayEncodings( | 507 CharacterEncoding::GetCurrentDisplayEncodings( |
| 508 cur_locale, "ISO-8859-1,windows-1252", ""); | 508 cur_locale, "ISO-8859-1,windows-1252", std::string()); |
| 509 DCHECK(encodings); | 509 DCHECK(encodings); |
| 510 DCHECK(!encodings->empty()); | 510 DCHECK(!encodings->empty()); |
| 511 unsigned len = static_cast<unsigned>(encodings->size()); | 511 unsigned len = static_cast<unsigned>(encodings->size()); |
| 512 | 512 |
| 513 // The vector will contain mostly IDC values for encoding commands plus a few | 513 // The vector will contain mostly IDC values for encoding commands plus a few |
| 514 // menu separators (0 values). If we hit a separator we just retry. | 514 // menu separators (0 values). If we hit a separator we just retry. |
| 515 int index = base::RandInt(0, len); | 515 int index = base::RandInt(0, len); |
| 516 while ((*encodings)[index].encoding_id == 0) { | 516 while ((*encodings)[index].encoding_id == 0) { |
| 517 index = base::RandInt(0, len); | 517 index = base::RandInt(0, len); |
| 518 } | 518 } |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 809 } | 809 } |
| 810 } | 810 } |
| 811 | 811 |
| 812 TEST_F(AutomatedUITest, TheOneAndOnlyTest) { | 812 TEST_F(AutomatedUITest, TheOneAndOnlyTest) { |
| 813 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 813 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
| 814 if (parsed_command_line.HasSwitch(kReproSwitch)) | 814 if (parsed_command_line.HasSwitch(kReproSwitch)) |
| 815 RunReproduction(); | 815 RunReproduction(); |
| 816 else | 816 else |
| 817 RunAutomatedUITest(); | 817 RunAutomatedUITest(); |
| 818 } | 818 } |
| OLD | NEW |