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"
13 int TestBrowserThreadBundleOptionsFromTestWebThreadBundleOptions(int options
) {
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
;
32 class TestWebThreadBundleImpl
{
34 explicit TestWebThreadBundleImpl(int options
)
35 : test_browser_thread_bundle_(
36 TestBrowserThreadBundleOptionsFromTestWebThreadBundleOptions(
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() {