Flutter Engine
 
Loading...
Searching...
No Matches
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 416 of file flutter-embedder-test.cc.

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

◆ TEST_F() [2/2]

flutter_embedder_test::TEST_F ( FlutterEmbedderTest  ,
EmbeddingWithOverlay   
)

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

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