edca6169c1
- Fixed HTML API's with callback typedef to correctly convert Dart function to JS function. - Expose HttpStatus from dart:html - Expose DomName ondblclick and dblclickEvent for Angular analyzer. - Fixed removeAll should be Iterable<Object> to match Set's removeAll not Iterable<E>. - Fixed a number of DataTransferItem, Entry, FileEntry and DiretoryEntry returning NativeJavaScriptObject needed type registered in DDC. - Added ability to allow local file access from Chrome browser added -local in ddb. R=vsm@google.com Fixes #30278 Fixes #35484 Fixes #34318 Fixes #35510 Change-Id: Ide8c04716c54045e837781d489562f27b694b109 Reviewed-on: https://dart-review.googlesource.com/c/89340 Commit-Queue: Terry Lucas <terry@google.com> Reviewed-by: Vijay Menon <vsm@google.com> Reviewed-by: Nate Bosch <nbosch@google.com>
34 lines
914 B
Dart
34 lines
914 B
Dart
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
|
|
// for details. 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:expect/minitest.dart';
|
|
|
|
bool testSwitch(int currentValue) {
|
|
switch (currentValue) {
|
|
case HttpStatus.continue_:
|
|
return true;
|
|
case HttpStatus.ok:
|
|
return true;
|
|
case HttpStatus.NETWORK_CONNECT_TIMEOUT_ERROR:
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
main() {
|
|
expect(testSwitch(HttpStatus.continue_), isTrue);
|
|
expect(testSwitch(HttpStatus.CONTINUE), isTrue);
|
|
|
|
expect(testSwitch(HttpStatus.ok), isTrue);
|
|
expect(testSwitch(HttpStatus.OK), isTrue);
|
|
|
|
expect(testSwitch(HttpStatus.networkConnectTimeoutError), isTrue);
|
|
expect(testSwitch(HttpStatus.NETWORK_CONNECT_TIMEOUT_ERROR), isTrue);
|
|
|
|
expect(testSwitch(-20100), isFalse);
|
|
}
|