16 : handler_(handler) {}
36 : port_buffer_(nullptr),
47 delete[] port_buffer_;
60 AddPortToBuffer(
message->dest_port());
63 if (results_ !=
nullptr) {
95 if (port_buffer_ ==
nullptr) {
97 port_buffer_size_ = 10;
98 }
else if (message_count_ == port_buffer_size_) {
99 int new_port_buffer_size_ = 2 * port_buffer_size_;
101 for (
int i = 0;
i < port_buffer_size_;
i++) {
102 new_port_buffer_[
i] = port_buffer_[
i];
104 delete[] port_buffer_;
105 port_buffer_ = new_port_buffer_;
106 port_buffer_size_ = new_port_buffer_size_;
108 port_buffer_[message_count_] =
port;
112 int port_buffer_size_;
202 std::unique_ptr<Message>
message;
244 EXPECT_EQ(port2, ports[0]);
245 EXPECT_EQ(port3, ports[1]);
246 EXPECT_EQ(port1, ports[2]);
270 EXPECT_EQ(port2, ports[0]);
271 EXPECT_EQ(port3, ports[1]);
298 EXPECT_EQ(port2, ports[0]);
299 EXPECT_EQ(port3, ports[1]);
324 EXPECT_EQ(port3, ports[0]);
325 EXPECT_EQ(port4, ports[1]);
341 for (
int i = 0;
i <
info->count;
i++) {
353 reinterpret_cast<uword>(&handler));
355 EXPECT(!PortMap::HasPorts(&handler));
357 EXPECT(PortMap::HasPorts(&handler));
371 EXPECT_EQ(
port, handler_ports[0]);
376 for (
int i = 0;
i < 10;
i++) {
380 info.handler = &handler;
396 EXPECT_EQ(
port, handler_ports[0]);
397 for (
int i = 1;
i < 11;
i++) {
398 EXPECT_EQ(ports[
i - 1], handler_ports[
i]);
402 for (
int i = 0;
i < 10;
i++) {
406 EXPECT(!PortMap::HasPorts(&handler));
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
MessageQueue * queue() const
void ClosePort(Dart_Port port)
MessageHandlerTestPeer(MessageHandler *handler)
MessageQueue * oob_queue() const
void PostMessage(std::unique_ptr< Message > message)
MessageQueue * oob_queue()
void PostMessage(std::unique_ptr< Message > message, bool before_events=false)
bool Run(ThreadPool *pool, StartCallback start_callback, EndCallback end_callback, CallbackData data)
void ClosePort(Dart_Port port)
MessageStatus HandleNextMessage()
MessageStatus HandleOOBMessages()
std::unique_ptr< Message > Dequeue()
static std::unique_ptr< Message > New(Args &&... args)
Monitor::WaitResult Wait(int64_t millis=Monitor::kNoTimeout)
static int Start(const char *name, ThreadStartFunction function, uword parameter)
static void Join(ThreadJoinId id)
static OSThread * Current()
static ThreadJoinId GetCurrentThreadJoinId(OSThread *thread)
static const ThreadJoinId kInvalidThreadJoinId
static bool ClosePort(Dart_Port id, MessageHandler **message_handler=nullptr)
static void ClosePorts(MessageHandler *handler)
static Dart_Port CreatePort(MessageHandler *handler)
void set_results(MessageStatus *results)
bool start_called() const
Dart_Port * port_buffer() const
MessageStatus HandleMessage(std::unique_ptr< Message > message)
void MessageNotify(Message::Priority priority)
int message_count() const
MessageHandler::MessageStatus TestStartFunction(uword data)
static void SendMessages(uword param)
void TestEndFunction(uword data)
static std::unique_ptr< Message > BlankMessage(Dart_Port dest, Message::Priority priority)
void * malloc(size_t size)
static int8_t data[kExtLength]
VM_UNIT_TEST_CASE(DirectoryCurrentNoScope)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service port