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 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 PlatformThread::Sleep(1000 * post_action_delay_); | 432 PlatformThread::Sleep(1000 * post_action_delay_); |
433 | 433 |
434 return did_complete_action; | 434 return did_complete_action; |
435 } | 435 } |
436 | 436 |
437 bool AutomatedUITest::ChangeEncoding() { | 437 bool AutomatedUITest::ChangeEncoding() { |
438 // Get the encoding list that is used to populate the UI (encoding menu) | 438 // Get the encoding list that is used to populate the UI (encoding menu) |
439 std::string cur_locale = g_browser_process->GetApplicationLocale(); | 439 std::string cur_locale = g_browser_process->GetApplicationLocale(); |
440 const std::vector<CharacterEncoding::EncodingInfo>* encodings = | 440 const std::vector<CharacterEncoding::EncodingInfo>* encodings = |
441 CharacterEncoding::GetCurrentDisplayEncodings( | 441 CharacterEncoding::GetCurrentDisplayEncodings( |
442 cur_locale, L"ISO-8859-1,windows-1252", L""); | 442 cur_locale, "ISO-8859-1,windows-1252", ""); |
443 DCHECK(encodings); | 443 DCHECK(encodings); |
444 DCHECK(!encodings->empty()); | 444 DCHECK(!encodings->empty()); |
445 unsigned len = static_cast<unsigned>(encodings->size()); | 445 unsigned len = static_cast<unsigned>(encodings->size()); |
446 | 446 |
447 // The vector will contain mostly IDC values for encoding commands plus a few | 447 // The vector will contain mostly IDC values for encoding commands plus a few |
448 // menu separators (0 values). If we hit a separator we just retry. | 448 // menu separators (0 values). If we hit a separator we just retry. |
449 int index = base::RandInt(0, len); | 449 int index = base::RandInt(0, len); |
450 while ((*encodings)[index].encoding_id == 0) { | 450 while ((*encodings)[index].encoding_id == 0) { |
451 index = base::RandInt(0, len); | 451 index = base::RandInt(0, len); |
452 } | 452 } |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 } | 778 } |
779 } | 779 } |
780 | 780 |
781 TEST_F(AutomatedUITest, TheOneAndOnlyTest) { | 781 TEST_F(AutomatedUITest, TheOneAndOnlyTest) { |
782 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 782 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
783 if (parsed_command_line.HasSwitch(kReproSwitch)) | 783 if (parsed_command_line.HasSwitch(kReproSwitch)) |
784 RunReproduction(); | 784 RunReproduction(); |
785 else | 785 else |
786 RunAutomatedUITest(); | 786 RunAutomatedUITest(); |
787 } | 787 } |
OLD | NEW |