From 29b95d5ee6e58c9f55164ac34fae9a507fa998c4 Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Thu, 2 May 2019 13:29:51 -0700 Subject: [PATCH 1/2] fix api conformance check --- lib/stub_ui/lib/text.dart | 8 ++++++++ lib/stub_ui/lib/window.dart | 9 +++++++++ web_sdk/test/api_conform_test.dart | 8 +++++--- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/lib/stub_ui/lib/text.dart b/lib/stub_ui/lib/text.dart index f6e1bd92fd1b8..be588059f8286 100644 --- a/lib/stub_ui/lib/text.dart +++ b/lib/stub_ui/lib/text.dart @@ -1375,6 +1375,14 @@ class Paragraph { List getWordBoundary(int offset) { throw UnimplementedError(); } + + /// The distance from the left edge of the leftmost glyph to the right edge of + /// the rightmost glyph in the paragraph. + /// + /// Valid only after [layout] has been called. + double get longestLine { + throw UnimplementedError(); + } } /// Builds a [Paragraph] containing text with the given styling information. diff --git a/lib/stub_ui/lib/window.dart b/lib/stub_ui/lib/window.dart index d874f7b5a9677..ddaac6e861e2e 100644 --- a/lib/stub_ui/lib/window.dart +++ b/lib/stub_ui/lib/window.dart @@ -114,6 +114,15 @@ class WindowPadding { String toString() { return '$runtimeType(left: $left, top: $top, right: $right, bottom: $bottom)'; } + + /// Returns a syntactically valid Unicode BCP47 Locale Identifier. + /// + /// Some examples of such identifiers: "en", "es-419", "hi-Deva-IN" and + /// "zh-Hans-CN". See http://www.unicode.org/reports/tr35/ for technical + /// details. + String toLanguageTag() { + throw UnimplementedError(); + } } /// An identifier used to select a user's language and formatting preferences. diff --git a/web_sdk/test/api_conform_test.dart b/web_sdk/test/api_conform_test.dart index bf4b6283038f1..1dd8b850c1e0c 100644 --- a/web_sdk/test/api_conform_test.dart +++ b/web_sdk/test/api_conform_test.dart @@ -2,9 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'dart:io'; + import 'package:analyzer/analyzer.dart'; -int main() { +void main() { // These files just contain imports to the part files; final CompilationUnit uiUnit = parseDartFile('lib/ui/ui.dart', parseFunctionBodies: false, suppressErrors: false); @@ -86,10 +88,10 @@ int main() { } if (failed) { print('Failure!'); - return 1; + exit(1); } print('Success!'); - return 0; + exit(0); } // Collects all public classes defined by the part files of [unit]. From 549f00996717620fe26aaa633fe75dc505dc0a41 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Thu, 2 May 2019 13:41:26 -0700 Subject: [PATCH 2/2] Update window.dart --- lib/stub_ui/lib/window.dart | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/stub_ui/lib/window.dart b/lib/stub_ui/lib/window.dart index ddaac6e861e2e..90cbd083a9195 100644 --- a/lib/stub_ui/lib/window.dart +++ b/lib/stub_ui/lib/window.dart @@ -114,15 +114,6 @@ class WindowPadding { String toString() { return '$runtimeType(left: $left, top: $top, right: $right, bottom: $bottom)'; } - - /// Returns a syntactically valid Unicode BCP47 Locale Identifier. - /// - /// Some examples of such identifiers: "en", "es-419", "hi-Deva-IN" and - /// "zh-Hans-CN". See http://www.unicode.org/reports/tr35/ for technical - /// details. - String toLanguageTag() { - throw UnimplementedError(); - } } /// An identifier used to select a user's language and formatting preferences. @@ -395,6 +386,15 @@ class Locale { out.write('_$countryCode'); return out.toString(); } + + /// Returns a syntactically valid Unicode BCP47 Locale Identifier. + /// + /// Some examples of such identifiers: "en", "es-419", "hi-Deva-IN" and + /// "zh-Hans-CN". See http://www.unicode.org/reports/tr35/ for technical + /// details. + String toLanguageTag() { + throw UnimplementedError(); + } } /// The most basic interface to the host operating system's user interface.