Replace RunLoop::Run() with RunUntil-based timeout in the
SameDocumentCommitObserver to prevent indefinite hangs when the
same-document navigation doesn't fire DidFinishNavigation on macOS
arm64 CI. The observer still uses event-driven detection via
DidFinishNavigation, but the wait mechanism now has a built-in
timeout instead of blocking forever.
Also add verification that the right pane URL doesn't change during
same-document navigation (no unintended redirect).
Fixes https://github.com/brave/brave-browser/issues/52808
When no command-line argument is provided for specifying the OHTTP
environment, ads does not correctly fall back to the expected default
OHTTP environment, i.e., staging for non-official builds, and production
for official builds, unless overridden.
Update Android Origin paywall from subscription to one-time purchase
- Replace monthly/yearly subscription plan selectors with single "One Time Purchase" plan row
- Add 4th feature benefit: one-time purchase, no subscription cost
- Add Origin description and Brave Search Premium note sections
- Replace "Try 7 days free" with "Buy now" button
- Replace "Refresh your credentials" with "Get a login code" button
- Remove "Learn more about Origin" button and unused resources
- Update text styles per design spec
- Comment out billing integration for later hookup
Resolves: https://github.com/brave/brave-browser/issues/52855
Often placeholders can appear next to an actual digit in the
translated string (e.g. <ph name="X">$1>0), which will appear on
the front end as "$10". In order to interpret such strings
correctly, we should only support single-digit placeholders by
default. Support for multi-digit placeholders may be added in
the future.
In addition, formatString has been modified to write errors to
the console instead of throw (which can take down the entire page).
Currently ParseSSE splits each incoming chunk into lines independently,
but network chunks don't always align with SSE line boundaries. When a
line is split across chunks, usually happens when the event is large,
the first fragment produces invalid JSON and later fragments are dropped
due to not starting with "data: {" prefix.
This commit replaces base::SplitStringPiece with incremental line
scanning, each complete line is handed to the new ProcessSSELine helper
and processed the same as before. Partial lines missing line breaks are
buffered in |sse_line_buffer_| until a line ending completes them in the
next chunk.
Also clears |sse_line_buffer_| on retry and completion.
* Add new API infrastructure for AI Chat
Add new createInterfaceApi-based API files that will be used to migrate
AI Chat from the old PageAPI singleton pattern. This commit adds the
infrastructure without changing any consumers:
- ai_chat_api.ts: New createAIChatApi() factory for service/UI handler
- conversation_api.ts: New createConversationApi() factory
- bind_conversation.ts: Conversation binding helpers
- mock_interfaces.ts: Mock implementations for testing
The existing api/index.ts (old getAPI() singleton) remains unchanged
so all current consumers continue to work.
Add GetBubbleArrowForSidebar() utility to dynamically set bubble arrows (LEFT_TOP or RIGHT_TOP) based on sidebar horizontal alignment preference.
Applied to:
SidebarAddItemBubbleDelegateView
SidebarEditItemBubbleDelegateView
SidebarItemAddedFeedbackBubble
This ensures bubbles point toward the sidebar regardless of whether it's positioned on the left or right side of the browser window.
This change fixes sidebar bubble's offscreen position on some Linux environments by setting bubble arrow position based on sidebar position.
TEST=SidebarUtilTest.GetBubbleArrowForSidebarTest
Resolvesbrave/brave-browser#50967Resolvesbrave/brave-browser#49174
This is the first step in converting BraveRequestInfo to use unique_ptr/WeakPtr instead of shared_ptr. This change is necessary in order to add thread checks internally to enforce correct usage.
This is an upstream Chromium test with an 8.1% flake rate per LUCI
Analysis (30-day lookback). The test has intermittent timing failures
in IWA retry logic using MOCK_TIME + BackoffEntry - expected 1 install
task but got 2 due to retry firing earlier than expected.
No Brave modifications exist in the IWA policy area. Another test from
the same class (RetryTriggeredWhenAllTasksDone) is already filtered for
the same reason.
Resolves https://github.com/brave/brave-browser/issues/52780
When a TestingProfile is destroyed, ShutdownStoragePartitions() triggers
background database cleanup tasks (e.g., SharedDictionary SQLite store).
On Windows, these tasks may still hold file locks when a new profile is
created at the same path, causing FATAL crashes in sql::Statement when
two backends compete for the same database file.
Brave creates additional browser context keyed services that widen this
race window compared to upstream Chromium (where the test is 100% stable
with 0% flake rate across 204K+ runs).
Fix: Add FlushForTesting() after ShutdownStoragePartitions() in the
TestingProfile destructor to ensure all background thread pool tasks
complete before the profile directory is released.
Resolvesbrave/brave-browser#52777
The LeveldbValueStore created by TestValueStoreFactory registers itself
as a memory dump provider. When a memory dump is triggered during the
NonBlockingDelay polling loop, it attempts to create a dump with name
"extensions/value_store/Extensions.Database.Open.Test/<ptr>" which is
not in the kAllocatorDumpNameAllowlist, causing a DCHECK failure.
Scope the store so it is destroyed (and unregistered) before the
polling loop runs.
Resolvesbrave/brave-browser#52739
Verifies that entries in the filter files start with a '-'.
If an etnry doesn't start with a '-' (and for example starts with a '='
as a mistyped '-'), then only that test is run.