Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix per breaking change to HttpRequest and HttpClientResponse #216

Merged
merged 2 commits into from Jul 2, 2019

Conversation

tvolkert
Copy link
Contributor

A recent change to the Dart SDK updated HttpRequest and
HttpClientResponse from implementing Stream<List<int>> to
implementing Stream<Uint8List>.

This forwards-compatible change prepares for that SDK breaking
change by casting the Stream to List<int> before transforming
it.

dart-lang/sdk#36900

A recent change to the Dart SDK updated `HttpRequest` and
`HttpClientResponse` from implementing `Stream<List<int>>` to
implementing `Stream<Uint8List>`.

This forwards-compatible change prepares for that SDK breaking
change by casting the Stream to `List<int>` before transforming
it.

dart-lang/sdk#36900
@tvolkert
Copy link
Contributor Author

tvolkert commented Jul 1, 2019

@kevmoo I think this change not being merged is blocking Morgan in google3.

@davidmorgan
Copy link

Yes, please let me know ASAP when this is merged/rolled. Thanks.

@tvolkert
Copy link
Contributor Author

tvolkert commented Jul 2, 2019

@goderbauer

@goderbauer
Copy link
Member

@mk13

@mk13 mk13 merged commit beb9d95 into google:master Jul 2, 2019
@tvolkert tvolkert deleted the http branch July 2, 2019 18:47
@tvolkert
Copy link
Contributor Author

tvolkert commented Jul 2, 2019

Thanks @mk13! Can you please publish it to Pub too?

@davidmorgan
Copy link

Please let me know when it's rolled into google3. Thanks.

@tvolkert
Copy link
Contributor Author

tvolkert commented Jul 3, 2019

@jingbian @mk13

There are a ton of changes in this package that haven't yet rolled into google3 - can one of you roll this in please? Or should we just patch this fix in locally?

@mk13
Copy link
Member

mk13 commented Jul 3, 2019 via email

@mk13
Copy link
Member

mk13 commented Jul 3, 2019 via email

kevmoo pushed a commit that referenced this pull request Jan 20, 2021
Webdriver new version: 2.1.1

Fix for cl/256391459.

PiperOrigin-RevId: 256631772
kevmoo pushed a commit that referenced this pull request Jan 20, 2021
Webdriver new version: 2.1.1

Fix for cl/256391459.

PiperOrigin-RevId: 256631772
mk13 pushed a commit that referenced this pull request Jan 20, 2021
* Project import generated by Copybara.

PiperOrigin-RevId: 237497733

* Add `findChain()` to page objects so that it can be used to generate proper method call chain given internal element ids.

Also add `parents`, which would be needed when calling `findChain()`.

Design doc: go/webdriver-test-creator

PiperOrigin-RevId: 242099212

* [webdriver] Delete duplicated and deprecated lints.

PiperOrigin-RevId: 242730783

* Improve WebElement.parents performance by cache `parent` result.

PiperOrigin-RevId: 248105147

* Don't rely on error message when recreating existing session.

PiperOrigin-RevId: 248139435

* Use compatible format when serializing WebElement.

PiperOrigin-RevId: 248357031

* Fix an inaccurately implemented W3C element finder.

Also improved the isElementDisplayed method in xbid to only catch
NoSuchElementException.

PiperOrigin-RevId: 250314609

* Add support for single-element screenshots in the Dart webdriver client.

PiperOrigin-RevId: 250772976

* Update Chrome version if possible to fix.

Forwarder test is not needed as it's not used internally. Hiding it from build rules. Will keep the code there in case external users need it.

PiperOrigin-RevId: 252066010

* Enable log retrieval for W3C with a catch on UnknownCommandException in case it's not supported.

PiperOrigin-RevId: 252711952

* Expect the size to be larger than 0 even if it's W3C.

PiperOrigin-RevId: 254152380

* Add moveToElementCenter and moveToElementTopLeft to declare the origin for offset explicitly.

Explicitly include JsonWire Chrome in tests.

PiperOrigin-RevId: 254157910

* Add mouse.hide() in dart:webdriver.

PiperOrigin-RevId: 254260141

* Github to G3 sync: #216

Webdriver new version: 2.1.1

Fix for cl/256391459.

PiperOrigin-RevId: 256631772

* Fix issues with Uint8List.

PiperOrigin-RevId: 256988100

* Use `/displayed` to check whether web element is displayed, as suggested from https://www.w3.org/TR/webdriver1/#element-displayedness.

Also added a test where the parent is invisible and the child should be considered as invisible too.

PiperOrigin-RevId: 267954825

* Add rect to async webdriver to match sync webdriver.

PiperOrigin-RevId: 277584841

* Support setting static headers to be sent with every web driver request.

PiperOrigin-RevId: 294479855

* Use dynamic expiry date to fix cookie test breakage.

The change in third_party/dart_lang is to fix build definition breakage: https://test.corp.google.com/ui#p=dart_lang.presubmit&d=projectInfo

PiperOrigin-RevId: 295602159

* Project import generated by Copybara.

PiperOrigin-RevId: 295692551

* Make default hide postion (100, 0) in case window is too small.

PiperOrigin-RevId: 306465783

* Pass spec down to create WebDriver instance in its tests.

PiperOrigin-RevId: 306809382

* Remove forwarder.dart, which is not used and no longer working with W3C for external repo.

PiperOrigin-RevId: 307059052

* Some compatibility change for Dart 2.0.
Also bring some compatibility change for external Github with JsonWire Chrome.

PiperOrigin-RevId: 307569981

* Minor simplifications to help with Null Safety

This simplifies the code a bit and helps the migration tool
to figure out the nullability correctly.

PiperOrigin-RevId: 321723762

* Avoid returning null from a factory method

With Null Safety factory constructors will not be allowed to return `null`
values. We could make this into a static method, but it seems that there
already is an assertion that the argument is of a specific type, so I thought
that we could simply make it into a check and throw `ArgumentError` for
unsupported types.

Here's the global presubmit:
http://test/OCL:321566434:BASE:322085661:1595227618340:70519a7c
and its deflake:
http://test/OCL:321566434:BASE:322085661:1595232479037:1d5b2f0f
(tl;dr: it seems that there are only a few timeouts of flaky tests)

Do let me know if you prefer the alternative of using a static method instead.

PiperOrigin-RevId: 322342435

* Return Point<int> from WebElement.location

`parseLocationResponse` already returns `Point<int>` so this makes it
a bit more precise. This will also help with Null Safety where some of
the implicit casts need to become explicit.

PiperOrigin-RevId: 322345497

* Avoid unnecessary `?.` operators in tests

Since we unconditionally initialize the fields in `setUp` and
`tearDown` runs only after a test, the variables should never
be `null`.

This will help with Null Safety, since we'll be able to use the
new `late` keyword for these and avoid warnings about the null
aware operators.

PiperOrigin-RevId: 322359905

* Return Point<int> from WebElement.location

This is what `parseLocationResponse` returns anyway and making the type
more accurate will help with Null Safety migration.

PiperOrigin-RevId: 322790866

* Minor fixes for types in AsyncRequestClient

It seems there was a typo in the parameter.

PiperOrigin-RevId: 323307625

* Update trunk, v2 and macos_sdk to 01c217ecc9d17f6e2d35300525605d53a750cda0. Unbundle packages.

Additional manual changes:

  - Enabled null safety for several unbundled packages in third_party/dart
    and for bundled third_party/pkg/pool in v2 and trunk
  - Patched https://dart-review.googlesource.com/c/sdk/+/155440
  - Disabled dead_code finding for sass and flutter_gallery
  - Fixed fuchsia timezone-related dependencies
  - Increased js size for hacker_news_pwa Angular example
  - Fixed dead_code error in dart2js_analysis_server
  - Ignored dead_code error in third_party/dart/webdriver/lib/support/stdio_stepper.dart
  - Fixed //javatests/com/google/dart/debugging tests

External changes:

  - 01c217ecc9d17f6e2d35300525605d53a750cda0 Analyzer: Move tests for 5 codes to diagnostics/ by Sam Rawlins <srawlins@google.com>
  - 1a829bbde0697b8494c1d1a86753d2291d07d07d Analyzer: Recategorize COULD_NOT_INFER as CompileTimeErro... by Sam Rawlins <srawlins@google.com>
  - 70aa3ac534293c439218e44914a32b5ca2f3c4c0 Update verify_diagnostics_test after moving to CompileTim... by Konstantin Shcheglov <scheglov@google.com>
  - ba92b78acd14e6cbe99b417e559a50660aecca7f Move errors from StaticWarningCode to CompileTimeErrorCode. by Konstantin Shcheglov <scheglov@google.com>
  - 0fcd35f653bf8d5c01585ef5cd4125d5c2573617 Use Scope lookup directly in ReferenceResolver. by Konstantin Shcheglov <scheglov@google.com>
  - 4de9f9f75a2bf0ad5c21eb00ea5bd4274680c587 Sort error / hint codes. by Konstantin Shcheglov <scheglov@google.com>
  - 8745cd5323a7f964af48524177c7b51a9a245c4d Use new Scope directly to simplify TypeNameResolver. by Konstantin Shcheglov <scheglov@google.com>
  - 9e1b6030d23ae6d7a43650803376b0f2a41ec6e4 Fix a type cast exception in the create-constructor fix (... by Brian Wilkerson <brianwilkerson@google.com>
  - bf411fcc107b1f32e179e1617806ff49c768e3a3 Prepare to publish analyzer 0.39.15. by Konstantin Shcheglov <scheglov@google.com>
  - 73748636ab7ce407c20d5de966c865a7af82bc05 [dart2js] Canonicalize empty collections in FunctionType by Stephen Adams <sra@google.com>
  - b4943094f0d2dd34dfef1e4e4ec9cb6669c3a9c7 [ VM / DartDev ] Spawn DartDev isolate with flags matchin... by Ben Konyi <bkonyi@google.com>
  - 8d8dbfcea24f020a06c0127f20a83affc6f4638a Add @OverRide bulk-fix by pq <pquitslund@google.com>
  - 6fc6c476b002cabefd574de00fb5a8c3f9e9d414 Updates for typed literals resolution tests. by Konstantin Shcheglov <scheglov@google.com>
  - f4053e3811f2892cb8d68eee60ab5979a3afa49f [dart2js] Use Maplet in deferred_Load by Stephen Adams <sra@google.com>
  - ac71a391a385f260906740588fc99759a43817ff Add TypeSystemImpl.futureOrBase (), stop using iterable/m... by Konstantin Shcheglov <scheglov@google.com>
  - a4baaa3ac5e1615db1184bd3d219682f7829a130 Fix a bug in the way RangeFactory deals with trailing com... by Brian Wilkerson <brianwilkerson@google.com>
  - b61e229a6db9ae3bf35f2258dfe72affeef8377c Issue 41065. Remove unnecessary null workaround. by Konstantin Shcheglov <scheglov@google.com>
  - 9282f1b14a82879fb49aad8dd8c98b17e26c41f6 Fix for invalid implicit downcast in InterfaceType.allSup... by Konstantin Shcheglov <scheglov@google.com>
  - 4fcd77cbf3a6f39b4c811bdffc7ee9d6d3d2f666 [dart2js] Ensure setter Invocation names end with "=". by Mayank Patke <fishythefish@google.com>
  - 8c1829e11001d0f88b3138b904053e3702f0c8a2 bulk fix protocol wiring by pq <pquitslund@google.com>
  - f169b5729389d062bc94848e3eeca78f6c7cff99 [vm] Avoid eager creation of patch classes array in kerne... by Martin Kustermann <kustermann@google.com>
  - c65b444145cca1f67afa3e3b3f0708c4f14551f9 Analyzer: Move TOP_LEVEL_CYCLE to be a compile-time error by Sam Rawlins <srawlins@google.com>
  - afee49e7c1b76053d8203b2231db5c136a725db5 Add a default clientID when running in LSP mode by Danny Tuppeny <danny@tuppeny.com>
  - 8c70a6004d7749f172f2c6276e0407dc8e29e0bc Add tests for inconsistent language markers in part files. by Lasse Reichstein Holst Nielsen <lrn@google.com>
  - 37c8c709bfed93fb05a175aa4728e7b1d018143d Move `BytesBuilder` class and implementation to `dart:typ... by Johnni Winther <johnniwinther@google.com>
  - 7e8348f4ce87f89235154e974c799de57473c4f4 [dart2js] Assume `isPotentialSubtype` is always true. by Mayank Patke <fishythefish@google.com>
  - 5671730c5ae2e08bf8c0d63bb076fec1930ce868 [dart2js] Pass type arguments to callable properties even... by Mayank Patke <fishythefish@google.com>
  - 4c74ebb3676d3b4a31b3f896ad9236af44dcbebc [benchmark] Add dartdevc-null targets. by Jonas Termansen <sortie@google.com>
  - 56708696a9e9124c42f06c64ac49600b2e17c221 [vm/nnbd/bytecode] Distinguish function types with differ... by Alexander Markov <alexmarkov@google.com>
  - d2f7039e9caddf8f041776d5eadedb34892c7865 [dart:io] Parse scoped IPv6 in constructor of InternetAdd... by Zichang Guo <zichangguo@google.com>
  - c2d28d1569a597e4c2c70b4beb9dc851cce9b404 Rename Null Safety tests. by Konstantin Shcheglov <scheglov@google.com>
  - 4d3ec06277042a84344f74cc260cd58784f6c41f Add more data and performance operations for Cider. by Konstantin Shcheglov <scheglov@google.com>
  - 3103d859e4a38417ed15955542c2f4cb3dc661a6 Remove unused TypeSystemImpl.mostSpecificTypeArgument(). by Konstantin Shcheglov <scheglov@google.com>
  - 6d9a4f16ddc792fa39d2d942e8b1d2c2c1c1a29e Issue 42757. Implement null spread element typing with nu... by Konstantin Shcheglov <scheglov@google.com>
  - 8c316a99de401a63a7818ff1552527ec5662dcf4 Remove unnecessary null checks. by Konstantin Shcheglov <scheglov@google.com>
  - 6c9b885e57ee5a52013c07e2af458ab58405198b Remove StrongModeCode.INVALID_PARAMETER_DECLARATION; it's... by Sam Rawlins <srawlins@google.com>
  - b98eb386eae5998eafbf674f307267738b8a2214 [ddc] Use prebuilt_dart_action to build js by Nicholas Shahan <nshahan@google.com>
  - 8796382840ddd440db9d1815c4ac83ffb26f1d2d Analyzer: Move invalid_super_invocation to compile-time e... by Sam Rawlins <srawlins@google.com>
  - cece303eb4decfd7c06cf3987ea3b5a909390062 Check diagnostics in List/Map/SetLiteralTest(s). by Konstantin Shcheglov <scheglov@google.com>
  - cc519b9a0366ae8e49bf78a15c73545ec0d3cfd9 Test that during partial resolution for Cider we don't re... by Konstantin Shcheglov <scheglov@google.com>
  - 4ea6d6e13067489ff8fd03235e48ecd4aac4b427 [tests/ffi] Re-enable commented out tests by Daco Harkes <dacoharkes@google.com>
  - 2225b6f472c5471f60ad8daf614a1d3966372b0a Migration: fix handling of async functions that return Fu... by Paul Berry <paulberry@google.com>
  - f907e561c9fcbdd16f08a3e9fd459c9da3b262c8 Migration: never produce a type of the form `FutureOr<T?>... by Paul Berry <paulberry@google.com>
  - 69ba6e5f80e25cea566f6eb0dfb1c81e9ec78980 Make FileSystemEntity.absolutePath understand more Window... by Lasse Reichstein Holst Nielsen <lrn@google.com>
  - 202e32afebce3226879c0ab9920ced365847d79d [vm] Native API: Introduce Dart_FinalizableHandle by Daco Harkes <dacoharkes@google.com>
  - debb4dddea5cd13e7a0a4cdda0bf1fb5027e990d [co19] Language/Types and Language/Variables tests enabled by sgrekhov <sgrekhov@unipro.ru>
  - 36614642973dd0fa7594839fdb42d50ae6663e34 [infra] Update checked-in SDKs to 2.10.0-0.0.dev by William Hesse <whesse@google.com>
  - b8dc7627a97de2ce0dbc5e460d9d0a75c2c721f0 [cfe] Handle NullCheck in constant evaluation by Johnni Winther <johnniwinther@google.com>
  - 40fd1c456e0a872ab8f6d2a018b3436d2f7a5f84 Revert "[dart:io] Add Abort() on HttpClientRequest" by Zichang Guo <zichangguo@google.com>
  - 17d7296a4242958feaf7f7203c9258e97b4b513f [vm/nnbd/bytecode] Fix reuse of type arguments in bytecode by Alexander Markov <alexmarkov@google.com>
  - 58b6f40c739c0c215ebbd0d1fbe6c4261433cafb Issue 42797. Understand in legacy libraries that a functi... by Konstantin Shcheglov <scheglov@google.com>
  - fc8a6d9f9bdb7906fde5c268841afed4406e2e7f [VM/compiler] Dereference TypeRef literal when propagatin... by Regis Crelier <regis@google.com>
  - 0689ec527a779b13517dd7bed98e855a4e1ca658 Move "test.dart" (well, most of its contents) into pkg/te... by Robert Nystrom <rnystrom@google.com>
  - 1094b3c61d51d6d64a12079f64bdaa1c9672bf5c Prepare static error test updater tool to handle web tests. by Robert Nystrom <rnystrom@google.com>
  - b258585f2f6b819b892529eb0e9f1ca0381c22c5 [observatory] Migrate from deprecated isInstanceOf to isA. by Ryan Macnak <rmacnak@google.com>
  - dfe1d9b682afc710744f3f7c7b15af97d5bd5d47 Disable OverrideContributor for Cider. by Konstantin Shcheglov <scheglov@google.com>
  - aea99b2f5cef1886d7079790a0046bfe3a8a01be scope debug property assist to Diagnosticables by pq <pquitslund@google.com>
  - 4b96f20a79a6eca074dc17b8b84448f79d4acfc8 [dart:io] Add Abort() on HttpClientRequest by Zichang Guo <zichangguo@google.com>
  - 1b1a39708cf1bfbd85c8de9c13912338c5fd50be [build] Use frameworks instead of libs by Roland McGrath <mcgrathr@google.com>
  - 3fef522496001b50a49b68bfe488d474206192f8 Revert "Reland "[vm] Replaces fuchsia.deprecatedtimezone"" by Filip Filmar <fmil@google.com>
  - 8c664d4f3fa982dacca6112fa05f46e6280bca89 Revert "Issue 42797. Understand in legacy libraries that ... by Konstantin Shcheglov <scheglov@google.com>
  - 2efb5bebc7d71df19558611e22565912401dbb66 [ dart:_http ] Fix typo in HTTP response timeline event by Ben Konyi <bkonyi@google.com>
  - 0884dae36cca1bd7669e5941d95a44f891d7aeb9 Revert "Fix the #include path for ICU headers" by Filip Filmar <fmil@google.com>
  - 5171534e815547397be1ac3c2fae60ea32749553 Scope tweaks. Report REFERENCED_BEFORE_DECLARATION in mor... by Konstantin Shcheglov <scheglov@google.com>
  - 6bba75079a1f7166c00ad250a6de6fc3aaff9b17 Issue 42797. Understand in legacy libraries that a functi... by Konstantin Shcheglov <scheglov@google.com>
  - b4ebbb7f5c0bcaab4f154e4bbbe414b463a2ee22 [build] Update gn to match Fuchsia by Roland McGrath <mcgrathr@google.com>
  - cb428a7a0210b5dd89b29a0f5c381ef38b630e47 [dart2js] Remove old bug work around in collector. by Joshua Litt <joshualitt@google.com>
  - 08663c20aba7f985bd839c330bd05bb1cff15196 Change flutter patch to match existing DEPS on master bra... by William Hesse <whesse@google.com>
  - 146ad014d9277ee6b7bc008002867ed7f1f24b49 update js/meta for the 2.10 dev sdk by Jacob MacDonald <jakemac@google.com>
  - 488c7187936bd05726cdd0a9effae154663d6c00 [co19] Roll co19 to d79951e06e443213243e54c2c32694b79a221... by William Hesse <whesse@google.com>
  - ba20edd7bef6dec010cd4fa064adfeba86b3c7df Add patch for flutter-engine when changing to version 2.10 by William Hesse <whesse@google.com>
  - 24c7666def53832a31559beac130eb3336008110 Update tests that have the current version number hardcoded by William Hesse <whesse@google.com>
  - f88ce7aef5f8a41fddfab8e26f8b2c6e0e950236 Increase Dart version to 2.10 by William Hesse <whesse@google.com>
  - a3815b659047cfc6b63d41d180aa1ca1b781ee68 [ VM ] Fix issue where ExitCodeHandlerEntry could get stu... by Ben Konyi <bkonyi@google.com>
  - 6f8ce20c993fe1c9f7f1171a4de80d00350d5cf4 Move asInstanceOf(ClassElement) to DartType. by Konstantin Shcheglov <scheglov@google.com>
  - 041e0dd618b6fcabe59e8beaff23b03ae3abecb9 Analyzer: Enforce strict-inference by Sam Rawlins <srawlins@google.com>
  - 23cf1230d0b94df0b77ca0a726b4ec90129588a5 Analyzer: Re-categorize StrongModeCode.INVALID_CAST_* cod... by Sam Rawlins <srawlins@google.com>

PiperOrigin-RevId: 323531102

* Avoid setting driver to null in tearDown

In all these cases it shouldn't be necessary and it simplifies the
code. With Null Safety it'll allow us to use the `late` keyword instead
of making everything nullable, which is much more convenient.

PiperOrigin-RevId: 324579665

* Remove redundant return statement

This will make the Null Safety migration easier (the analyzer gets
smarter and would warn about non-reachable code).

PiperOrigin-RevId: 330904797

* Add Null Safety hints to Webdriver

This only adds comments that contain the hints for the migration tool
and as such does not change the behavior of the code in any way. But
it might be useful to document how we migrated the package. The next
CL will migrate the package to Null Safety and remove all these
comments.

PiperOrigin-RevId: 330909885

* Migrate WebDriver to Null Safety

TGP:
http://test/OCL:323985733:BASE:330920955:1599743429539:dd5de8cf
Deflake:
http://test/OCL:323985733:BASE:330920955:1599747766164:73898b23
PiperOrigin-RevId: 332167802

* Fix sync http nullable parameter problem.

PiperOrigin-RevId: 335849279

* Remove unused dart:async imports.

As of Dart 2.1, Future/Stream have been exported from dart:core.

More information: go/dart-lsc-remove-unused-async-imports

PiperOrigin-RevId: 343863452

Co-authored-by: jingbian <jingbian@google.com>
Co-authored-by: copybara-service[bot] <copybara-servicebot@google.com>
Co-authored-by: srawlins <srawlins@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants