From 1e82190eef0647bea0930a252db407f0ec24dd4e Mon Sep 17 00:00:00 2001 From: Sherry Zhou Date: Tue, 23 Apr 2024 14:23:55 -0700 Subject: [PATCH] Fix wpt for Linux builds Found Web platform tests result are not correctly being added to the test_results. After fixed this issue, there are actually three more tests failed in all Linux builds. Disable those tests first. b/336564460 --- cobalt/build/cobalt_configuration.py | 3 +++ cobalt/layout_tests/web_platform_tests.cc | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cobalt/build/cobalt_configuration.py b/cobalt/build/cobalt_configuration.py index f3e5b77063be..e34b25d3dd23 100644 --- a/cobalt/build/cobalt_configuration.py +++ b/cobalt/build/cobalt_configuration.py @@ -137,6 +137,9 @@ def GetWebPlatformTestFilters(self): 'websockets/WebPlatformTest.Run/websockets_opening_handshake_003_html', 'websockets/WebPlatformTest.Run/websockets_opening_handshake_005_html', 'service_workers/WebPlatformTest.Run/service_workers_service_worker_register_wait_forever_in_install_worker_https_html', + 'csp/WebPlatformTest.Run/content_security_policy_script_src_script_src_1_10_1_html', + 'cors/WebPlatformTest.Run/cors_credentials_flag_htm', + 'html/WebPlatformTest.Run/html_dom_documents_dom_tree_accessors_Document_currentScript_sub_html', ] return filters diff --git a/cobalt/layout_tests/web_platform_tests.cc b/cobalt/layout_tests/web_platform_tests.cc index 1f364918e74a..e0cd0d81ff56 100644 --- a/cobalt/layout_tests/web_platform_tests.cc +++ b/cobalt/layout_tests/web_platform_tests.cc @@ -299,7 +299,7 @@ HarnessResult ParseResults(const std::string& json_results) { for (size_t i = 0; i < test_list->size(); ++i) { TestResult result; - const base::Value::Dict* test_dict = (*test_list)[0].GetIfDict(); + const base::Value::Dict* test_dict = (*test_list)[i].GetIfDict(); EXPECT_TRUE(!!test_dict); auto result_status = test_dict->FindInt("status"); @@ -318,6 +318,7 @@ HarnessResult ParseResults(const std::string& json_results) { if (result_stack) { result.stack = *result_stack; } + test_results.push_back(result); } return harness_result; }