mojo/public/tools/mojom/mojom/parse/conditional_features_unittest.py
def testFilterStruct(self):
    """Test that definitions are correctly filtered from a Struct."""
    struct_source = """
      struct MyStruct {
        [EnableIf=blue]
        enum MyEnum {
          VALUE1,
          [EnableIf=purple]
          VALUE2,
        };
        [EnableIf=yellow]
        const double kMyConst = 1.23;
        [EnableIf=green]
        int32 a;
        double b;
        [EnableIf=purple]
        int32 c;
        [EnableIf=blue]
        double d;
        int32 e;
        [EnableIf=orange]
        double f;
      };
    """
    expected_source = """
      struct MyStruct {
        [EnableIf=blue]
        enum MyEnum {
          VALUE1,
        };
        [EnableIf=green]
        int32 a;
        double b;
        [EnableIf=blue]
        double d;
        int32 e;
      };
    """
    self.parseAndAssertEqual(struct_source, expected_source)
Test that definitions are correctly filtered from a Struct.
Test that definitions are correctly filtered from a Struct.
Test that definitions are correctly filtered from a Struct .
def testFilterStruct(self):
    struct_source = """
      struct MyStruct {
        [EnableIf=blue]
        enum MyEnum {
          VALUE1,
          [EnableIf=purple]
          VALUE2,
        };
        [EnableIf=yellow]
        const double kMyConst = 1.23;
        [EnableIf=green]
        int32 a;
        double b;
        [EnableIf=purple]
        int32 c;
        [EnableIf=blue]
        double d;
        int32 e;
        [EnableIf=orange]
        double f;
      };
    """
    expected_source = """
      struct MyStruct {
        [EnableIf=blue]
        enum MyEnum {
          VALUE1,
        };
        [EnableIf=green]
        int32 a;
        double b;
        [EnableIf=blue]
        double d;
        int32 e;
      };
    """
    self.parseAndAssertEqual(struct_source, expected_source)
def testFilterStruct ( self ) : struct_source = """
      struct MyStruct {
        [EnableIf=blue]
        enum MyEnum {
          VALUE1,
          [EnableIf=purple]
          VALUE2,
        };
        [EnableIf=yellow]
        const double kMyConst = 1.23;
        [EnableIf=green]
        int32 a;
        double b;
        [EnableIf=purple]
        int32 c;
        [EnableIf=blue]
        double d;
        int32 e;
        [EnableIf=orange]
        double f;
      };
    """ expected_source = """
      struct MyStruct {
        [EnableIf=blue]
        enum MyEnum {
          VALUE1,
        };
        [EnableIf=green]
        int32 a;
        double b;
        [EnableIf=blue]
        double d;
        int32 e;
      };
    """ self . parseAndAssertEqual ( struct_source , expected_source )
Test that definitions are correctly filtered from a Struct.
Test that definitions are correctly filtered from a Struct .
"""Test that definitions are correctly filtered from a Struct."""
self