Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(378)

Side by Side Diff: pkg/analyzer/test/src/context/mock_sdk.dart

Issue 2656673003: Fix for dart:html query() type inference. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/analyzer/test/generated/resolver_driver_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.test.src.context.mock_sdk; 5 library analyzer.test.src.context.mock_sdk;
6 6
7 import 'package:analyzer/file_system/file_system.dart' as resource; 7 import 'package:analyzer/file_system/file_system.dart' as resource;
8 import 'package:analyzer/file_system/memory_file_system.dart' as resource; 8 import 'package:analyzer/file_system/memory_file_system.dart' as resource;
9 import 'package:analyzer/src/context/cache.dart'; 9 import 'package:analyzer/src/context/cache.dart';
10 import 'package:analyzer/src/context/context.dart'; 10 import 'package:analyzer/src/context/context.dart';
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 '$sdkRoot/lib/html/dart2js/html_dart2js.dart', 326 '$sdkRoot/lib/html/dart2js/html_dart2js.dart',
327 ''' 327 '''
328 library dart.html; 328 library dart.html;
329 class HtmlElement {} 329 class HtmlElement {}
330 '''); 330 ''');
331 331
332 const _MockSdkLibrary _LIB_HTML_DARTIUM = const _MockSdkLibrary( 332 const _MockSdkLibrary _LIB_HTML_DARTIUM = const _MockSdkLibrary(
333 'dart:html', 333 'dart:html',
334 '$sdkRoot/lib/html/dartium/html_dartium.dart', 334 '$sdkRoot/lib/html/dartium/html_dartium.dart',
335 ''' 335 '''
336 library dart.html; 336 library dart.dom.html;
337 337
338 abstract class HtmlElement {} 338 final HtmlDocument document;
339
340 abstract class Element {}
341
342 abstract class HtmlDocument {
343 Element query(String relativeSelectors) => null;
344 }
345
346 abstract class HtmlElement extends Element {}
347
348 abstract class AnchorElement extends HtmlElement {}
349 abstract class BodyElement extends HtmlElement {}
350 abstract class ButtonElement extends HtmlElement {}
351 abstract class DivElement extends HtmlElement {}
352 abstract class InputElement extends HtmlElement {}
353 abstract class SelectElement extends HtmlElement {}
354
339 355
340 abstract class CanvasElement extends HtmlElement { 356 abstract class CanvasElement extends HtmlElement {
341 Object getContext(String contextId, [Map attributes]); 357 Object getContext(String contextId, [Map attributes]);
342 CanvasRenderingContext2D get context2D; 358 CanvasRenderingContext2D get context2D;
343 } 359 }
344 360
345 abstract class class CanvasRenderingContext2D {} 361 abstract class class CanvasRenderingContext2D {}
362
363 Element query(String relativeSelectors) => null;
346 '''); 364 ''');
347 365
348 const _MockSdkLibrary _LIB_INTERCEPTORS = const _MockSdkLibrary( 366 const _MockSdkLibrary _LIB_INTERCEPTORS = const _MockSdkLibrary(
349 'dart:_interceptors', 367 'dart:_interceptors',
350 '$sdkRoot/lib/_internal/js_runtime/lib/interceptors.dart', 368 '$sdkRoot/lib/_internal/js_runtime/lib/interceptors.dart',
351 ''' 369 '''
352 library dart._interceptors; 370 library dart._interceptors;
353 '''); 371 ''');
354 372
355 const _MockSdkLibrary _LIB_MATH = const _MockSdkLibrary( 373 const _MockSdkLibrary _LIB_MATH = const _MockSdkLibrary(
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 625
608 @override 626 @override
609 AnalysisCache createCacheFromSourceFactory(SourceFactory factory) { 627 AnalysisCache createCacheFromSourceFactory(SourceFactory factory) {
610 if (factory == null) { 628 if (factory == null) {
611 return super.createCacheFromSourceFactory(factory); 629 return super.createCacheFromSourceFactory(factory);
612 } 630 }
613 return new AnalysisCache( 631 return new AnalysisCache(
614 <CachePartition>[AnalysisEngine.instance.partitionManager.forSdk(sdk)]); 632 <CachePartition>[AnalysisEngine.instance.partitionManager.forSdk(sdk)]);
615 } 633 }
616 } 634 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/generated/resolver_driver_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698