Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Add service protocol method to facilitate getting snapshots #32628

Merged
merged 2 commits into from
Apr 13, 2022

Conversation

iskakaushik
Copy link
Contributor

No description provided.

@iskakaushik iskakaushik added the Work in progress (WIP) Not ready (yet) for review! label Apr 12, 2022
rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
document.Accept(writer);
std::string expected_json =
"\"snapshot\":[137,80,78,71,13,10,26,10,0,"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider adding a doc comment explaining how this was generated and what might cause it to change (and what an acceptable change would be).

"0,0,13,73,68,65,84,8,153,99,248,207,192,240,31,0,5,0,1,255,171,206,54,"
"137,0,0,0,0,73,69,78,68,174,66,96,130]";
std::string actual_json = buffer.GetString();
EXPECT_THAT(actual_json, ::testing::HasSubstr(expected_json));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there JSON methods we could be using instead to validate fields? e.g. validate that snapshot is a list of integers, and validate that the timing field is present?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could maybe parse it out with rapidjson and validate that the timing field exists. I was being lazy and using HasSubstring. Let me change it to do real parsing instead.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I'm mainly worried that this test will break if we move to a different rendering backend or the rendering backend slightly changes things and it'll take more work to validate)

Copy link
Contributor

@dnfield dnfield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change LG, if you can improve the test it would be nice (or at the least please add a comment about how to update it and what it should visually look like)

@iskakaushik
Copy link
Contributor Author

I improved the test and added a comment on how to make it even better.

@iskakaushik iskakaushik added waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. and removed Work in progress (WIP) Not ready (yet) for review! labels Apr 13, 2022
@fluttergithubbot fluttergithubbot merged commit 1fb4615 into flutter:main Apr 13, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 14, 2022
justinmc pushed a commit to justinmc/engine that referenced this pull request Apr 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants