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

Side by Side Diff: content/browser/utility_process_host_impl_browsertest.cc

Issue 2387263002: Rename MojoShellContext -> ServiceManagerContext. (Closed)
Patch Set: . Created 4 years, 2 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/bind.h" 5 #include "base/bind.h"
6 #include "base/run_loop.h" 6 #include "base/run_loop.h"
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "content/public/browser/browser_thread.h" 8 #include "content/public/browser/browser_thread.h"
9 #include "content/public/browser/utility_process_host.h" 9 #include "content/public/browser/utility_process_host.h"
10 #include "content/public/browser/utility_process_host_client.h" 10 #include "content/public/browser/utility_process_host_client.h"
11 #include "content/public/test/content_browser_test.h" 11 #include "content/public/test/content_browser_test.h"
12 #include "content/public/test/content_browser_test_utils.h" 12 #include "content/public/test/content_browser_test_utils.h"
13 #include "content/public/test/test_mojo_service.mojom.h" 13 #include "content/public/test/test_service.mojom.h"
14 #include "services/shell/public/cpp/interface_provider.h" 14 #include "services/shell/public/cpp/interface_provider.h"
15 #include "services/shell/public/cpp/interface_registry.h" 15 #include "services/shell/public/cpp/interface_registry.h"
16 16
17 namespace content { 17 namespace content {
18 18
19 class UtilityProcessHostImplBrowserTest : public ContentBrowserTest { 19 class UtilityProcessHostImplBrowserTest : public ContentBrowserTest {
20 public: 20 public:
21 void RunUtilityProcess(bool elevated) { 21 void RunUtilityProcess(bool elevated) {
22 base::RunLoop run_loop; 22 base::RunLoop run_loop;
23 done_closure_ = run_loop.QuitClosure(); 23 done_closure_ = run_loop.QuitClosure();
(...skipping 19 matching lines...) Expand all
43 service_->DoSomething(base::Bind( 43 service_->DoSomething(base::Bind(
44 &UtilityProcessHostImplBrowserTest::OnSomething, 44 &UtilityProcessHostImplBrowserTest::OnSomething,
45 base::Unretained(this))); 45 base::Unretained(this)));
46 } 46 }
47 47
48 void OnSomething() { 48 void OnSomething() {
49 service_.reset(); 49 service_.reset();
50 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, done_closure_); 50 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, done_closure_);
51 } 51 }
52 52
53 mojom::TestMojoServicePtr service_; 53 mojom::TestServicePtr service_;
54 base::Closure done_closure_; 54 base::Closure done_closure_;
55 }; 55 };
56 56
57 IN_PROC_BROWSER_TEST_F(UtilityProcessHostImplBrowserTest, LaunchProcess) { 57 IN_PROC_BROWSER_TEST_F(UtilityProcessHostImplBrowserTest, LaunchProcess) {
58 RunUtilityProcess(false); 58 RunUtilityProcess(false);
59 } 59 }
60 60
61 #if defined(OS_WIN) 61 #if defined(OS_WIN)
62 IN_PROC_BROWSER_TEST_F(UtilityProcessHostImplBrowserTest, 62 IN_PROC_BROWSER_TEST_F(UtilityProcessHostImplBrowserTest,
63 LaunchElevatedProcess) { 63 LaunchElevatedProcess) {
64 RunUtilityProcess(true); 64 RunUtilityProcess(true);
65 } 65 }
66 #endif 66 #endif
67 67
68 } // namespace content 68 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/utility_process_host_impl.cc ('k') | content/browser/utility_process_mojo_client_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698