Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
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 413 of file flutter-embedder-test.cc.

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

◆ TEST_F() [2/2]

flutter_embedder_test::TEST_F ( FlutterEmbedderTest  ,
EmbeddingWithOverlay   
)

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

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