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

Unified Diff: chrome/browser/ui/webui/bidi_checker_web_ui_test.cc

Issue 10543015: Add synchronization around access when using ReloadLocaleResources (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed comment to add ':' after TODO(tony). Created 8 years, 6 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 | « no previous file | ui/base/resource/resource_bundle.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/bidi_checker_web_ui_test.cc
diff --git a/chrome/browser/ui/webui/bidi_checker_web_ui_test.cc b/chrome/browser/ui/webui/bidi_checker_web_ui_test.cc
index 765f95b214a52b1e6e971759d0af4f09197f64b6..41937ece2e1bc21e70db82b52fbb24f2eb340552 100644
--- a/chrome/browser/ui/webui/bidi_checker_web_ui_test.cc
+++ b/chrome/browser/ui/webui/bidi_checker_web_ui_test.cc
@@ -70,6 +70,10 @@ void WebUIBidiCheckerBrowserTestRTL::RunBidiCheckerOnPage(
}
void WebUIBidiCheckerBrowserTestRTL::SetUpOnMainThread() {
+ // Ensure that no other page (NTP4, home page, e.g.) is loading when we reload
+ // the locale resources.
+ ui_test_utils::NavigateToURL(browser(), GURL("about:blank"));
+
WebUIBidiCheckerBrowserTest::SetUpOnMainThread();
FilePath pak_path;
app_locale_ = base::i18n::GetConfiguredLocale();
@@ -79,7 +83,8 @@ void WebUIBidiCheckerBrowserTestRTL::SetUpOnMainThread() {
pak_path = pak_path.AppendASCII("fake-bidi");
pak_path = pak_path.ReplaceExtension(FILE_PATH_LITERAL("pak"));
ResourceBundle::GetSharedInstance().OverrideLocalePakForTest(pak_path);
- ResourceBundle::GetSharedInstance().ReloadLocaleResources("he");
+ ASSERT_FALSE(
+ ResourceBundle::GetSharedInstance().ReloadLocaleResources("he").empty());
base::i18n::SetICUDefaultLocale("he");
#if defined(OS_POSIX) && defined(TOOLKIT_GTK)
gtk_widget_set_default_direction(GTK_TEXT_DIR_RTL);
@@ -93,7 +98,9 @@ void WebUIBidiCheckerBrowserTestRTL::CleanUpOnMainThread() {
#endif
base::i18n::SetICUDefaultLocale(app_locale_);
ResourceBundle::GetSharedInstance().OverrideLocalePakForTest(FilePath());
- ResourceBundle::GetSharedInstance().ReloadLocaleResources(app_locale_);
+ ASSERT_EQ(
+ app_locale_,
+ ResourceBundle::GetSharedInstance().ReloadLocaleResources(app_locale_));
}
// Tests
« no previous file with comments | « no previous file | ui/base/resource/resource_bundle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698