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

Side by Side Diff: services/service_manager/background/tests/background_service_manager_unittest.cc

Issue 2617713002: [WIP] Add DCHECK for mojo::edk::Init().
Patch Set: test Created 3 years, 11 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 | « mojo/edk/embedder/embedder.cc ('k') | services/service_manager/public/cpp/lib/service_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "services/service_manager/background/background_service_manager.h" 5 #include "services/service_manager/background/background_service_manager.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 #if defined(OS_ANDROID) 48 #if defined(OS_ANDROID)
49 // TODO(crbug.com/589784): This test is disabled, as it fails 49 // TODO(crbug.com/589784): This test is disabled, as it fails
50 // on the Android GN bot. 50 // on the Android GN bot.
51 #define MAYBE_Basic DISABLED_Basic 51 #define MAYBE_Basic DISABLED_Basic
52 #else 52 #else
53 #define MAYBE_Basic Basic 53 #define MAYBE_Basic Basic
54 #endif 54 #endif
55 TEST(BackgroundServiceManagerTest, MAYBE_Basic) { 55 TEST(BackgroundServiceManagerTest, MAYBE_Basic) {
56 BackgroundServiceManager background_service_manager; 56 BackgroundServiceManager background_service_manager;
57 base::MessageLoop message_loop; 57 base::MessageLoop message_loop;
58 background_service_manager.Init(nullptr); 58 auto init_params = base::MakeUnique<BackgroundServiceManager::InitParams>();
59 init_params->init_edk = false;
60 background_service_manager.Init(std::move(init_params));
59 ServiceContext service_context( 61 ServiceContext service_context(
60 base::MakeUnique<ServiceImpl>(), 62 base::MakeUnique<ServiceImpl>(),
61 background_service_manager.CreateServiceRequest(kTestName)); 63 background_service_manager.CreateServiceRequest(kTestName));
62 mojom::TestServicePtr test_service; 64 mojom::TestServicePtr test_service;
63 service_context.connector()->BindInterface(kAppName, &test_service); 65 service_context.connector()->BindInterface(kAppName, &test_service);
64 base::RunLoop run_loop; 66 base::RunLoop run_loop;
65 bool got_result = false; 67 bool got_result = false;
66 test_service->Test( 68 test_service->Test(
67 base::Bind(&SetFlagAndRunClosure, &got_result, run_loop.QuitClosure())); 69 base::Bind(&SetFlagAndRunClosure, &got_result, run_loop.QuitClosure()));
68 run_loop.Run(); 70 run_loop.Run();
69 EXPECT_TRUE(got_result); 71 EXPECT_TRUE(got_result);
70 } 72 }
71 73
72 } // namespace service_manager 74 } // namespace service_manager
OLDNEW
« no previous file with comments | « mojo/edk/embedder/embedder.cc ('k') | services/service_manager/public/cpp/lib/service_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698