Skip to content

Commit

Permalink
[iOS] Add task for spell check integration test (#116222)
Browse files Browse the repository at this point in the history
* Add fix and test

* Add test owner

* Print error for testing

* Make sure locale is the problem

* Test capitalization fix

* Take out Android specific test

* Verify eng fix

* Test fix

* Empty-Commit

* Test all tests

* Up string size for testing

* Remove test

* Undo ci.yaml testing changes

* Test android variant:

* Change to testwidgets

* Add widget tester

* Remove android only attempt

* Revert ci.yaml changes
  • Loading branch information
camsim99 authored Dec 22, 2022
1 parent ca7ca3b commit 9fb1ae8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3895,7 +3895,7 @@ targets:
properties:
tags: >
["devicelab", "ios", "mac"]
task_name: spell_check_test
task_name: spell_check_test_ios

- name: Mac native_ui_tests_macos
recipe: devicelab/devicelab_drone
Expand Down
1 change: 1 addition & 0 deletions TESTOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@
/dev/devicelab/bin/tasks/web_benchmarks_html.dart @yjbanov @flutter/web
/dev/devicelab/bin/tasks/windows_home_scroll_perf__timeline_summary.dart @jonahwilliams @flutter/engine
/dev/devicelab/bin/tasks/windows_startup_test.dart @loic-sharma @flutter/desktop
/dev/devicelab/bin/tasks/spell_check_test_ios.dart @camsim99 @flutter/android

## Host only framework tests
# Linux analyze
Expand Down
12 changes: 12 additions & 0 deletions dev/devicelab/bin/tasks/spell_check_test_ios.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'package:flutter_devicelab/framework/devices.dart';
import 'package:flutter_devicelab/framework/framework.dart';
import 'package:flutter_devicelab/tasks/integration_tests.dart';

Future<void> main() async {
deviceOperatingSystem = DeviceOperatingSystem.ios;
await task(createSpellCheckIntegrationTest());
}
Original file line number Diff line number Diff line change
Expand Up @@ -176,26 +176,4 @@ void main() {

expect(expectedTextSpanTreeFound, isTrue);
});

test(
'fetchSpellCheckSuggestions returns null when there is a pending request',
() async {
final String text =
'neaf niofenaifn iofn iefnaoeifn ifneoa finoiafn inf ionfieaon ienf ifn ieonfaiofneionf oieafn oifnaioe nioenfio nefaion oifan' *
10;

defaultSpellCheckService.fetchSpellCheckSuggestions(locale, text);

final String modifiedText = text.substring(5);

final List<SuggestionSpan>? spellCheckSuggestionSpans =
await defaultSpellCheckService.fetchSpellCheckSuggestions(
locale, modifiedText);

expect(spellCheckSuggestionSpans, isNull);

// We expect it to be rare for the first request to complete before the
// second, so no text should be saved as of now.
expect(defaultSpellCheckService.lastSavedResults, null);
});
}

0 comments on commit 9fb1ae8

Please sign in to comment.