Add ICU message format support
[chromium-blink-merge.git] / ios / web / test / test_web_thread_bundle_adapter.cc
blob15745da79f00dbfb311cbe744972d9bb7d8d7aea
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ios/web/public/test/test_web_thread_bundle.h"
7 #include "content/public/test/test_browser_thread_bundle.h"
9 namespace web {
11 namespace {
13 int TestBrowserThreadBundleOptionsFromTestWebThreadBundleOptions(int options) {
14 int result = 0;
15 if (options & TestWebThreadBundle::IO_MAINLOOP)
16 result |= content::TestBrowserThreadBundle::IO_MAINLOOP;
17 if (options & TestWebThreadBundle::REAL_DB_THREAD)
18 result |= content::TestBrowserThreadBundle::REAL_DB_THREAD;
19 if (options & TestWebThreadBundle::REAL_FILE_THREAD)
20 result |= content::TestBrowserThreadBundle::REAL_FILE_THREAD;
21 if (options & TestWebThreadBundle::REAL_FILE_USER_BLOCKING_THREAD)
22 result |= content::TestBrowserThreadBundle::REAL_FILE_USER_BLOCKING_THREAD;
23 if (options & TestWebThreadBundle::REAL_CACHE_THREAD)
24 result |= content::TestBrowserThreadBundle::REAL_CACHE_THREAD;
25 if (options & TestWebThreadBundle::REAL_IO_THREAD)
26 result |= content::TestBrowserThreadBundle::REAL_IO_THREAD;
27 return result;
30 } // namespace
32 class TestWebThreadBundleImpl {
33 public:
34 explicit TestWebThreadBundleImpl(int options)
35 : test_browser_thread_bundle_(
36 TestBrowserThreadBundleOptionsFromTestWebThreadBundleOptions(
37 options)) {}
39 private:
40 content::TestBrowserThreadBundle test_browser_thread_bundle_;
42 DISALLOW_COPY_AND_ASSIGN(TestWebThreadBundleImpl);
45 TestWebThreadBundle::TestWebThreadBundle()
46 : impl_(new TestWebThreadBundleImpl(DEFAULT)) {
49 TestWebThreadBundle::TestWebThreadBundle(int options)
50 : impl_(new TestWebThreadBundleImpl(options)) {
53 TestWebThreadBundle::~TestWebThreadBundle() {
56 } // namespace web