Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Unified Diff: chrome/test/automated_ui_tests/automated_ui_tests.cc

Issue 21414: We will sort the encoding menu items according to current used UI language ex... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/l10n_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/automated_ui_tests/automated_ui_tests.cc
===================================================================
--- chrome/test/automated_ui_tests/automated_ui_tests.cc (revision 10076)
+++ chrome/test/automated_ui_tests/automated_ui_tests.cc (working copy)
@@ -12,6 +12,7 @@
#include "base/string_util.h"
#include "base/sys_info.h"
#include "chrome/app/chrome_dll_resource.h"
+#include "chrome/browser/browser_process.h"
#include "chrome/browser/character_encoding.h"
#include "chrome/browser/view_ids.h"
#include "chrome/common/chrome_paths.h"
@@ -420,21 +421,22 @@
bool AutomatedUITest::ChangeEncoding() {
// Get the encoding list that is used to populate the UI (encoding menu)
- const std::vector<int>* encoding_ids =
+ std::wstring cur_locale = g_browser_process->GetApplicationLocale();
+ const std::vector<CharacterEncoding::EncodingInfo>* encodings =
CharacterEncoding::GetCurrentDisplayEncodings(
- L"ISO-8859-1,windows-1252", L"");
- DCHECK(encoding_ids);
- DCHECK(!encoding_ids->empty());
- unsigned len = static_cast<unsigned>(encoding_ids->size());
+ cur_locale, L"ISO-8859-1,windows-1252", L"");
+ DCHECK(encodings);
+ DCHECK(!encodings->empty());
+ unsigned len = static_cast<unsigned>(encodings->size());
// The vector will contain mostly IDC values for encoding commands plus a few
// menu separators (0 values). If we hit a separator we just retry.
int index = base::RandInt(0, len);
- while ((*encoding_ids)[index] == 0) {
+ while ((*encodings)[index].encoding_id == 0) {
index = base::RandInt(0, len);
}
- return RunCommand((*encoding_ids)[index]);
+ return RunCommand((*encodings)[index].encoding_id);
}
bool AutomatedUITest::CloseActiveTab() {
« no previous file with comments | « chrome/common/l10n_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698