mirror of
https://github.com/encounter/engine.git
synced 2026-07-10 03:18:43 -07:00
81e010f771
* last flutter web sync: cc38319841 * revert text.dart changes * revert paragraph.dart * link to issue
49 lines
1.4 KiB
Dart
49 lines
1.4 KiB
Dart
// Copyright 2013 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 'dart:html';
|
|
|
|
import 'package:ui/src/engine.dart';
|
|
import 'package:ui/ui.dart' as ui;
|
|
import 'package:test/test.dart';
|
|
|
|
void main() {
|
|
const MethodCodec codec = JSONMethodCodec();
|
|
|
|
group('Title', () {
|
|
test('is set on the document by platform message', () {
|
|
// Run the unit test without emulating Flutter tester environment.
|
|
ui.debugEmulateFlutterTesterEnvironment = false;
|
|
|
|
// TODO(yjbanov): https://github.com/flutter/flutter/issues/39159
|
|
document.title = '';
|
|
expect(document.title, '');
|
|
|
|
ui.window.sendPlatformMessage(
|
|
'flutter/platform',
|
|
codec.encodeMethodCall(const MethodCall(
|
|
'SystemChrome.setApplicationSwitcherDescription',
|
|
<String, dynamic>{
|
|
'label': 'Title Test',
|
|
'primaryColor': 0xFF00FF00,
|
|
})),
|
|
null);
|
|
|
|
expect(document.title, 'Title Test');
|
|
|
|
ui.window.sendPlatformMessage(
|
|
'flutter/platform',
|
|
codec.encodeMethodCall(const MethodCall(
|
|
'SystemChrome.setApplicationSwitcherDescription',
|
|
<String, dynamic>{
|
|
'label': 'Different title',
|
|
'primaryColor': 0xFF00FF00,
|
|
})),
|
|
null);
|
|
|
|
expect(document.title, 'Different title');
|
|
});
|
|
});
|
|
}
|