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

Side by Side Diff: ios/web/test/test_web_thread_bundle.cc

Issue 814533002: Introduce web::TestWebThreadBundle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@includes
Patch Set: Address comments Created 5 years, 12 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 unified diff | Download patch
« no previous file with comments | « ios/web/public/test/test_web_thread_bundle.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #include "ios/web/public/test/test_web_thread_bundle.h"
6
7 #include "content/public/test/test_browser_thread_bundle.h"
8
9 namespace web {
10
11 namespace {
12
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;
28 }
29
30 } // namespace
31
32 class TestWebThreadBundleImpl {
33 public:
34 explicit TestWebThreadBundleImpl(int options)
35 : test_browser_thread_bundle_(
36 TestBrowserThreadBundleOptionsFromTestWebThreadBundleOptions(
37 options)) {}
38
39 private:
40 content::TestBrowserThreadBundle test_browser_thread_bundle_;
41
42 DISALLOW_COPY_AND_ASSIGN(TestWebThreadBundleImpl);
43 };
44
45 TestWebThreadBundle::TestWebThreadBundle()
46 : impl_(new TestWebThreadBundleImpl(DEFAULT)) {
47 }
48
49 TestWebThreadBundle::TestWebThreadBundle(int options)
50 : impl_(new TestWebThreadBundleImpl(options)) {
51 }
52
53 TestWebThreadBundle::~TestWebThreadBundle() {
54 }
55
56 } // namespace web
OLDNEW
« no previous file with comments | « ios/web/public/test/test_web_thread_bundle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698