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

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

Issue 1882423004: Move shell service to toplevel shell namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <memory> 5 #include <memory>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "content/browser/mojo/mojo_shell_context.h" 10 #include "content/browser/mojo/mojo_shell_context.h"
(...skipping 17 matching lines...) Expand all
28 MojoShellContext::SetApplicationsForTest(&test_apps_); 28 MojoShellContext::SetApplicationsForTest(&test_apps_);
29 } 29 }
30 30
31 protected: 31 protected:
32 std::string GetUserId() { 32 std::string GetUserId() {
33 return BrowserContext::GetMojoUserIdFor( 33 return BrowserContext::GetMojoUserIdFor(
34 shell()->web_contents()->GetBrowserContext()); 34 shell()->web_contents()->GetBrowserContext());
35 } 35 }
36 36
37 private: 37 private:
38 static std::unique_ptr<mojo::ShellClient> CreateTestApp() { 38 static std::unique_ptr<shell::ShellClient> CreateTestApp() {
39 return std::unique_ptr<mojo::ShellClient>(new TestMojoApp); 39 return std::unique_ptr<shell::ShellClient>(new TestMojoApp);
40 } 40 }
41 41
42 MojoShellContext::StaticApplicationMap test_apps_; 42 MojoShellContext::StaticApplicationMap test_apps_;
43 43
44 DISALLOW_COPY_AND_ASSIGN(MojoShellTest); 44 DISALLOW_COPY_AND_ASSIGN(MojoShellTest);
45 }; 45 };
46 46
47 IN_PROC_BROWSER_TEST_F(MojoShellTest, TestBrowserConnection) { 47 IN_PROC_BROWSER_TEST_F(MojoShellTest, TestBrowserConnection) {
48 auto test_app = MojoAppConnection::Create( 48 auto test_app = MojoAppConnection::Create(
49 GetUserId(), kInProcessTestMojoAppName, kBrowserMojoAppUrl); 49 GetUserId(), kInProcessTestMojoAppName, kBrowserMojoAppUrl);
(...skipping 13 matching lines...) Expand all
63 kBrowserMojoAppUrl); 63 kBrowserMojoAppUrl);
64 mojom::TestMojoServicePtr test_service; 64 mojom::TestMojoServicePtr test_service;
65 test_app->GetInterface(&test_service); 65 test_app->GetInterface(&test_service);
66 66
67 base::RunLoop run_loop; 67 base::RunLoop run_loop;
68 test_service->DoSomething(run_loop.QuitClosure()); 68 test_service->DoSomething(run_loop.QuitClosure());
69 run_loop.Run(); 69 run_loop.Run();
70 } 70 }
71 71
72 } // namespace content 72 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/mojo/mojo_shell_context.cc ('k') | content/browser/service_worker/embedded_worker_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698