mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Update to Chromium version 90.0.4430.0 (#857950)
- Linux ARM builds require use_vaapi=false (see https://crbug.com/1185348) - Windows official builds require use_thin_lto=false (see https://crbug.com/1177001)
This commit is contained in:
@@ -41,7 +41,9 @@ std::string GetOrigin(HandlerType handler) {
|
||||
case HandlerType::SERVER:
|
||||
return test_server::kServerOrigin;
|
||||
case HandlerType::HTTP_SCHEME:
|
||||
return "http://corstest.com";
|
||||
// Use HTTPS because requests from HTTP to the loopback address will be
|
||||
// blocked by https://chromestatus.com/feature/5436853517811712.
|
||||
return "https://corstest.com";
|
||||
case HandlerType::CUSTOM_STANDARD_SCHEME:
|
||||
// Standard scheme that is CORS and fetch enabled.
|
||||
// Registered in scheme_handler_unittest.cc.
|
||||
@@ -1122,6 +1124,19 @@ void SetupExecRequest(ExecMode mode,
|
||||
std::string());
|
||||
preflight_resource->InitPreflight(main_handler);
|
||||
setup->AddResource(preflight_resource);
|
||||
|
||||
if (main_handler == HandlerType::CUSTOM_NONSTANDARD_SCHEME &&
|
||||
add_header) {
|
||||
setup->AddConsoleMessage(
|
||||
"The website requested a subresource from a network that it could "
|
||||
"only access because of its users' privileged network position. "
|
||||
"These requests expose non-public devices and servers to the "
|
||||
"internet, increasing the risk of a cross-site request forgery "
|
||||
"(CSRF) attack, and/or information leakage. To mitigate these "
|
||||
"risks, Chrome deprecates requests to non-public subresources when "
|
||||
"initiated from non-secure contexts, and will start blocking them "
|
||||
"in Chrome 92 (July 2021)");
|
||||
}
|
||||
} else {
|
||||
// The server will not handle the preflight request. Expect the
|
||||
// cross-origin XHR to be blocked.
|
||||
|
@@ -220,16 +220,20 @@ class PluginTestHandler : public RoutingTestHandler,
|
||||
return "document.getElementsByTagName('embed')[0]";
|
||||
}
|
||||
|
||||
void WaitForNavigatorPlugins(CefRefPtr<CefFrame> frame) const {
|
||||
// Test if the `navigator.plugins` list includes the PDF extension.
|
||||
const std::string& code =
|
||||
" if (navigator.plugins['Chrome PDF Viewer'].filename == "
|
||||
" 'mhjfbmdgcfjbbpaeojofohoefgiehjai') {"
|
||||
" window.testQuery({request:'pdf_plugin_found'});"
|
||||
"} else {"
|
||||
" window.testQuery({request:'pdf_plugin_missing'});"
|
||||
"}";
|
||||
frame->ExecuteJavaScript(code, frame->GetURL(), 0);
|
||||
void WaitForNavigatorPlugins(CefRefPtr<CefFrame> frame) {
|
||||
// We can no longer test for navigator.plugins because it returns empty
|
||||
// as of https://www.chromestatus.com/feature/5741884322349056.
|
||||
if (HasNoList()) {
|
||||
// The plugin will not load. End the test.
|
||||
EndTest();
|
||||
} else if (HasBlock() || HasDisable()) {
|
||||
// Wait for the plugin placeholder for the first PDF file to load. The
|
||||
// test will continue from OnQuery.
|
||||
WaitForPlaceholderLoad(frame);
|
||||
} else {
|
||||
// Wait for the first PDF file to load.
|
||||
WaitForPluginLoad(frame);
|
||||
}
|
||||
}
|
||||
|
||||
void WaitForPlaceholderLoad(CefRefPtr<CefFrame> frame) {
|
||||
@@ -383,24 +387,7 @@ class PluginTestHandler : public RoutingTestHandler,
|
||||
const CefString& request,
|
||||
bool persistent,
|
||||
CefRefPtr<Callback> callback) override {
|
||||
if (request == "pdf_plugin_found" || request == "pdf_plugin_missing") {
|
||||
if (request == "pdf_plugin_found")
|
||||
got_pdf_plugin_found_.yes();
|
||||
else
|
||||
got_pdf_plugin_missing_.yes();
|
||||
|
||||
if (HasNoList()) {
|
||||
// The plugin will not load. End the test.
|
||||
EndTest();
|
||||
} else if (HasBlock() || HasDisable()) {
|
||||
// Wait for the plugin placeholder for the first PDF file to load. The
|
||||
// test will continue from OnQuery.
|
||||
WaitForPlaceholderLoad(frame);
|
||||
} else {
|
||||
// Wait for the first PDF file to load.
|
||||
WaitForPluginLoad(frame);
|
||||
}
|
||||
} else if (request == "placeholder_loaded") {
|
||||
if (request == "placeholder_loaded") {
|
||||
EXPECT_FALSE(got_placeholder_loaded_);
|
||||
EXPECT_FALSE(got_placeholder_hidden_);
|
||||
got_placeholder_loaded_.yes();
|
||||
@@ -429,9 +416,15 @@ class PluginTestHandler : public RoutingTestHandler,
|
||||
void TriggerContextMenu(CefRefPtr<CefBrowser> browser) {
|
||||
CefMouseEvent mouse_event;
|
||||
|
||||
// Somewhere in the first plugin.
|
||||
mouse_event.x = 100;
|
||||
mouse_event.y = 100;
|
||||
if (HasDirectPluginLoad()) {
|
||||
// Somewhere in the main PDF viewing area (avoid left preview bar).
|
||||
mouse_event.x = 400;
|
||||
mouse_event.y = 200;
|
||||
} else {
|
||||
// Somewhere in the first plugin.
|
||||
mouse_event.x = 100;
|
||||
mouse_event.y = 100;
|
||||
}
|
||||
|
||||
// Send right-click mouse down and mouse up to tigger context menu.
|
||||
browser->GetHost()->SendMouseClickEvent(mouse_event, MBT_RIGHT, false, 1);
|
||||
@@ -514,14 +507,10 @@ class PluginTestHandler : public RoutingTestHandler,
|
||||
|
||||
if (HasNoList()) {
|
||||
EXPECT_TRUE(got_on_before_plugin_empty_origin2_);
|
||||
EXPECT_FALSE(got_pdf_plugin_found_);
|
||||
EXPECT_TRUE(got_pdf_plugin_missing_);
|
||||
EXPECT_FALSE(got_run_context_menu_);
|
||||
EXPECT_FALSE(got_context_menu_dismissed_);
|
||||
} else {
|
||||
EXPECT_FALSE(got_on_before_plugin_empty_origin2_);
|
||||
EXPECT_TRUE(got_pdf_plugin_found_);
|
||||
EXPECT_FALSE(got_pdf_plugin_missing_);
|
||||
EXPECT_TRUE(got_run_context_menu_);
|
||||
EXPECT_TRUE(got_context_menu_dismissed_);
|
||||
}
|
||||
@@ -569,8 +558,6 @@ class PluginTestHandler : public RoutingTestHandler,
|
||||
TrackCallback got_on_load_end_html_;
|
||||
TrackCallback got_on_load_end_pdf1_;
|
||||
TrackCallback got_on_load_end_pdf2_;
|
||||
TrackCallback got_pdf_plugin_found_;
|
||||
TrackCallback got_pdf_plugin_missing_;
|
||||
TrackCallback got_placeholder_loaded_;
|
||||
TrackCallback got_placeholder_hidden_;
|
||||
TrackCallback got_run_context_menu_;
|
||||
|
@@ -2581,15 +2581,20 @@ TEST(SchemeHandlerTest, AcceptLanguage) {
|
||||
void RegisterSchemeHandlerCustomSchemes(
|
||||
CefRawPtr<CefSchemeRegistrar> registrar,
|
||||
std::vector<CefString>& cookiable_schemes) {
|
||||
// Registering the custom standard schemes as secure because requests from
|
||||
// non-secure origins to the loopback address will be blocked by
|
||||
// https://chromestatus.com/feature/5436853517811712.
|
||||
|
||||
// Add a custom standard scheme.
|
||||
registrar->AddCustomScheme(
|
||||
"customstd", CEF_SCHEME_OPTION_STANDARD | CEF_SCHEME_OPTION_CORS_ENABLED);
|
||||
registrar->AddCustomScheme("customstd", CEF_SCHEME_OPTION_STANDARD |
|
||||
CEF_SCHEME_OPTION_SECURE |
|
||||
CEF_SCHEME_OPTION_CORS_ENABLED);
|
||||
cookiable_schemes.push_back("customstd");
|
||||
// Also used in cors_unittest.cc.
|
||||
registrar->AddCustomScheme("customstdfetch",
|
||||
CEF_SCHEME_OPTION_STANDARD |
|
||||
CEF_SCHEME_OPTION_CORS_ENABLED |
|
||||
CEF_SCHEME_OPTION_FETCH_ENABLED);
|
||||
registrar->AddCustomScheme(
|
||||
"customstdfetch", CEF_SCHEME_OPTION_STANDARD | CEF_SCHEME_OPTION_SECURE |
|
||||
CEF_SCHEME_OPTION_CORS_ENABLED |
|
||||
CEF_SCHEME_OPTION_FETCH_ENABLED);
|
||||
cookiable_schemes.push_back("customstdfetch");
|
||||
// Add a custom non-standard scheme.
|
||||
registrar->AddCustomScheme("customnonstd", CEF_SCHEME_OPTION_NONE);
|
||||
|
@@ -294,27 +294,42 @@ class TracingTestHandler : public CefEndTracingCallback,
|
||||
1000, "arg1", 1);
|
||||
break;
|
||||
case TT_TRACE_EVENT_ASYNC_END0:
|
||||
TRACE_EVENT_ASYNC_BEGIN0(kTraceTestCategory,
|
||||
"TT_TRACE_EVENT_ASYNC_END0", 100);
|
||||
TRACE_EVENT_ASYNC_END0(kTraceTestCategory, "TT_TRACE_EVENT_ASYNC_END0",
|
||||
100);
|
||||
break;
|
||||
case TT_TRACE_EVENT_ASYNC_END1:
|
||||
TRACE_EVENT_ASYNC_BEGIN1(kTraceTestCategory,
|
||||
"TT_TRACE_EVENT_ASYNC_END1", 100, "arg1", 1);
|
||||
TRACE_EVENT_ASYNC_END1(kTraceTestCategory, "TT_TRACE_EVENT_ASYNC_END1",
|
||||
100, "arg1", 1);
|
||||
break;
|
||||
case TT_TRACE_EVENT_ASYNC_END2:
|
||||
TRACE_EVENT_ASYNC_BEGIN2(kTraceTestCategory,
|
||||
"TT_TRACE_EVENT_ASYNC_END2", 100, "arg1", 1,
|
||||
"arg2", 2);
|
||||
TRACE_EVENT_ASYNC_END2(kTraceTestCategory, "TT_TRACE_EVENT_ASYNC_END2",
|
||||
100, "arg1", 1, "arg2", 2);
|
||||
break;
|
||||
case TT_TRACE_EVENT_COPY_ASYNC_END0:
|
||||
TRACE_EVENT_COPY_ASYNC_BEGIN0(kTraceTestCategory,
|
||||
"TT_TRACE_EVENT_COPY_ASYNC_END0", 100);
|
||||
TRACE_EVENT_COPY_ASYNC_END0(kTraceTestCategory,
|
||||
"TT_TRACE_EVENT_COPY_ASYNC_END0", 100);
|
||||
break;
|
||||
case TT_TRACE_EVENT_COPY_ASYNC_END1:
|
||||
TRACE_EVENT_COPY_ASYNC_BEGIN1(kTraceTestCategory,
|
||||
"TT_TRACE_EVENT_COPY_ASYNC_END1", 100,
|
||||
"arg1", 1);
|
||||
TRACE_EVENT_COPY_ASYNC_END1(kTraceTestCategory,
|
||||
"TT_TRACE_EVENT_COPY_ASYNC_END1", 100,
|
||||
"arg1", 1);
|
||||
break;
|
||||
case TT_TRACE_EVENT_COPY_ASYNC_END2:
|
||||
TRACE_EVENT_COPY_ASYNC_BEGIN2(kTraceTestCategory,
|
||||
"TT_TRACE_EVENT_COPY_ASYNC_END2", 100,
|
||||
"arg1", 1, "arg2", 2);
|
||||
TRACE_EVENT_COPY_ASYNC_END2(kTraceTestCategory,
|
||||
"TT_TRACE_EVENT_COPY_ASYNC_END2", 100,
|
||||
"arg1", 1, "arg2", 2);
|
||||
@@ -411,6 +426,8 @@ TRACING_TEST(TraceEventAsyncEnd0, TT_TRACE_EVENT_ASYNC_END0)
|
||||
TRACING_TEST(TraceEventAsyncEnd1, TT_TRACE_EVENT_ASYNC_END1)
|
||||
TRACING_TEST(TraceEventAsyncEnd2, TT_TRACE_EVENT_ASYNC_END2)
|
||||
TRACING_TEST(TraceEventCopyAsyncEnd0, TT_TRACE_EVENT_COPY_ASYNC_END0)
|
||||
TRACING_TEST(TraceEventCopyAsyncEnd1, TT_TRACE_EVENT_COPY_ASYNC_END1)
|
||||
TRACING_TEST(TraceEventCopyAsyncEnd2, TT_TRACE_EVENT_COPY_ASYNC_END2)
|
||||
|
||||
TEST(TracingTest, NowFromSystemTraceTime) {
|
||||
int64 val = CefNowFromSystemTraceTime();
|
||||
|
@@ -3182,24 +3182,12 @@ class RequestTestHandler : public TestHandler {
|
||||
got_on_test_complete_.yes();
|
||||
|
||||
if (!context_tmpdir_.IsEmpty()) {
|
||||
// Wait a bit for cache file handles to close after browser or request
|
||||
// context destruction.
|
||||
CefPostDelayedTask(
|
||||
TID_FILE_USER_VISIBLE,
|
||||
base::Bind(&RequestTestHandler::PostTestCompleteFileTasks, this),
|
||||
200);
|
||||
} else {
|
||||
TestComplete();
|
||||
// Delete the temp directory on application shutdown.
|
||||
CefTestSuite::GetInstance()->RegisterTempDirectory(
|
||||
context_tmpdir_.Take());
|
||||
}
|
||||
}
|
||||
|
||||
void PostTestCompleteFileTasks() {
|
||||
EXPECT_TRUE(CefCurrentlyOn(TID_FILE_USER_VISIBLE));
|
||||
|
||||
EXPECT_TRUE(context_tmpdir_.Delete());
|
||||
EXPECT_TRUE(context_tmpdir_.IsEmpty());
|
||||
|
||||
CefPostTask(TID_UI, base::Bind(&RequestTestHandler::TestComplete, this));
|
||||
TestComplete();
|
||||
}
|
||||
|
||||
private:
|
||||
|
@@ -2932,7 +2932,8 @@ class V8TestHandler : public TestHandler {
|
||||
}
|
||||
|
||||
// Time out the test after a reasonable period of time.
|
||||
SetTestTimeout();
|
||||
SetTestTimeout(test_mode_ == V8TEST_ON_UNCAUGHT_EXCEPTION_DEV_TOOLS ? 10000
|
||||
: 5000);
|
||||
}
|
||||
|
||||
void OnBeforeClose(CefRefPtr<CefBrowser> browser) override {
|
||||
|
Reference in New Issue
Block a user