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

Unified Diff: chrome/browser/chromeos/policy/device_local_account_browsertest.cc

Issue 2884973004: Remove usage of SequencedWorkerPool::GetNamedSequenceToken from GetKeyboardLayoutsForLocale. (Closed)
Patch Set: CR-emaxx-18 Created 3 years, 7 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 | chrome/browser/ui/webui/chromeos/login/l10n_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/policy/device_local_account_browsertest.cc
diff --git a/chrome/browser/chromeos/policy/device_local_account_browsertest.cc b/chrome/browser/chromeos/policy/device_local_account_browsertest.cc
index 59201bd492e86b821d8224938174e21ee8e82d73..63fb68e8d48a2b8f50de626571c99fab7f0f4873 100644
--- a/chrome/browser/chromeos/policy/device_local_account_browsertest.cc
+++ b/chrome/browser/chromeos/policy/device_local_account_browsertest.cc
@@ -37,7 +37,6 @@
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/synchronization/lock.h"
-#include "base/threading/sequenced_worker_pool.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/values.h"
#include "chrome/browser/browser_process.h"
@@ -113,7 +112,6 @@
#include "components/user_manager/user.h"
#include "components/user_manager/user_manager.h"
#include "components/user_manager/user_type.h"
-#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
@@ -216,10 +214,6 @@ const char* const kInvalidRecommendedLocale[] = {
const char kPublicSessionLocale[] = "de";
const char kPublicSessionInputMethodIDTemplate[] = "_comp_ime_%sxkb:de:neo:ger";
-// The sequence token used by GetKeyboardLayoutsForLocale() for its background
-// tasks.
-const char kSequenceToken[] = "chromeos_login_l10n_util";
-
// Helper that serves extension update manifests to Chrome.
class TestingUpdateManifestProvider
: public base::RefCountedThreadSafe<TestingUpdateManifestProvider> {
@@ -700,21 +694,11 @@ class DeviceLocalAccountTest : public DevicePolicyCrosBrowserTest,
EXPECT_EQ(initial_language_, icu::Locale::getDefault().getLanguage());
}
- // GetKeyboardLayoutsForLocale() posts a task to a background task runner.
- // This method flushes that task runner and the current thread's message loop
- // to ensure that GetKeyboardLayoutsForLocale() is finished.
+ // GetKeyboardLayoutsForLocale() posts a task to a background task runner and
+ // handles the response on the main thread. This method flushes both the
+ // thread pool backing the background task runner and the main thread.
void WaitForGetKeyboardLayoutsForLocaleToFinish() {
- base::SequencedWorkerPool* worker_pool =
- content::BrowserThread::GetBlockingPool();
- scoped_refptr<base::SequencedTaskRunner> background_task_runner =
- worker_pool->GetSequencedTaskRunner(
- worker_pool->GetNamedSequenceToken(kSequenceToken));
- base::RunLoop run_loop;
- background_task_runner->PostTaskAndReply(FROM_HERE,
- base::Bind(&base::DoNothing),
- run_loop.QuitClosure());
- run_loop.Run();
- base::RunLoop().RunUntilIdle();
+ content::RunAllBlockingPoolTasksUntilIdle();
// Verify that the construction of the keyboard layout list did not affect
// the current ICU locale.
« no previous file with comments | « no previous file | chrome/browser/ui/webui/chromeos/login/l10n_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698