Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
io.flutter.embedding.engine.systemchannels.SettingsChannelTest Class Reference

Public Member Functions

void setDisplayMetricsDoesNothingOnAPILevel33 ()
 
void configurationQueueWorks ()
 

Detailed Description

Definition at line 23 of file SettingsChannelTest.java.

Member Function Documentation

◆ configurationQueueWorks()

void io.flutter.embedding.engine.systemchannels.SettingsChannelTest.configurationQueueWorks ( )
inline

Definition at line 42 of file SettingsChannelTest.java.

42 {
43 final SettingsChannel.ConfigurationQueue queue = new SettingsChannel.ConfigurationQueue();
44 final int baseId = Integer.MIN_VALUE;
45
46 queue.enqueueConfiguration(
47 new SettingsChannel.ConfigurationQueue.SentConfiguration(mock(DisplayMetrics.class)));
48 queue.enqueueConfiguration(
49 new SettingsChannel.ConfigurationQueue.SentConfiguration(mock(DisplayMetrics.class)));
50 assertEquals(baseId + 0, queue.getConfiguration(baseId + 0).generationNumber);
51 assertEquals(baseId + 1, queue.getConfiguration(baseId + 1).generationNumber);
52 assertEquals(baseId + 1, queue.getConfiguration(baseId + 1).generationNumber);
53
54 queue.enqueueConfiguration(
55 new SettingsChannel.ConfigurationQueue.SentConfiguration(mock(DisplayMetrics.class)));
56 queue.enqueueConfiguration(
57 new SettingsChannel.ConfigurationQueue.SentConfiguration(mock(DisplayMetrics.class)));
58 assertEquals(baseId + 3, queue.getConfiguration(baseId + 3).generationNumber);
59 // Can get the same configuration more than once.
60 assertEquals(baseId + 3, queue.getConfiguration(baseId + 3).generationNumber);
61
62 final BasicMessageChannel.Reply replyFor4 =
63 queue.enqueueConfiguration(
64 new SettingsChannel.ConfigurationQueue.SentConfiguration(mock(DisplayMetrics.class)));
65 final BasicMessageChannel.Reply replyFor5 =
66 queue.enqueueConfiguration(
67 new SettingsChannel.ConfigurationQueue.SentConfiguration(mock(DisplayMetrics.class)));
68 replyFor4.reply(null);
69 replyFor5.reply(null);
70 assertEquals(baseId + 5, queue.getConfiguration(baseId + 5).generationNumber);
71 assertEquals(baseId + 5, queue.getConfiguration(baseId + 5).generationNumber);
72 }
VkQueue queue
Definition: main.cc:55

◆ setDisplayMetricsDoesNothingOnAPILevel33()

void io.flutter.embedding.engine.systemchannels.SettingsChannelTest.setDisplayMetricsDoesNothingOnAPILevel33 ( )
inline

Definition at line 29 of file SettingsChannelTest.java.

29 {
30 final DartExecutor executor = mock(DartExecutor.class);
31 executor.onAttachedToJNI();
32 final SettingsChannel settingsChannel = new SettingsChannel(executor);
33
34 final ArgumentCaptor<ByteBuffer> messageCaptor = ArgumentCaptor.forClass(ByteBuffer.class);
35
36 settingsChannel.startMessage().setDisplayMetrics(mock(DisplayMetrics.class)).send();
37
38 verify(executor).send(eq("flutter/settings"), messageCaptor.capture(), isNull());
39 }
static bool eq(const SkM44 &a, const SkM44 &b, float tol)
Definition: M44Test.cpp:18

The documentation for this class was generated from the following file: