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 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 xml_writer_.EndElement(); | 390 xml_writer_.EndElement(); |
391 | 391 |
392 if (post_action_delay_) | 392 if (post_action_delay_) |
393 ::Sleep(1000 * post_action_delay_); | 393 ::Sleep(1000 * post_action_delay_); |
394 | 394 |
395 return did_complete_action; | 395 return did_complete_action; |
396 } | 396 } |
397 | 397 |
398 bool AutomatedUITest::ChangeEncoding() { | 398 bool AutomatedUITest::ChangeEncoding() { |
399 // Get the encoding list that is used to populate the UI (encoding menu) | 399 // Get the encoding list that is used to populate the UI (encoding menu) |
400 std::wstring cur_locale = g_browser_process->GetApplicationLocale(); | 400 std::string cur_locale = g_browser_process->GetApplicationLocale(); |
401 const std::vector<CharacterEncoding::EncodingInfo>* encodings = | 401 const std::vector<CharacterEncoding::EncodingInfo>* encodings = |
402 CharacterEncoding::GetCurrentDisplayEncodings( | 402 CharacterEncoding::GetCurrentDisplayEncodings( |
403 cur_locale, L"ISO-8859-1,windows-1252", L""); | 403 cur_locale, L"ISO-8859-1,windows-1252", L""); |
404 DCHECK(encodings); | 404 DCHECK(encodings); |
405 DCHECK(!encodings->empty()); | 405 DCHECK(!encodings->empty()); |
406 unsigned len = static_cast<unsigned>(encodings->size()); | 406 unsigned len = static_cast<unsigned>(encodings->size()); |
407 | 407 |
408 // The vector will contain mostly IDC values for encoding commands plus a few | 408 // The vector will contain mostly IDC values for encoding commands plus a few |
409 // menu separators (0 values). If we hit a separator we just retry. | 409 // menu separators (0 values). If we hit a separator we just retry. |
410 int index = base::RandInt(0, len); | 410 int index = base::RandInt(0, len); |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
759 } | 759 } |
760 } | 760 } |
761 | 761 |
762 TEST_F(AutomatedUITest, TheOneAndOnlyTest) { | 762 TEST_F(AutomatedUITest, TheOneAndOnlyTest) { |
763 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 763 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
764 if (parsed_command_line.HasSwitch(kReproSwitch)) | 764 if (parsed_command_line.HasSwitch(kReproSwitch)) |
765 RunReproduction(); | 765 RunReproduction(); |
766 else | 766 else |
767 RunAutomatedUITest(); | 767 RunAutomatedUITest(); |
768 } | 768 } |
OLD | NEW |