Skip to content

accessibility test meetsGuideline(textContrastGuideline) throws on web #44115

Open

Description

@LongCatIsLooong

This issues surfaced in a pre-submit test: https://cirrus-ci.com/task/4889346271870976

Repro code:

flutter test --platform=chrome test/cupertino/button_test.dart

      await tester.pumpWidget(
        CupertinoApp(
          theme: const CupertinoThemeData(brightness: Brightness.dark),
          home: CupertinoPageScaffold(
            child: CupertinoButton.filled(
              child: const Text('Button'),
              onPressed: () {},
            ),
          )
        ),
      );

      await expectLater(tester, meetsGuideline(textContrastGuideline));

Stacktrace

══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════                                                                                                                                                                                                                  [85/1869]
The following _Exception was thrown while running async test code:                                                                                                                                                                                                                                                             
Exception: Incorrect sequence of push/pop operations while building scene surfaces. After building                                                                                                                                                                                                                             
the scene the persisted surface stack must contain a single element which corresponds to the scene                                                                                                                                                                                                                             
itself (_PersistedScene). All other surfaces should have been popped off the stack. Found the                                                                                                                                                                                                                                  
following surfaces in the stack:                                                                                                                                                                                                                                                                                               
PersistedScene, PersistedTransform                                                                                                                                                                                                                                                                                             
                                                                                                                                                                                                                                                                                                                               
When the exception was thrown, this was the stack:                                                                                                                                                                                                                                                                             
package:dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 194:49      throw_                                                                                                                                                                                                                               
package:build_web_compilers/lib/_engine/engine/surface/scene_builder.dart 26:9            <fn>                                                                                                                                                                                                                                 
package:build_web_compilers/lib/_engine/engine/surface/scene_builder.dart 33:14           get [_persistedScene]                                                                                                                                                                                                                
package:build_web_compilers/lib/_engine/engine/surface/scene_builder.dart 464:21          build                                                                                                                                                                                                                                
package:flutter/src/rendering/layer.dart 767:35                                           buildScene                                                                                                                                                                                                                           
package:flutter/src/rendering/layer.dart 1196:28                                          toImage                                                                                                                                                                                                                              
package:dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54                runBody                                                                                                                                                                                                                              
package:dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:12               _async                                                                                                                                                                                                                               
package:flutter/src/rendering/layer.dart 1185:27                                          toImage                                                                                                                                                                                                                              
package:flutter_test/src/accessibility.dart 204:26                                        <fn>                                                                                                                                                                                                                                 
package:dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54                runBody                                                                                                                                                                                                                              
package:dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:12               _async                                                                                                                                                                                                                               
package:flutter_test/src/accessibility.dart 201:71                                        <fn>                                                                                                                                                                                                                                 
package:flutter_test/src/binding.dart 923:10                                              <fn>                                                                                                                                                                                                                                 
package:dart-sdk/lib/async/zone.dart 1124:13                                              _rootRun                                                                                                                                                                                                                             
package:dart-sdk/lib/async/zone.dart 1021:19                                              run                                                                                                                                                                                                                                  
package:flutter_test/src/binding.dart 913:25                                              runAsync                                                                                                                                                                                                                             
package:flutter_test/src/accessibility.dart 201:43                                        evaluate                                                                                                                                                                                                                             
package:dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54                runBody                                                                                                                                                                                                                              
package:dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:12               _async                                                                                                                                                                                                                               
package:flutter_test/src/accessibility.dart 196:30                                        evaluate                                                                                                                                                                                                                             
package:flutter_test/src/matchers.dart 1973:47                                            matchAsync                                                                                                                                                                                                                           
package:dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54                runBody                                                                                                                                                                                                                              
package:dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:12               _async                                                                                                                                                                                                                               
package:flutter_test/src/matchers.dart 1972:28                                            matchAsync                                                                                                                                                                                                                           
package:test_api/src/frontend/expect.dart 116:25                                          _expect                                                                                                                                                                                                                              
package:test_api/src/frontend/expect.dart 75:5                                            expectLater                                                                                                                                                                                                                          
package:flutter_test/src/widget_tester.dart 269:13                                        expectLater                                                                                                                                                                                                                          
button_test.dart 100:13                                                                   <fn>                                                                                                                                                                                                                                 
package:dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 45:50                onValue                                                                                                                                                                                                                              
package:stack_trace/src/stack_zone_specification.dart 129:26                              <fn>                                                                                                                                                                                                                                 
package:stack_trace/src/stack_zone_specification.dart 209:15                              [_run]                                                                                                                                                                                                                               
package:stack_trace/src/stack_zone_specification.dart 129:14                              <fn>                                                                                                                                                                                                                                 
package:dart-sdk/lib/async/zone.dart 1132:38                                              _rootRunUnary                                                                                                                                                                                                                        
package:dart-sdk/lib/async/zone.dart 1029:19                                              runUnary                                                                                                                                                                                                                             
package:dart-sdk/lib/async/future_impl.dart 137:18                                        handleValue                                                                                                                                                                                                                          
package:dart-sdk/lib/async/future_impl.dart 678:44                                        handleValueCallback                                                                                                                                                                                                                  
package:dart-sdk/lib/async/future_impl.dart 707:32                                        _propagateToListeners                                                                                                                                                                                                                
package:dart-sdk/lib/async/future_impl.dart 522:5                                         [_completeWithValue]                                                                                                                                                                                                                 
package:dart-sdk/lib/async/future_impl.dart 552:7                                         <fn>                                                                                                                                                                                                                                 
package:dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 324:14  _checkAndCall                                                                                                                                                                                                                        
package:dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 329:39  dcall                                                                                                                                                                                                                                
package:quiver/testing/src/async/fake_async.dart 268:32                                   [_drainMicrotasks]                                                                                                                                                                                                                   
package:quiver/testing/src/async/fake_async.dart 164:5                                    flushMicrotasks                                                                                                                                                                                                                      
package:flutter_test/src/binding.dart 1067:16                                             <fn>                                                                                                                                                                                                                                 
package:dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54                runBody                                                                                                                                                                                                                              
package:dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:12               _async                                                                                                                                                                                                                               
package:flutter_test/src/binding.dart 1055:35                                             <fn>                                                                                                                                                                                                                                 
package:dart-sdk/lib/async/future.dart 200:37                                             <fn>                                                                                                                                                                                                                                 
package:stack_trace/src/stack_zone_specification.dart 209:15                              [_run]                                                                                                                                                                                                                               
package:stack_trace/src/stack_zone_specification.dart 119:48                              <fn>                                                                                                                                                                                                                                 
package:dart-sdk/lib/async/zone.dart 1120:38                                              _rootRun                                                                                                                                                                                                                             
package:dart-sdk/lib/async/zone.dart 1021:19                                              run                                                                                                                                                                                                                                  
package:dart-sdk/lib/async/zone.dart 923:7                                                runGuarded                                                                                                                                                                                                                           
package:dart-sdk/lib/async/zone.dart 963:23                                               <fn>                                                                                                                                                                                                                                 
package:stack_trace/src/stack_zone_specification.dart 209:15                              [_run]                                                                                                                                                                                                                               
package:stack_trace/src/stack_zone_specification.dart 119:48                              <fn>                                                                                                                                                                                                                                 
package:dart-sdk/lib/async/zone.dart 1124:13                                              _rootRun                                                                                                                                                                                                                             
package:dart-sdk/lib/async/zone.dart 1021:19                                              run                                                                                                                                                                                                                                  
package:dart-sdk/lib/async/zone.dart 923:7                                                runGuarded                                                                                                                                                                                                                           
package:dart-sdk/lib/async/zone.dart 963:23                                               callback                                                                                                                                                                                                                             
package:dart-sdk/lib/async/schedule_microtask.dart 41:11                                  _microtaskLoop                                                                                                                                                                                                                       
package:dart-sdk/lib/async/schedule_microtask.dart 50:5                                   _startMicrotaskLoop                                                                                                                                                                                                                  
package:dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 166:15               <fn>   

Version

[✓] Flutter (Channel unknown, v1.10.7-pre.107, on Linux, locale en_US.UTF-8)
    • Flutter version 1.10.7-pre.107 
    • Framework revision 2affe5ba7c (3 days ago), 2019-11-01 16:07:20 -0700
    • Engine revision 8ea19b1c76
    • Dart version 2.6.0 (build 2.6.0-dev.8.2 bbe2ac28c9)

Activity

  1. added
    a: tests"flutter test", flutter_test, or one of our tests
    platform-webWeb applications specifically
    on Nov 4, 2019
  2. added this to the milestone on Nov 7, 2019
  3. Piinks commented on Apr 21, 2020

    @Piinks
    Contributor

    Here is another example of where this bug is present:

    await expectLater(tester, meetsGuideline(textContrastGuideline));

    Also present in outline_button_test.dart, and flat_button_test.dart. The affected tests are skipped and reference this bug.

  4. added
    P1High-priority issues at the top of the work list
    on May 29, 2020
  5. modified the milestone: on Jun 1, 2020
  6. added
    P2Important issues not at the top of the work list
    and removed
    P1High-priority issues at the top of the work list
    on Jun 17, 2020
  7. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Jul 3, 2020
  8. modified the milestone: on Jul 7, 2020
  9. removed this from the milestone on Jul 22, 2020
  10. removed this from the milestone on Aug 17, 2020
  11. added
    team: skip-testAn issue used to track tests that are skipped.
    c: tech-debtTechnical debt, code quality, testing, etc.
    on Jul 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)a: tests"flutter test", flutter_test, or one of our testsc: parityWorks on one platform but not anotherc: tech-debtTechnical debt, code quality, testing, etc.frameworkflutter/packages/flutter repository. See also f: labels.platform-webWeb applications specificallyteam-webOwned by Web platform teamteam: skip-testAn issue used to track tests that are skipped.triaged-webTriaged by Web platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions