Flutter Engine
The Flutter Engine
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 424 of file flutter-embedder-test.cc.

424 {
425 LaunchParentViewInRealm();
426
427 // Take screenshot until we see the child-view's embedded color.
428 ASSERT_TRUE(TakeScreenshotUntil(
429 kChildBackgroundColor,
430 [](std::map<fuchsia_test_utils::Pixel, uint32_t> histogram) {
431 // Expect parent and child background colors, with parent color > child
432 // color.
433 EXPECT_GT(histogram[kParentBackgroundColor], 0u);
434 EXPECT_GT(histogram[kChildBackgroundColor], 0u);
435 EXPECT_GT(histogram[kParentBackgroundColor],
436 histogram[kChildBackgroundColor]);
437 }));
438}

◆ TEST_F() [2/2]

flutter_embedder_test::TEST_F ( FlutterEmbedderTest  ,
EmbeddingWithOverlay   
)

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

440 {
441 LaunchParentViewInRealm({"--showOverlay"});
442
443 // Take screenshot until we see the child-view's embedded color.
444 ASSERT_TRUE(TakeScreenshotUntil(
445 kChildBackgroundColor,
446 [](std::map<fuchsia_test_utils::Pixel, uint32_t> histogram) {
447 // Expect parent, overlay and child background colors.
448 // With parent color > child color and overlay color > child color.
449 const uint32_t overlay_pixel_count = OverlayPixelCount(histogram);
450 EXPECT_GT(histogram[kParentBackgroundColor], 0u);
451 EXPECT_GT(overlay_pixel_count, 0u);
452 EXPECT_GT(histogram[kChildBackgroundColor], 0u);
453 EXPECT_GT(histogram[kParentBackgroundColor],
454 histogram[kChildBackgroundColor]);
455 EXPECT_GT(overlay_pixel_count, histogram[kChildBackgroundColor]);
456 }));
457}