Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Functions
flutter_embedder_test Namespace Reference

Classes

class  FlutterEmbedderTest
 

Functions

 TEST_F (FlutterEmbedderTest, Embedding)
 
 TEST_F (FlutterEmbedderTest, EmbeddingWithOverlay)
 

Function Documentation

◆ TEST_F() [1/2]

flutter_embedder_test::TEST_F ( FlutterEmbedderTest  ,
Embedding   
)

Definition at line 412 of file flutter-embedder-test.cc.

412 {
413 LaunchParentViewInRealm();
414
415 // Take screenshot until we see the child-view's embedded color.
416 ASSERT_TRUE(TakeScreenshotUntil(
417 kChildBackgroundColor,
418 [](std::map<fuchsia_test_utils::Pixel, uint32_t> histogram) {
419 // Expect parent and child background colors, with parent color > child
420 // color.
421 EXPECT_GT(histogram[kParentBackgroundColor], 0u);
422 EXPECT_GT(histogram[kChildBackgroundColor], 0u);
423 EXPECT_GT(histogram[kParentBackgroundColor],
424 histogram[kChildBackgroundColor]);
425 }));
426}

◆ TEST_F() [2/2]

flutter_embedder_test::TEST_F ( FlutterEmbedderTest  ,
EmbeddingWithOverlay   
)

Definition at line 428 of file flutter-embedder-test.cc.

428 {
429 LaunchParentViewInRealm({"--showOverlay"});
430
431 // Take screenshot until we see the child-view's embedded color.
432 ASSERT_TRUE(TakeScreenshotUntil(
433 kChildBackgroundColor,
434 [](std::map<fuchsia_test_utils::Pixel, uint32_t> histogram) {
435 // Expect parent, overlay and child background colors.
436 // With parent color > child color and overlay color > child color.
437 const uint32_t overlay_pixel_count = OverlayPixelCount(histogram);
438 EXPECT_GT(histogram[kParentBackgroundColor], 0u);
439 EXPECT_GT(overlay_pixel_count, 0u);
440 EXPECT_GT(histogram[kChildBackgroundColor], 0u);
441 EXPECT_GT(histogram[kParentBackgroundColor],
442 histogram[kChildBackgroundColor]);
443 EXPECT_GT(overlay_pixel_count, histogram[kChildBackgroundColor]);
444 }));
445}