Commit 8fec29bb authored by Ian McKellar's avatar Ian McKellar Committed by Commit Bot

Reland "[Fuchsia] Update to new FIDL string and vector APIs"

This is a reland of 5351d11f

Original change's description:
> [Fuchsia] Update to new FIDL string and vector APIs
>
> This removes usages of the old API that will become build failures when
> deprecation warnings are turned on.
>
> See: https://fuchsia-review.googlesource.com/c/fuchsia/+/304389
> Change-Id: Ie5db014401d79787101b2b4b6e7585fd7a23b1ce
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1727375
> Commit-Queue: Ian McKellar <ianloic@chromium.org>
> Reviewed-by: Wez <wez@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#682796}

TBR=ianloic

Change-Id: I805e7e0274e5f42bcbb8c53ef2afa57186d85582
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1728722Reviewed-by: default avatarWez <wez@chromium.org>
Commit-Queue: Wez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#683008}
parent f4488a85
......@@ -288,11 +288,11 @@ class TestolaImpl : public fidljstest::Testola {
for (uint64_t i = 0; i < fidljstest::ARRRR_SIZE; ++i) {
sat.arrrr[i] = static_cast<int32_t>(i * 5) - 10;
}
sat.nullable_vector_of_string0 = nullptr;
sat.nullable_vector_of_string0.reset();
std::vector<std::string> vector_of_str;
vector_of_str.push_back("passed_str0");
vector_of_str.push_back("passed_str1");
sat.nullable_vector_of_string1.reset(std::move(vector_of_str));
sat.nullable_vector_of_string1 = std::move(vector_of_str);
std::vector<fidljstest::Blorp> vector_of_blorp;
vector_of_blorp.push_back(fidljstest::Blorp::GAMMA);
vector_of_blorp.push_back(fidljstest::Blorp::BETA);
......@@ -352,9 +352,9 @@ class TestolaImpl : public fidljstest::Testola {
ASSERT_EQ(nullable.size(), 5u);
EXPECT_EQ(nullable[0], "str3");
EXPECT_TRUE(nullable[1].is_null());
EXPECT_TRUE(nullable[2].is_null());
EXPECT_TRUE(nullable[3].is_null());
EXPECT_FALSE(nullable[1].has_value());
EXPECT_FALSE(nullable[2].has_value());
EXPECT_FALSE(nullable[3].has_value());
EXPECT_EQ(nullable[4], "str4");
ASSERT_EQ(max_strlen.size(), 1u);
......
......@@ -203,7 +203,8 @@ void CheckResponseBuffer(const oldhttp::URLResponse& response,
void CheckResponseHeaders(const oldhttp::URLResponse& response,
ResponseHeaders* expected_headers) {
for (auto& header : response.headers.get()) {
ASSERT_TRUE(response.headers.has_value());
for (auto& header : response.headers.value()) {
const std::string header_name = header.name.data();
const std::string header_value = header.value.data();
auto iter = std::find_if(expected_headers->begin(), expected_headers->end(),
......
......@@ -420,12 +420,13 @@ oldhttp::URLResponse URLLoaderImpl::BuildResponse(int net_error) {
size_t iter = 0;
std::string header_name;
std::string header_value;
response.headers.emplace();
while (response_headers->EnumerateHeaderLines(&iter, &header_name,
&header_value)) {
oldhttp::HttpHeader header;
header.name = header_name;
header.value = header_value;
response.headers.push_back(header);
response.headers->push_back(header);
}
}
......
......@@ -26,7 +26,7 @@ fuchsia::fonts::ProviderSyncPtr RunTestProviderWithTestFonts(
// fonts, which must be bundled in the calling process' package.
fuchsia::sys::LaunchInfo launch_info;
launch_info.url = "fuchsia-pkg://fuchsia.com/fonts#meta/fonts.cmx";
launch_info.arguments.reset(
launch_info.arguments.emplace(
{"--no-default-fonts",
"--font-manifest=/test_fonts/fuchsia_test_fonts_manifest.json"});
launch_info.flat_namespace = fuchsia::sys::FlatNamespace::New();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment