Commit Graph

913 Commits

Author SHA1 Message Date
Marshall Greenblatt 37aee4d3a0 Improve the timing of OnLoadEnd (fixes issue #3341)
Use WebContentsDelegate::DidFinishLoad instead of a custom Mojo message.
This fixes flaky OnLoadEnd behavior with NavigationTest.Order.
2022-08-25 18:23:33 -04:00
Marshall Greenblatt 5ec6e62656 tests: Fix DOMTest failure with fractional devicePixelRatio 2022-08-25 14:09:20 -04:00
Marshall Greenblatt bf467e136a tests: Disable HTTPS server reuse between tests (see issue #3348)
We can't currently reuse the HTTPS server between tests due to
https://crrev.com/dd2a57d753 causing certificate registration issues.
2022-08-25 14:09:20 -04:00
Marshall Greenblatt e95d1653ac tests: Fix failures on multiple execution of HSTSRedirectTest.Redirect (see issue #3336) 2022-08-25 14:09:20 -04:00
Marshall Greenblatt a4b8935427 Add missing newline at end of file 2022-08-16 16:23:27 -04:00
Marshall Greenblatt 7fdbb427bc alloy: Fix flaky OnDraggableRegionsChanged behavior (fixes issue #3374)
Disable BackForwardCache globally for the Alloy runtime so that
blink::RuntimeEnabledFeatures::BackForwardCacheEnables reports the
correct value in the renderer process.
2022-08-11 17:25:36 -04:00
Marshall Greenblatt e44f76bbe4 Fix DisplayTest.AutoResize failure 2022-08-11 14:49:54 -04:00
Marshall Greenblatt f8d10289b5 Fix DOMTest failure related to device scaling 2022-08-11 14:20:23 -04:00
Marshall Greenblatt 0ddb572c03 chrome: Add support for CefRequestHandler::OnCertificateError (see issue #3148) 2022-08-09 15:43:00 -04:00
Marshall Greenblatt ecb29b7fa5 alloy: Fix OnCertificateError callback for requests redirected to HTTPS (fixes issue #3364)
This change also adds initial unit test coverage for OnCertificateError (see issue #3148).
2022-08-09 13:31:18 -04:00
Marshall Greenblatt 9f7a59536c windows: cefclient: Fix crash when triggering IME popup (see issue #3313) 2022-08-04 13:18:17 -04:00
Marshall Greenblatt 18dac30874 Support configuration of the CefTestServer certificate type (see issue #3348) 2022-08-04 12:37:12 -04:00
Marshall Greenblatt dcd4a0077c Include net test data in the binary distribution (see issue #3348) 2022-08-03 16:28:52 -04:00
Marshall Greenblatt 46e1c4f177 ceftests: Add HSTS redirect test (see issue #3336, see issue #3348) 2022-08-03 12:14:51 -04:00
Marshall Greenblatt 952f2b0829 ceftests: Rename test_server::Observer::OnHttpRequest to OnTestServerRequest (see issue #3348) 2022-08-01 21:14:12 -04:00
Marshall Greenblatt 0b1c3938c6 ceftests: Fix CookieTest failure with --use-test-http-server (see issue #3348) 2022-08-01 21:09:02 -04:00
Marshall Greenblatt a895274add ceftests: Add test_server support for CefTestServer (see issue #3348) 2022-08-01 16:20:04 -04:00
Marshall Greenblatt f24dd61329 Add CefTestServer that supports both HTTP and HTTPS (see issue #3348) 2022-08-01 16:20:03 -04:00
Marshall Greenblatt ce18bb98ab ceftests: Deprecate the use of test_server constants (see issue #3348) 2022-08-01 16:20:03 -04:00
Marshall Greenblatt a4d63010c9 ceftests: Refactor test_server to support both HTTP and HTTPS servers (see issue #3348) 2022-08-01 16:20:03 -04:00
Marshall Greenblatt 68be2b8938 ceftests: Generalize the test_server::Observer interface (see issue #3348)
Don't expose CefServer implementation details to consumers.
2022-08-01 15:14:13 -04:00
Marshall Greenblatt 654f570b6e windows: Fix Views test failures (fixes issue #3365) 2022-07-27 13:57:53 -04:00
Marshall Greenblatt a9043f2e80 Replace macros with C++17 features (see issue #3362)
- Convert ALLOW_UNUSED_LOCAL to [[maybe_unused]]
- Convert WARN_UNUSED_RESULT to [[nodiscard]]
2022-07-27 12:52:45 -04:00
Marshall Greenblatt 9af494d36c Update to Chromium version 105.0.5195.0 (#1027018) 2022-07-25 23:47:56 -04:00
Marshall Greenblatt 5e753d211f Run TimeTest.InvalidBaseTimeToTime on Windows only (see issue #2935)
This test is failing on Linux and MacOS.
2022-07-22 13:31:29 -04:00
Marshall Greenblatt 3838536126 windows: Fix warning C4267 conversion from 'size_t' to 'int' (see issue #3126) 2022-07-19 10:09:36 -04:00
Marshall Greenblatt 4aef0ada9d Add missing newline at end of file (see issue #3126) 2022-07-19 10:09:35 -04:00
Dmitry Azaraev 27d3089804 Add CefBaseTime and use it instead of CefTime (see issue #2935) 2022-07-19 10:09:35 -04:00
Nik Pavlov 987b932a19 Fix compilation errors from shared message unit tests (see issue #3126) 2022-07-19 14:09:10 +00:00
Marshall Greenblatt ba947d842a alloy: win: Focus the browser after dismissal of a modal dialog (fixes issue #3361) 2022-07-15 14:05:58 +03:00
Marshall Greenblatt f1003df810 chrome: Add support for OnRequestMediaAccessPermission callback (see issue #2582) 2022-07-08 07:40:35 +00:00
Marshall Greenblatt e4b9169221 Add CefPermissionHandler callbacks for permission prompts (see issue #3352) 2022-07-07 10:01:24 +00:00
Nik Pavlov 81e892d19e Add a shared memory variant of CefProcessMessage (fixes issue #3126)
CefSharedProcessMessageBuilder supports creation of a CefProcessMessage
backed by a CefSharedMemoryRegion.

Performance tests comparing the existing ArgumentList approach and the new
SharedMemoryRegion approach have been added to cefclient at
http://tests/ipc_performance.

CefMessageRouter has been updated to use SharedMemoryRegion as transport
for larger message payloads. The threshold is configurable via
|CefMessageRouterConfig.message_size_threshold|.

To test:
run `ceftests --gtest_filter=SendSharedProcessMessageTest.*:SharedProcessMessageTest.*:MessageRouterTest.Threshold*`
2022-07-04 09:49:15 +00:00
Marshall Greenblatt daa89115d5 Add OnMediaAccessChange notification (fixes issue #3310) 2022-06-30 12:22:28 +00:00
Marshall Greenblatt 26e30b3859 Add CefPermissionHandler callback for media access (fixes issue #2582) 2022-06-30 07:31:18 +00:00
Marshall Greenblatt c7ea0c5958 Update to Chromium version 104.0.5112.0 (#1012729)
- Mac: 10.13 is now the minimum required macOS version
2022-06-22 10:56:35 +03:00
Marshall Greenblatt 35654cd709 alloy: Use Chrome JS dialogs on Windows/Linux (fixes issue #3316) 2022-06-03 22:45:23 +03:00
Marshall Greenblatt b5eba89598 cefclient: Linux: Fix OSR context menu placement (see issue #2640)
This only fixes the top-level menu placement. Sub-menus are still
placed incorrectly.
2022-06-03 22:45:10 +03:00
JohnKarel d9b764860a alloy: Add touch handle and quick menu support for OSR (fixes issue #3268)
The client is responsible for rendering both as no default implementation
is currently available for OSR.
2022-05-30 10:51:39 +03:00
Marshall Greenblatt 771e5c7c0c ceftests: Replace unicode characters with encoded equivalent 2022-05-30 10:26:12 +03:00
Marshall Greenblatt ee15eca351 ceftests: Minor code cleanup 2022-05-25 16:42:41 +03:00
Marshall Greenblatt 7a372a642b alloy: Use Views context menus on Windows/Linux (fixes issue #3330) 2022-05-20 14:15:17 +03:00
Marshall Greenblatt 2ea7459a89 Use Chrome file dialogs on all platforms and runtimes (fixes issue #3314)
All file dialogs irrespective of source, platform and runtime will now be
routed through CefFileDialogManager and trigger CefDialogHandler callbacks
(see issue #3293).

Adds Chrome runtime support for CefBrowserHost::RunFileDialog and
CefDialogHandler callbacks.

Adds Alloy runtime support for internal GTK file and print dialogs on Linux
subject to the following limitations:

1. Internal GTK implementation:
   - Cannot be used with multi-threaded-message-loop because Chromium's
     internal GTK implementation is not thread-safe (does not use GDK threads).
   - Dialogs will not be modal to application windows when used with off-screen
     rendering due to lack of access to the client's top-level GtkWindow.
2. Cefclient CefDialogHandler implementation:
   - Cannot be used with Views because it requires a top-level GtkWindow.

Due to the above limitations no dialog implementation is currently provided for
Views + multi-threaded-message-loop on Linux. In cases where both
implementations are supported the cefclient version is now behind an optional
`--use-client-dialogs` command-line flag.

Expressly forbids multiple simultaneous file dialogs with the internal platform
implementation which uses modal dialogs. CefDialogHandler will still be notified
and can optionally handle each request without a modal dialog (see issue #3154).

Removes some RunFileDialog parameters that are not supported by the Chrome file
dialog implementation (selected_accept_filter parameter, cef_file_dialog_mode_t
overwrite/read-only flags).
2022-04-19 18:52:26 -04:00
Marshall Greenblatt 4921dc2213 Fix unintentional state transfer in DetachToUserFree (fixes issue #3309)
Calling DetachToUserFree() on a CefString holding a reference should copy the
value instead of transferring ownership.

A new `StringTest.Ownership` test has been added for this behavior.
2022-04-13 14:33:25 -04:00
Marshall Greenblatt d8db6fa9da mac: cefclient: Use RootWindowManager to track key window status (fixes issue #3307)
This change provides a generic solution for active (key) window tracking that
works with both Views-hosted and native windows on MacOS. With this new approach
we can now successfully route top menu actions to the currently active window.

Prior to this change CEF's Views API was using focus notifications as a proxy
for window activation notifications. That doesn't work on MacOS where NSWindow
activation (key status) is independent of NSView focus (first responder) status,
and changes in activation don't necessarily generate focus notifications (see
NativeWidgetMac::OnWindowKeyStatusChanged). To make this work reliably on all
platforms we now expose a CefWindowDelegate::OnWindowActivationChanged callback.

This change also fixes an uninitialized variable
(RootWindowMacImpl::with_extension_) that was causing flaky behavior in
RootWindowManager::OnRootWindowActivated.

To test:
1. Run `cefclient [--use-views]`
2. Select Popup Window from the Tests menu. Do not explicitly activate the popup
   window (e.g. don't click on it).
3. Verify that further Tests menu actions go to the popup window.
4. Change activation to a first window by clicking on it. Verify that Test
   menu actions go to that window.
5. Close the currently active window. Do not explicitly activate the remaining
   window (e.g. don't click on it).
6. Verify that Test menu actions go to the only remaining window.
2022-04-12 16:37:01 -04:00
Nik Pavlov 493232ce5a alloy: mac: Fix default popup window positioning (see issue #3244)
Popup windows will be created on the display that best matches the requested
coordinates. The requested size will apply to the content area (as required by
JS documentation) and window size will be reduced if necessary to fit within the
target display. The requested origin will apply to the window (including frame)
and will be modified if necessary so that the window is fully visible on the
target display.
2022-04-12 17:12:16 +00:00
Marshall Greenblatt 75ca552a4e cefclient: Add option to create default popups (see issue #3165, see issue #3294)
This change adds a `--use-default-popup` command-line option to cefclient. When
specified, popup windows will be created with default styling (e.g. without an
application-provided native parent window).

This change also adds some reasonable default window bounds in cases where they
are not specified by the client.
2022-04-12 11:49:27 -04:00
Marshall Greenblatt 3000bc8748 chrome: win/linux: Add support for browser with native parent (see issue #3294)
This change adds Chrome runtime support on Windows and Linux for creating a
browser parented to a native window supplied by the client application.
Expected API usage and window behavior is similar to what already exists with
the Alloy runtime. The parent window handle should be specified by using
CefWindowInfo::SetAsChild in combination with the CefBrowserHost::CreateBrowser
and CefLifeSpanHandler::OnBeforePopup callbacks.

The previously existing behavior of creating a fully-featured Chrome browser
window when empty CefWindowInfo is used with CreateBrowser remains unchanged
and Views is still the preferred API for creating top-level Chrome windows
with custom styling (e.g. title bar only, frameless, etc).

The cefclient Popup Window test with a native parent window continues to crash
on Linux with both the Alloy and Chrome runtimes (see issue #3165).

Also adds Chrome runtime support for CefDisplayHandler::OnCursorChange.

To test:
- Run `cefclient --enable-chrome-runtime [--use-views]` for the default (and
  previously existing) Views-based behavior.
- Run `cefclient --enable-chrome-runtime --use-native` for the new native
  parent window behavior.
- Run `cefclient --enable-chrome-runtime --use-native --no-activate` and the
  window will not be activated (take input focus) on launch (Windows only).
- Run `cefclient --enable-chrome-runtime [--use-views|--use-native]
  --mouse-cursor-change-disabled` and the mouse cursor will not change on
  mouseover of DOM elements.
2022-04-12 11:49:26 -04:00
Marshall Greenblatt 21cf732e7f chrome: Update expectations with same-site BFCache enabled (fixes issue #3301)
With same-site BFCache enabled every navigation can now potentially be served
via the BFCache. To support this internally a new top-level RenderFrame object
may be created for each new navigation. As a result, OnBrowserCreated may now
be called multiple times with the same browser ID in a given renderer process
(a behavior previously only seen with cross-site navigations and different
renderer processes).

BFCache navigations do not trigger the same Chromium notifications as a normal
load. To avoid breaking CEF API usage expectations we now synthetically
generate the load-related callbacks that would otherwise be missing
(OnLoadingStateChange with isLoading=true, OnLoadStart, OnLoadEnd). The
|httpStatusCode| argument to OnLoadEnd will be 0 in this case.

To test:
- Run `FrameHandlerTest.*:MessageRouterTest.*:NavigationTest.*`
- Run `NavigationTest.LoadSameOriginLoadURL` for OnBrowserCreated behavior.
- Run `NavigationTest.History` for load-related callback behavior.
2022-04-05 15:30:30 -04:00
Marshall Greenblatt 77466e7b6d alloy: Use chrome's value for ApplicationClientIdForFileScanning (fixes issue #3030)
This change removes CefSettings.application_client_id_for_file_scanning in
favor of always using the same hard-coded value as chrome.
2022-03-24 12:16:11 -04:00