Flutter Engine
dart_service_isolate_unittests.cc
Go to the documentation of this file.
1 // Copyright 2013 The Flutter 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 "flutter/runtime/dart_service_isolate.h"
6 
7 #include "flutter/testing/testing.h"
8 
9 namespace flutter {
10 
11 TEST(DartServiceIsolateTest, CanAddAndRemoveHandles) {
12  ASSERT_EQ(DartServiceIsolate::AddServerStatusCallback(nullptr), 0);
13  auto handle = DartServiceIsolate::AddServerStatusCallback([](const auto&) {});
14  ASSERT_NE(handle, 0);
16 }
17 
18 } // namespace flutter
static CallbackHandle AddServerStatusCallback(const ObservatoryServerStateCallback &callback)
Add a callback that will get invoked when the observatory starts up. If the observatory has already s...
static bool RemoveServerStatusCallback(CallbackHandle handle)
Removed a callback previously registered via AddServiceStatusCallback.
TEST(DartServiceIsolateTest, CanAddAndRemoveHandles)